Blame view

src/main/java/com/essa/pageObject/PODocumentary/POBoardPage.java 2.87 KB
27d9a429   suweicheng   开发梳理;
1
2
  package com.essa.pageObject.PODocumentary;
  
d3c5a77a   zengjin   idea第一次提交
3
4
  import com.essa.framework.Model;
  import org.openqa.selenium.By;
27d9a429   suweicheng   开发梳理;
5
6
7
  import org.openqa.selenium.WebDriver;
  
  import com.essa.framework.BasePage;
d3c5a77a   zengjin   idea第一次提交
8
9
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
27d9a429   suweicheng   开发梳理;
10
  
a0824d2d   toby5221   啊啊啊
11
12
  import java.util.Date;
  
27d9a429   suweicheng   开发梳理;
13
14
15
16
17
  public class POBoardPage extends BasePage {
  
  	public POBoardPage(WebDriver driver) {
  		super(driver);
  	}
d3c5a77a   zengjin   idea第一次提交
18
19
20
21
22
  	/*
  	 * 元素定位
  	 */
  	@FindBy (xpath = "//*[text()='订单任务看板']")
  	WebElement taskBoard;//订单任务看板
27d9a429   suweicheng   开发梳理;
23
  
d3c5a77a   zengjin   idea第一次提交
24
25
26
27
28
29
30
31
32
33
34
35
  	@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   啊啊啊
36
  	// 通知收货
d3c5a77a   zengjin   idea第一次提交
37
  	@FindBy (xpath = "//button[contains(text(),'通知收货')]")
a0824d2d   toby5221   啊啊啊
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  	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第一次提交
63
  
d3c5a77a   zengjin   idea第一次提交
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  
  	/*
  	 * 页面方法
  	 */
  	/**
  	 * 转在途尾货
  	 * @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   啊啊啊
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  
  	/**
  	 * PO通知收货和通知装柜
  	 */
  	// 通知收货
  	public POBoardPage noticeReceive(){
  		click(noticeReceive);
  		jsExecutorRemoveAttribute(inputReceiveDate,"readonly");
  		String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy");
  		sendKeys(inputReceiveDate,date);
  		click(reveiveDate);
  		click(submit);
  		forceWait(3000);
  		return new POBoardPage(driver);
  	}
  
  	//通知装柜
  	public POBoardPage noticeLoad(){
  		click(noticeLoad);
  		jsExecutorRemoveAttribute(inutLoadDate,"readonly");
  		String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy");
  		sendKeys(inutLoadDate,date);
  		click(loadDate);
  		forceWait(3000);
  		click(submit);
  		forceWait(2000);
  		return new POBoardPage(driver);
  	}
27d9a429   suweicheng   开发梳理;
111
  }