POBoardPage.java
2.31 KB
1
2
3
4
5
6
7
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.essa.pageObject.PODocumentary;
import com.essa.framework.Tools;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import com.essa.framework.BasePage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.Date;
/**
* @author Administrator
*PO详情页
*/
public class POBoardPage extends BasePage {
public POBoardPage(WebDriver driver) { super(driver); }
/*
* 元素定位
*/
@FindBy (xpath = "//*[contains(text(),'通知收货')]")
WebElement NoticeReceipt;//通知收货
@FindBy (xpath = "//div[@class='col-sm-16']//input[@type='text']")
WebElement receiptDate;//选择收货日期
@FindBy (xpath = "//input[@name='newDate']")
WebElement loadingDate;//选择装柜日期
@FindBy (xpath = "//*[contains(text(),'确定')]")
WebElement submit;//提交
@FindBy (xpath = "//div[@class='bootbox modal fade in']")
WebElement BlankPlace;//点击空白处
@FindBy (xpath = "//*[contains(text(),'通知装柜')]")
WebElement NotificationLoading;//通知装柜
//通知收货
public POBoardPage toNoticeReceipt() {
click(NoticeReceipt);
jsExecutorRemoveAttribute(receiptDate,"readonly");
String Receiptdate = getDateTimeByFormat(new Date(), "MM/dd/yyyy");
sendKeys(receiptDate,Receiptdate);
click(BlankPlace);
click(submit);
forceWait(4000);
return new POBoardPage(driver);
}
/**
* 判断通知收货是否成功
* @return boolean
*/
public boolean isNoticeReceipt (){
forceWait(2000);
return isVisibility(By.xpath("//*[contains(text(),'收货中')]"));
}
//通知装柜
public POBoardPage toNotificationLoading(){
click(NotificationLoading);
jsExecutorRemoveAttribute(loadingDate,"readonly");
// String Loadingdate = getDateTimeByFormat(new Date(), "MM/dd/yyyy");
sendKeys(loadingDate, Tools.getToday());
click(BlankPlace);
click(submit);
forceWait(4000);
return new POBoardPage(driver);
}
/**
* 判断通知装柜是否成功
* @return boolean
*/
public boolean isNotificationLoading(){
forceWait(2000);
return isVisibility(By.xpath("//*[contains(text(),'装柜中')]"));
}
}