SupplierOperationsTrackPage.java
1.91 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
package com.essa.pageObject.SupplierManage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import com.essa.framework.BasePage;
/*
* @Description:BD跟进管理页面
* @Author: ZengJin
* @CreateTime: 2018/10/29
*/
public class SupplierOperationsTrackPage extends BasePage {
public SupplierOperationsTrackPage(WebDriver driver) {
super(driver);
}
/*
* 元素定位
*/
// 查询输入框
@FindBy(xpath = "//*[contains(text(),'关键字查询')]/../div/div/input")
WebElement query;
// 查询按钮
@FindBy(xpath = "//*[text()='查询']")
WebElement search;
// 综合实力更新
@FindBy(xpath = "//*/button[contains(text(),'综合实力更新')]")
WebElement supplierStrength;
// 第一条查询结果(用于确定是否查询完毕)
@FindBy(xpath = "//*[@id='content-table']/tbody/tr[1]")
WebElement firstResult;
// 检查点:自主发布商品数
@FindBy(xpath = "//*[@id='content-table']/thead/tr/th[10]")
WebElement checkPoint;
/*
* 页面方法
*/
// 输入要查询的文本
public void searchText(String text) throws InterruptedException {
// 输入要查询的供应商或者编号等,点击查询按钮
sendKeys(query, text);
click(search);
}
// 检查是否进入平台运营跟进管理
public boolean isSucceed() {
return isThisPage("自主发布商品数", checkPoint);
}
// 跳转到综合实力更新
public SupplierStrengthPage goToSupplierStrengthPage(String supplierName) throws InterruptedException {
/*
* 查询供应商,点击 综合实力更新,将driver传递至综合实力更新页面
*/
searchText(supplierName);
click(supplierStrength);
return new SupplierStrengthPage(driver);
}
// 列表是否有查询结果,没有则等待
public void waitResult() throws InterruptedException {
while(!(firstResult.isDisplayed()))
Thread.sleep(1000);
}
}