Blame view

src/main/java/com/essa/pageObject/DocumentaryManage/POBoardPage.java 3.14 KB
a294c18e   zengjin   修改设置装柜的返回值
1
  package com.essa.pageObject.DocumentaryManage;
27d9a429   suweicheng   开发梳理;
2
  
d3c5a77a   zengjin   idea第一次提交
3
  import com.essa.framework.Model;
3f06ee1c   zengjin   修改时间工具,还有船务相关
4
  import com.essa.framework.Tools;
d3c5a77a   zengjin   idea第一次提交
5
  import org.openqa.selenium.By;
27d9a429   suweicheng   开发梳理;
6
7
8
  import org.openqa.selenium.WebDriver;
  
  import com.essa.framework.BasePage;
d3c5a77a   zengjin   idea第一次提交
9
10
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
27d9a429   suweicheng   开发梳理;
11
  
a0824d2d   toby5221   啊啊啊
12
  import java.util.Date;
3f06ee1c   zengjin   修改时间工具,还有船务相关
13
14
15
16
17
  /**
  * @Description: Po看板页面
  * @Author: ZengJin
  * @CreateTime: 2018/11/1
  */
27d9a429   suweicheng   开发梳理;
18
19
20
21
22
  public class POBoardPage extends BasePage {
  
  	public POBoardPage(WebDriver driver) {
  		super(driver);
  	}
d3c5a77a   zengjin   idea第一次提交
23
24
25
26
27
  	/*
  	 * 元素定位
  	 */
  	@FindBy (xpath = "//*[text()='订单任务看板']")
  	WebElement taskBoard;//订单任务看板
27d9a429   suweicheng   开发梳理;
28
  
d3c5a77a   zengjin   idea第一次提交
29
30
31
32
33
34
35
36
37
38
39
40
  	@FindBy (xpath = "//*[@ng-model='keyword']")
  	WebElement keyword;//关键字查询输入框
  
  	@FindBy (xpath ="//*[@ng-model='keyword']/../span/button")
  	WebElement search;//查询按钮
  
  	@FindBy (xpath = "//*[@id='detailView']/div/div[3]/div[1]/div/div/table/tbody/tr[1]/td/div[2]/div[1]/input")
  	WebElement firstCheckbox;//第一个复选框
  
  	@FindBy (xpath ="//button[contains(text(),'转在途尾货')]")
  	WebElement toTail;//转在途尾货按钮
  
a0824d2d   toby5221   啊啊啊
41
  	// 通知收货
d3c5a77a   zengjin   idea第一次提交
42
  	@FindBy (xpath = "//button[contains(text(),'通知收货')]")
a0824d2d   toby5221   啊啊啊
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  	WebElement noticeReceive;
  
  	//收货日期
  	@FindBy (xpath = "//*[contains(text(),'收货日期')]")  ///label[@class='control-label col-sm-8']
  			WebElement reveiveDate;
  
  	// 收货日期输入框
  	@FindBy (xpath = " //div[@class='col-sm-16']//input[@type='text']")
  	WebElement inputReceiveDate;
  
  	// 确定
  	@FindBy (xpath = "//button[contains(text(),'确定')]")
  	WebElement submit;
  
  	// 通知装柜
  	@FindBy(xpath = "//button[contains(text(),'通知装柜')]")
  	WebElement noticeLoad;
  
  	// 装柜日期空白处
  	@FindBy(xpath = " //label[@class='control-label col-md-8']")
  	WebElement loadDate;
  
  	// 装柜日期输入框
  	@FindBy (xpath = "//input[@name='newDate']")
  	WebElement inutLoadDate;
d3c5a77a   zengjin   idea第一次提交
68
  
d3c5a77a   zengjin   idea第一次提交
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  
  	/*
  	 * 页面方法
  	 */
  	/**
  	 * 转在途尾货
  	 * @return 转在途尾货页面
  	 */
  	public ConvertTailPage toTail() {
  		dynamicLoad(By.xpath("//*[style='display: block;']"));//等待页面加载完成
  		click(taskBoard);
  		dynamicLoad(By.xpath("//*[style='display: block;']"));
  		sendKeys(keyword, Model.getSkuNo());
  		click(search);
  		dynamicLoad(By.xpath("//*[style='display: block;']"));
  		click(firstCheckbox);
  		click(toTail);
  		return new ConvertTailPage(driver);
  	}
a0824d2d   toby5221   啊啊啊
88
89
90
91
92
93
94
95
  
  	/**
  	 * PO通知收货和通知装柜
  	 */
  	// 通知收货
  	public POBoardPage noticeReceive(){
  		click(noticeReceive);
  		jsExecutorRemoveAttribute(inputReceiveDate,"readonly");
3f06ee1c   zengjin   修改时间工具,还有船务相关
96
  		sendKeys(inputReceiveDate, Tools.getToday());
a0824d2d   toby5221   啊啊啊
97
98
  		click(reveiveDate);
  		click(submit);
a0824d2d   toby5221   啊啊啊
99
100
101
  		return new POBoardPage(driver);
  	}
  
438eca07   toby5221   添加断言
102
103
104
105
106
  	public boolean isNoticeReceSucceed(){
  		forceWait(2000);
  		return isVisibility(By.xpath("//*[contains(text(),'收货中')]"));
  	}
  
a0824d2d   toby5221   啊啊啊
107
108
109
110
  	//通知装柜
  	public POBoardPage noticeLoad(){
  		click(noticeLoad);
  		jsExecutorRemoveAttribute(inutLoadDate,"readonly");
3f06ee1c   zengjin   修改时间工具,还有船务相关
111
  		sendKeys(inutLoadDate,Tools.getToday());
a0824d2d   toby5221   啊啊啊
112
  		click(loadDate);
d7f15c1c   zengjin   提交并且覆盖之前的
113
  		forceWait(1000);
a0824d2d   toby5221   啊啊啊
114
  		click(submit);
d7f15c1c   zengjin   提交并且覆盖之前的
115
  //		forceWait(2000);
a0824d2d   toby5221   啊啊啊
116
117
  		return new POBoardPage(driver);
  	}
438eca07   toby5221   添加断言
118
119
120
121
122
123
  
  	public boolean isNoticeLoadSucceed(){
  		forceWait(2000);
  		return isVisibility(By.xpath("//*[contains(text(),'装柜中')]"));
  	}
  
a90375bd   huangyuanbo914@163.com   huangyuanbo
124
  
27d9a429   suweicheng   开发梳理;
125
  }