Blame view

src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java 2.31 KB
d688c3f8   hanlei   船务
1
2
3
4
  package com.essa.pageObject.LogisticShipp;
  
  
  import com.essa.framework.BasePage;
3f06ee1c   zengjin   修改时间工具,还有船务相关
5
6
7
  import com.essa.framework.Model;
  import com.essa.pageObject.HomePage;
  import org.openqa.selenium.By;
d688c3f8   hanlei   船务
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
  
  //船务看板-通知确认船务资料界面
  public class LogisticsShippPage extends BasePage {
      public LogisticsShippPage(WebDriver driver) {
          super(driver);
      }
  
      // 通知确认船务资料看板
      @FindBy(xpath = "//a[text()='通知确认船务资料']")
      WebElement NoticeBoard;
  
      //等待数据结构
      @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/table/tbody/tr[1]")
      WebElement resultDate;
  
      //订单编号输入框
      @FindBy (xpath = "//input[@type='text' and @ng-model ='query.keyword']")
      WebElement setPono;
  
      //高级查询按钮
      @FindBy (xpath = "//i[@class='iconfont icon-search']")
      WebElement querySubBtn;
  
      //查询结果
      @FindBy (xpath = "//input[@type ='checkbox' and @checklist-value='item']")
      WebElement selectedpo;
  
      //点击通知确认船务资料
      @FindBy (xpath = "//button[text()='通知确认船务资料']")
      WebElement skippSubBtn;
  
      //点击确认按钮
      @FindBy (xpath = "//html/body/div[5]/div/div/div[2]/div/div/button[1]")
      WebElement submitSubBtn;
  
      //点击退出登录
      @FindBy (xpath="//*[text()='退出']")
      WebElement logout;
  
      //搜索并通知业务补充船务资料
3f06ee1c   zengjin   修改时间工具,还有船务相关
51
52
      public HomePage isSucceed() {
          forceWait(1000);
d688c3f8   hanlei   船务
53
          click(NoticeBoard);
3f06ee1c   zengjin   修改时间工具,还有船务相关
54
55
56
          dynamicWait(By.xpath("//tbody/tr[1]/td[1]/input[1]"));//列表加载
  //        setPono.sendKeys("D180411T0278");
          sendKeys(setPono, Model.getPoNum());
d688c3f8   hanlei   船务
57
58
59
60
61
62
63
          click(querySubBtn);
          mywait(selectedpo);
          click(selectedpo);
          mywait(selectedpo);
          click(skippSubBtn);
          mywait(submitSubBtn);
          click(submitSubBtn);
3f06ee1c   zengjin   修改时间工具,还有船务相关
64
65
66
67
68
          String saleman = DBSqlSearch("select a.account_name from pri_user a INNER JOIN\n" +
                  "sale_po b on a.id=b.salesman_id\n" +
                  "where b.`code` = '"+ Model.getPoNum()+"';","account_name");//根据PO单号查出对应的业务员
          Model.setSalesman(saleman);//将查询出的业务员存储在model中
          return new HomePage(driver);
d688c3f8   hanlei   船务
69
70
      }
  }