fdd4bb76
zengjin55
windows
|
1
2
3
4
5
|
package com.essa.pageObject;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
|
09fdf50f
Administrator
bpms
|
6
7
8
9
10
11
12
13
|
import com.essa.framework.BasePage;
import com.essa.pageObject.GoodsManage.AddOriginalGoodsPage;
import com.essa.pageObject.GoodsManage.AuditMarketGoodsPage;
import com.essa.pageObject.GoodsManage.AuditOriginalGoodsPage;
import com.essa.pageObject.GoodsManage.GoodsBankPage;
import com.essa.pageObject.GoodsManage.GoodsRelesePage;
import com.essa.pageObject.GoodsManage.MarketGoodsRelesePage;
import com.essa.pageObject.buyPlaneManage.SkuCategoryManagerCongfigPage;
|
60b8852f
Administrator
test
|
14
15
|
import com.essa.pageObject.buyerManage.InvateCodePage;
import com.essa.pageObject.inquiryManage.ProductInquiryTask;
|
09fdf50f
Administrator
bpms
|
16
17
|
import com.essa.pageObject.marketingManage.GroupControlPage;
import com.essa.pageObject.marketingManage.GroupSettingPage;
|
fdd4bb76
zengjin55
windows
|
18
|
|
60b8852f
Administrator
test
|
19
20
21
22
|
/**
* @author Administrator
*bpms后台首页
*/
|
fdd4bb76
zengjin55
windows
|
23
24
25
|
public class HomePage extends BasePage{
public HomePage(WebDriver driver) {
super(driver);
|
fdd4bb76
zengjin55
windows
|
26
27
28
29
30
31
32
33
34
35
|
}
/*
* 元素定位
*/
//退出
@FindBy (xpath="//*[text()='退出']")
WebElement logout;
|
09fdf50f
Administrator
bpms
|
36
37
38
39
|
//左上角图标--用于回到首页
@FindBy (xpath="//*[@class='logo-text']")
WebElement essaIcon;
|
fdd4bb76
zengjin55
windows
|
40
41
42
43
44
45
46
47
48
49
50
51
|
//供应商管理
@FindBy (xpath="//*[text()='供应商管理']")
WebElement supplier;
//平台运营跟进管理
@FindBy (xpath="//*/a[contains(text(),'平台运营跟进管理')]")
WebElement operationsTrack;
//供应商查询
@FindBy (xpath="//*[text()='供应商查询']")
WebElement searchSuppliers;
|
09fdf50f
Administrator
bpms
|
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
//商品管理
@FindBy (xpath="//*[text()='商品管理']")
WebElement goodsManage;
//商品库
@FindBy (xpath="//*[text()='商品库']")
WebElement goodBank;
//原厂商品发布
@FindBy (xpath="//*[text()='原厂商品发布']")
WebElement addOriginalGoods;
//市场商品发布
@FindBy (xpath="//*[text()='市场商品发布']")
WebElement marketGoodsRelese;
//商品发布管理-子元素
@FindBy(xpath="//*[@name='child.text' and text()='商品发布管理']")
WebElement goodsPublish;
//原厂商品发布审核
@FindBy(xpath="//*[text()='原厂商品发布审核']")
WebElement auditOriginal;
//市场商品发布审核
@FindBy(xpath="//*[text()='市场商品发布审核']")
WebElement auditMarket;
//采购计划管理
@FindBy(xpath="//*[text()='采购计划管理']")
WebElement buyerPlaneManage;
//商品类目经理分配配置
@FindBy(xpath="//*[text()='商品类目经理分配配置']")
WebElement skuManagerConfig;
//营销管理
@FindBy (xpath="//*[text()='营销管理']")
WebElement marketingManage;
//团购设置
@FindBy (xpath="//*[text()='团购设置']/..")
WebElement groupSetting;
//团购控制
@FindBy (xpath="//*[text()='团购控制']/..")
WebElement groupControl;
|
60b8852f
Administrator
test
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
//采购商管理
@FindBy (xpath="//*[text()='采购商管理']")
WebElement buyerManage;
//生成邀请码
@FindBy (xpath="//*[text()='生成邀请码']" )
WebElement inviteCode;
//询价管理
@FindBy (xpath ="//span[text()='询价管理']")
WebElement inquiryManage;
//成品询价任务列表
@FindBy (xpath = "//*[text()='成品询价任务列表']")
WebElement productInquiryTask;
//产品开发
@FindBy (xpath ="//*[text()='产品开发']")
WebElement productDev;
//项目立项书新增
@FindBy (xpath ="//*[text()='项目立项书新增']")
WebElement addProject;
//项目立项书查询
@FindBy (xpath ="//*[text()='项目立项书查询']")
WebElement quiryProject;
|
fdd4bb76
zengjin55
windows
|
130
131
132
133
|
/*
* 方法
*/
|
09fdf50f
Administrator
bpms
|
134
135
|
/**
* 进入运营跟进管理页面
|
60b8852f
Administrator
test
|
136
|
* @return SupplierOperationsTrackPage
|
09fdf50f
Administrator
bpms
|
137
|
*/
|
fdd4bb76
zengjin55
windows
|
138
139
140
141
142
143
144
145
146
147
148
149
150
|
public SupplierOperationsTrackPage goToSupplierOperationsTrack() {
//点击 供应商管理
click(supplier);
//点击 平台运营跟进管理
click(operationsTrack);
//此时,系统会加载一个平台运营跟进管理页面,故在此初始化该页面并将driver传递过去
return new SupplierOperationsTrackPage(driver);
}
|
09fdf50f
Administrator
bpms
|
151
152
|
/**
* 进入原厂商品发布
|
60b8852f
Administrator
test
|
153
|
* @return AddOriginalGoodsPage
|
09fdf50f
Administrator
bpms
|
154
155
156
157
158
159
160
161
162
163
|
*/
public AddOriginalGoodsPage tOriginalGoodsPage() {
click(goodsManage);
isElementExist(addOriginalGoods);
click(addOriginalGoods);
return new AddOriginalGoodsPage(driver);
}
/**
* 进入商品发布管理
|
60b8852f
Administrator
test
|
164
|
* @return GoodsRelesePage
|
09fdf50f
Administrator
bpms
|
165
166
167
168
169
170
171
172
173
|
*/
public GoodsRelesePage tGoodsRelesePage() {
click(goodsManage);
click(goodsPublish);
return new GoodsRelesePage(driver);
}
/**
* 进入原厂商品发布审核
|
60b8852f
Administrator
test
|
174
|
* @return AuditOriginalGoodsPage
|
09fdf50f
Administrator
bpms
|
175
176
177
178
179
180
181
182
183
184
|
*/
public AuditOriginalGoodsPage toAuditOriginalGoodsPage() {
mywait(logout);
click(goodsManage);
click(auditOriginal);
return new AuditOriginalGoodsPage(driver);
}
/**
* 进入商品库
|
60b8852f
Administrator
test
|
185
|
* @return GoodsBankPage
|
09fdf50f
Administrator
bpms
|
186
187
188
189
190
191
192
193
194
|
*/
public GoodsBankPage toGoodsBankPage() {
click(goodsManage);
click(goodBank);
return new GoodsBankPage(driver);
}
/**
* 进入市场商品发布
|
60b8852f
Administrator
test
|
195
|
* @return MarketGoodsRelesePage
|
09fdf50f
Administrator
bpms
|
196
197
198
199
200
201
202
|
*/
public MarketGoodsRelesePage toMarketGoodsRelesePage() {
click(goodsManage);
click(marketGoodsRelese);
return new MarketGoodsRelesePage(driver);
}
/**
|
60b8852f
Administrator
test
|
203
204
|
* 进入市场商品发布审核
* @return AuditMarketGoodsPage
|
09fdf50f
Administrator
bpms
|
205
206
207
208
209
210
211
212
|
*/
public AuditMarketGoodsPage toAuditMarketGoodsPage() {
click(goodsManage);
click(auditMarket);
return new AuditMarketGoodsPage(driver);
}
/**
* 进入商品类目经理分配配置
|
60b8852f
Administrator
test
|
213
|
* @return SkuCategoryManagerCongfigPage
|
09fdf50f
Administrator
bpms
|
214
215
216
217
218
219
220
221
222
|
*/
public SkuCategoryManagerCongfigPage toSkuCategoryManagerCongfig() {
mywait(logout);
click(buyerPlaneManage);
click(skuManagerConfig);
return new SkuCategoryManagerCongfigPage(driver);
}
/**
* 进入团购设置
|
60b8852f
Administrator
test
|
223
|
* @return GroupSettingPage
|
09fdf50f
Administrator
bpms
|
224
225
226
227
228
229
230
231
232
|
*/
public GroupSettingPage toGroupSettingPage() {
getHome();
click(marketingManage);
click(groupSetting);
return new GroupSettingPage(driver);
}
/**
* 进入团购控制
|
60b8852f
Administrator
test
|
233
|
* @return GroupControlPage
|
09fdf50f
Administrator
bpms
|
234
235
236
|
*/
public GroupControlPage toGroupControlPage() {
// getHome();
|
60b8852f
Administrator
test
|
237
|
jsExecutorClick(essaIcon);
|
09fdf50f
Administrator
bpms
|
238
239
240
241
|
click(marketingManage);
click(groupControl);
return new GroupControlPage(driver);
}
|
60b8852f
Administrator
test
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
/**
* 进入生成邀请码
* @return InvateCodePage
*/
public InvateCodePage toInvateCodePage() {
click(buyerManage);
moveHeightScroll("100");
click(inviteCode);
return new InvateCodePage(driver);
}
/**
* 进入成品询价任务列表
* @return ProductInquiryTask
*/
public ProductInquiryTask toProductInquiryTask() {
click(inquiryManage);
click(productInquiryTask);
return new ProductInquiryTask(driver);
}
/**
* 判断是否进入后台首页
* @return boolean
*/
|
fdd4bb76
zengjin55
windows
|
267
|
public boolean isSucceed() {
|
fdd4bb76
zengjin55
windows
|
268
|
return isThisPage("退出", logout);
|
fdd4bb76
zengjin55
windows
|
269
270
|
}
|
60b8852f
Administrator
test
|
271
272
273
274
|
/**
* 判断是否选中“供应商管理”
* @return
*/
|
fdd4bb76
zengjin55
windows
|
275
|
public boolean isSearchSuppliers() {
|
fdd4bb76
zengjin55
windows
|
276
|
return isElementExist(searchSuppliers);
|
fdd4bb76
zengjin55
windows
|
277
278
|
}
|
09fdf50f
Administrator
bpms
|
279
280
281
282
283
284
285
286
|
/**
*点击essa图标, 回到bpms后台首页
*/
public void getHome() {
forceWait(500);
jsExecutorClick(essaIcon);
forceWait(1000);
}
|
60b8852f
Administrator
test
|
287
288
289
|
/**
* 退出登录
*/
|
fdd4bb76
zengjin55
windows
|
290
|
public void logout() {
|
fdd4bb76
zengjin55
windows
|
291
|
click(logout);
|
fdd4bb76
zengjin55
windows
|
292
293
|
}
}
|