Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
b4306a2d
Commit
b4306a2d
authored
Jun 05, 2019
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mabo' of gitlab2.dui88.com:mabo/test-platform into mabo
parents
5ff24184
c8efa2ed
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
455 additions
and
26 deletions
+455
-26
新Qb_兑换流程测试_ExchangeTest.java
...ases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
+4
-4
新多档位话费_兑换流程测试_ExchangeTest.java
...s/ExchangeTest/兑吧_直充类商品兑换/新多档位话费_兑换流程测试_ExchangeTest.java
+4
-4
新支付宝_兑换流程测试_ExchangeTest.java
...ses/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
+4
-4
兑吧新实物_兑换流程测试_ExchangeTest.java
...va/http/cases/ExchangeTest/兑吧新实物_兑换流程测试_ExchangeTest.java
+6
-6
自有新实物_兑换流程测试_ExchangeTest.java
...ses/ExchangeTest/自有_商品兑换限制/自有新实物_兑换流程测试_ExchangeTest.java
+47
-1
testservice.java
src/test/java/http/service/testservice.java
+65
-7
双列图.java
src/test/java/ui/cases/cms/双列图.java
+119
-0
商品分组.java
src/test/java/ui/cases/cms/商品分组.java
+107
-0
活动分组.java
src/test/java/ui/cases/cms/活动分组.java
+99
-0
No files found.
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
View file @
b4306a2d
...
@@ -33,7 +33,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -33,7 +33,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
@Autowired
@Autowired
MobileService
mobileService
;
MobileService
mobileService
;
@Test
(
description
=
"1个Q币用户兑换限制永久1次"
)
//
@Test(description = "1个Q币用户兑换限制永久1次")
public
void
Q
币用户永久兑换限制测试
()
throws
Exception
{
public
void
Q
币用户永久兑换限制测试
()
throws
Exception
{
int
uid
=
7280
;
int
uid
=
7280
;
...
@@ -84,7 +84,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -84,7 +84,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"2个Q币用户兑换限制每天1次"
)
//
@Test(description = "2个Q币用户兑换限制每天1次")
public
void
Q
币用户每天兑换限制测试
()
throws
Exception
{
public
void
Q
币用户每天兑换限制测试
()
throws
Exception
{
int
uid
=
7281
;
int
uid
=
7281
;
...
@@ -146,7 +146,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -146,7 +146,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"3个Q币用户兑换限制每月1次"
)
//
@Test(description = "3个Q币用户兑换限制每月1次")
public
void
Q
币用户每月兑换限制测试
()
throws
Exception
{
public
void
Q
币用户每月兑换限制测试
()
throws
Exception
{
int
uid
=
7282
;
int
uid
=
7282
;
...
@@ -209,7 +209,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -209,7 +209,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"Q币会员等级限制LV5"
)
//
@Test(description = "Q币会员等级限制LV5")
public
void
Q
币会员等级测试
()
throws
Exception
{
public
void
Q
币会员等级测试
()
throws
Exception
{
int
uid
=
7282
;
int
uid
=
7282
;
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新多档位话费_兑换流程测试_ExchangeTest.java
View file @
b4306a2d
...
@@ -34,7 +34,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -34,7 +34,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
MobileService
mobileService
;
MobileService
mobileService
;
@Test
(
description
=
"1元话费用户兑换限制永久1次"
)
//
@Test(description = "1元话费用户兑换限制永久1次")
public
void
话费用户永久兑换限制测试
()
throws
Exception
{
public
void
话费用户永久兑换限制测试
()
throws
Exception
{
int
uid
=
7280
;
int
uid
=
7280
;
...
@@ -84,7 +84,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -84,7 +84,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
}
@Test
(
description
=
"2元话费用户兑换限制每天1次"
)
//
@Test(description = "2元话费用户兑换限制每天1次")
public
void
话费用户每天兑换限制测试
()
throws
Exception
{
public
void
话费用户每天兑换限制测试
()
throws
Exception
{
int
uid
=
7281
;
int
uid
=
7281
;
...
@@ -145,7 +145,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -145,7 +145,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
}
@Test
(
description
=
"10元话费用户兑换限制每月1次"
)
//
@Test(description = "10元话费用户兑换限制每月1次")
public
void
话费用户每月兑换限制测试
()
throws
Exception
{
public
void
话费用户每月兑换限制测试
()
throws
Exception
{
int
uid
=
7282
;
int
uid
=
7282
;
...
@@ -207,7 +207,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -207,7 +207,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
}
@Test
(
description
=
"话费会员等级限制LV5"
)
//
@Test(description = "话费会员等级限制LV5")
public
void
话费会员等级测试
()
throws
Exception
{
public
void
话费会员等级测试
()
throws
Exception
{
int
uid
=
7282
;
int
uid
=
7282
;
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
View file @
b4306a2d
...
@@ -39,7 +39,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -39,7 +39,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
MobileService
mobileService
;
MobileService
mobileService
;
@Test
(
description
=
"1元支付宝用户兑换限制永久1次"
)
//
@Test(description = "1元支付宝用户兑换限制永久1次")
public
void
支付宝用户永久兑换限制测试
()
throws
Exception
{
public
void
支付宝用户永久兑换限制测试
()
throws
Exception
{
int
uid
=
7262
;
int
uid
=
7262
;
...
@@ -89,7 +89,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -89,7 +89,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"2元支付宝用户兑换限制每天1次"
)
//
@Test(description = "2元支付宝用户兑换限制每天1次")
public
void
支付宝用户每天兑换限制测试
()
throws
Exception
{
public
void
支付宝用户每天兑换限制测试
()
throws
Exception
{
int
uid
=
7270
;
int
uid
=
7270
;
...
@@ -150,7 +150,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -150,7 +150,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"3元支付宝用户兑换限制每月1次"
)
//
@Test(description = "3元支付宝用户兑换限制每月1次")
public
void
支付宝用户每月兑换限制测试
()
throws
Exception
{
public
void
支付宝用户每月兑换限制测试
()
throws
Exception
{
int
uid
=
7271
;
int
uid
=
7271
;
...
@@ -212,7 +212,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -212,7 +212,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
@Test
(
description
=
"支付宝会员等级限制LV5"
)
//
@Test(description = "支付宝会员等级限制LV5")
public
void
支付宝会员等级测试
()
throws
Exception
{
public
void
支付宝会员等级测试
()
throws
Exception
{
int
uid
=
7271
;
int
uid
=
7271
;
...
...
src/test/java/http/cases/ExchangeTest/兑吧新实物_兑换流程测试_ExchangeTest.java
View file @
b4306a2d
...
@@ -449,19 +449,18 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
...
@@ -449,19 +449,18 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
@Test
(
description
=
"新实物确认下单页面"
)
@Test
(
description
=
"新实物确认下单页面"
)
public
void
实物确认下单测试
()
throws
Exception
{
public
void
实物确认下单测试
()
throws
Exception
{
int
uid
=
7284
;
String
appItemId
=
"196218"
;
String
appItemId
=
"196093"
;
String
appSkuId
=
"145"
;
String
appSkuId
=
"154"
;
Response
response
=
gawService
.
confirmItemDetail
(
uid
,
appItemId
,
appSkuId
);
Response
response
=
gawService
.
confirmItemDetail
(
uid
,
appItemId
,
appSkuId
);
response
.
prettyPrint
();
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].sku.attr[0].value"
),
"白色"
,
"校验sku信息颜色失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].sku.attr[0].value"
),
"白色"
,
"校验sku信息颜色失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].sku.attr[1].value"
),
"S"
,
"校验sku信息尺寸失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].sku.attr[1].value"
),
"S"
,
"校验sku信息尺寸失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].sku.credits"
),
"
2
00"
,
"校验sku商品积分失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].sku.credits"
),
"
1
00"
,
"校验sku商品积分失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].multiImage"
),
"//yun.dui88.com/images/20190
5/h8x0e1talx.pn
g"
,
"校验图片信息失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].multiImage"
),
"//yun.dui88.com/images/20190
6/9p72lmu1qn.jp
g"
,
"校验图片信息失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].title"
),
"【自动化勿动】自有实物sku"
,
"校验实物名称失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.items[0].title"
),
"【自动化勿动】自有实物sku"
,
"校验实物名称失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.orderCredits"
),
"
2
00"
,
"校验订单积分失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.orderCredits"
),
"
1
00"
,
"校验订单积分失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.expressPrice"
),
"500"
,
"校验订单运费金额失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.expressPrice"
),
"500"
,
"校验订单运费金额失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.consumerPayPrice"
),
"500"
,
"校验订单支付金额失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.consumerPayPrice"
),
"500"
,
"校验订单支付金额失败"
);
...
@@ -475,4 +474,5 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
...
@@ -475,4 +474,5 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
}
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新实物_兑换流程测试_ExchangeTest.java
View file @
b4306a2d
...
@@ -42,7 +42,6 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
...
@@ -42,7 +42,6 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
return
result
;
return
result
;
}
}
@BeforeMethod
@BeforeMethod
public
void
beforeMethod
(){
public
void
beforeMethod
(){
try
{
try
{
...
@@ -378,4 +377,51 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
...
@@ -378,4 +377,51 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
logger
.
info
(
"校验自有新实物---会员兑换制成功"
);
logger
.
info
(
"校验自有新实物---会员兑换制成功"
);
}
}
//测试使用
//@Test(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=100)
@DataProvider
(
name
=
"testdp"
,
parallel
=
true
)
public
static
Object
[][]
testdp
(){
return
new
Object
[][]{
{
1
},
{
2
},
{
3
},
{
4
},
{
162
},
{
6
},
{
8
},
{
10
},
{
157
},
{
158
}
};
}
// @Test(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=100)
public
void
test
(
int
uid
)
throws
Exception
{
// System.out.println("Current Thread Id: " + Thread.currentThread().getId() + ". Dataprovider number: "+ dpNumber);
// Thread.sleep(5000);
String
appItemId
=
"159040"
;
String
itemId
=
"null"
;
String
message
=
""
;
String
skuId
=
"144"
;
String
actualCredits
=
"8"
;
String
credits
=
"100"
;
Thread
.
sleep
(
4000
);
Response
response
=
gawService
.
objectExchange
(
uid
,
appItemId
,
itemId
,
skuId
,
credits
,
actualCredits
);
response
.
prettyPrint
();
//(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=2)
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
response
=
tawService
.
orderStatus
(
orderId
,
uid
);
response
.
prettyPrint
();
}
}
}
src/test/java/http/service/testservice.java
View file @
b4306a2d
package
http
.
service
;
package
http
.
service
;
import
base.AbstractTestNGSpringContextTestsDuiba
;
import
base.Config
;
import
base.DuibaBase
;
import
http.service.app.MobileService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
/**
/**
* Created by mabo on 2018/10/9
* Created by mabo on 2018/10/9
*/
*/
@
Service
@
ContextConfiguration
(
classes
=
Config
.
class
)
public
class
testservice
{
public
class
testservice
extends
AbstractTestNGSpringContextTestsDuiba
{
//数据库用户名
//数据库用户名
@Value
(
"${db.name}"
)
// @Value("${db.name}")
String
USERNAME
;
// String USERNAME;
//
// public void test(){
// System.out.println(USERNAME);
// Method method;
//
//
//
// }
@Autowired
http
.
service
.
app
.
gawService
gawService
;
@Autowired
http
.
service
.
app
.
tawService
tawService
;
@Autowired
MobileService
mobileService
;
@Autowired
Authorization
authorization
;
@DataProvider
(
name
=
"testdp"
,
parallel
=
true
)
public
static
Object
[][]
testdp
(){
return
new
Object
[][]{
{
"1"
},
{
"2"
},
{
"3"
},
{
"4"
},
{
"5"
},
{
"6"
},
{
"8"
},
{
"10"
},
{
"157"
},
{
"158"
}
};
}
@Test
public
void
test
()
throws
Exception
{
// System.out.println("Current Thread Id: " + Thread.currentThread().getId() + ". Dataprovider number: "+ dpNumber);
// Thread.sleep(5000);
String
appItemId
=
"159040"
;
String
itemId
=
"null"
;
String
message
=
""
;
String
skuId
=
"33"
;
String
actualCredits
=
"8"
;
String
credits
=
"8"
;
public
void
test
(){
System
.
out
.
println
(
USERNAME
);
Method
method
;
Thread
.
sleep
(
3000
);
Response
response
=
gawService
.
objectExchange
(
1
,
appItemId
,
itemId
,
skuId
,
credits
,
actualCredits
);
response
.
prettyPrint
();
//(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=2)
}
}
}
}
src/test/java/ui/cases/cms/双列图.java
0 → 100644
View file @
b4306a2d
package
ui
.
cases
.
cms
;
import
base.DuibaBaseUi
;
import
http.service.Authorization
;
import
org.openqa.selenium.Cookie
;
import
org.openqa.selenium.Keys
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.openqa.selenium.remote.RemoteWebDriver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
ui.common.WebDriverFactory
;
import
ui.service.CmsLoginPage
;
import
ui.service.DafuwengLogin
;
import
java.util.Map
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
open
;
import
static
ui
.
common
.
WebDriverType
.
CHRMOE
;
/**
* Created by mabo on 2019/4/10
*/
public
class
双列图
extends
DuibaBaseUi
{
@Autowired
Authorization
authorization
;
@Autowired
CmsLoginPage
cmsLoginPage
;
@Autowired
DafuwengLogin
dafuwengLogin
;
@Test
(
description
=
"组件配置"
)
public
void
A
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test"
);
sleep
(
2
);
clickByTextEqual
(
"双列图"
);
sleep
(
2
);
clickByTextEqual
(
"添加图片"
,
0
);
clickByTextEqual
(
"1.png"
);
clickByTextEqual
(
"保存"
);
System
.
out
.
println
(
"ok"
);
clickByTextEqual
(
"添加图片"
,
1
);
clickByTextEqual
(
"1.png"
);
clickByTextEqual
(
"保存"
);
System
.
out
.
println
(
"ok"
);
clickByTextEqual
(
"添加跳转链接"
,
0
);
inputByContainsAttribut
(
"placeholder"
,
"请输入无线链接"
,
"input"
,
"http://www.baidu.com"
);
sleep
(
2
);
clickByXpath
(
"//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary']"
);
clickByTextEqual
(
"添加跳转链接"
,
0
);
sleep
(
2
);
clickByXpath
(
"//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary']"
);
sleep
(
1
);
inputByXpath
(
"//*[@placeholder=\"请输入文本,20字以内\"]"
,
"test1"
,
0
);
inputByXpath
(
"//*[@placeholder=\"请输入文本,20字以内\"]"
,
"test2"
,
1
);
clickByTextEqual
(
"保存"
,
1
);
sleep
(
4
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
10
);
}
@Test
(
description
=
"手机端"
)
public
void
B
()
throws
Exception
{
String
url
=
"http://wechat.duiba.com.cn/dbredirect/dafuweng?dbredirect=%2F%2Factivity.m.duibatest.com.cn%2Fchw%2Fvisual-editor%2Fskins%3Fid%3D134"
;
dafuwengLogin
.
init
(
6926
,
url
,
this
);
sleep
(
2
);
clickByClass
(
"double-row-item_image"
);
sleep
(
3
);
String
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"百度一下,你就知道"
);
driver
.
navigate
().
back
();
sleep
(
2
);
clickByClass
(
"double-row-item_image"
,
1
);
sleep
(
2
);
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"百度一下,你就知道"
);
url
=
driver
.
getCurrentUrl
();
driver
.
navigate
().
back
();
Assert
.
assertTrue
(
isExistByText
(
"test1"
));
Assert
.
assertTrue
(
isExistByText
(
"test2"
));
}
@Test
(
description
=
"删除楼层"
)
public
void
C
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test"
);
sleep
(
2
);
//选中组件
clickByClass
(
"plugin-content-hover"
,
1
);
sleep
(
1
);
//点击删除
clickByClass
(
"plugin-delete-icon common-cursor-pointer iconfont-handle handle-guanbi el-popover__reference"
,
1
);
sleep
(
1
);
clickByTextEqual
(
"确定"
,
1
);
sleep
(
1
);
clickByTextContains
(
"保存"
);
sleep
(
4
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
2
);
}
}
src/test/java/ui/cases/cms/商品分组.java
0 → 100644
View file @
b4306a2d
package
ui
.
cases
.
cms
;
import
base.DuibaBaseUi
;
import
http.service.Authorization
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
ui.service.CmsLoginPage
;
import
ui.service.DafuwengLogin
;
/**
* Created by mabo on 2019/4/15
*/
public
class
商品分组
extends
DuibaBaseUi
{
@Autowired
Authorization
authorization
;
@Autowired
CmsLoginPage
cmsLoginPage
;
@Autowired
DafuwengLogin
dafuwengLogin
;
@Test
public
void
A
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test"
);
sleep
(
2
);
clickByTextEqual
(
"商品分组"
,
1
);
sleep
(
3
);
clickByTextContains
(
"选择分组"
,
1
);
clickByXpath
(
"//*[@class=\"el-table__row \"]//label"
);
clickByTextEqual
(
"确 定"
);
clickByTextContains
(
"选择分组"
,
1
);
clickByXpath
(
"//*[@class=\"el-table__row el-table__row--striped \"]//label"
);
clickByTextEqual
(
"确 定"
);
inputByXpath
(
"//*[@class=\"el-input el-input--medium\"]//input"
,
"test1"
,
0
);
inputByXpath
(
"//*[@class=\"el-input el-input--medium\"]//input"
,
"test2"
,
1
);
clickByTextEqual
(
"保存"
,
1
);
sleep
(
5
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
10
);
}
@Test
public
void
B
()
throws
Exception
{
String
url
=
"http://wechat.duiba.com.cn/dbredirect/dafuweng?dbredirect=%2F%2Factivity.m.duibatest.com.cn%2Fchw%2Fvisual-editor%2Fskins%3Fid%3D134"
;
dafuwengLogin
.
init
(
6926
,
url
,
this
);
Assert
.
assertTrue
(
isExistByText
(
"test1"
));
Assert
.
assertTrue
(
isExistByText
(
"test2"
));
Assert
.
assertTrue
(
isExistContainsText
(
"(勿动)新优惠券日期进行中"
));
Assert
.
assertTrue
(
isExistContainsText
(
"(勿动)新优惠券日期已结束"
));
clickByTextContains
(
"(勿动)新优惠券日期已结束"
);
sleep
(
2
);
String
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"(勿动)新优惠券日期已结束"
);
driver
.
navigate
().
back
();
clickByTextEqual
(
"test2"
);
clickByTextContains
(
"【接口自动化】实物-一直可兑"
);
sleep
(
2
);
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"【接口自动化】实物-一直可兑"
);
}
@Test
(
description
=
"删除楼层"
)
public
void
C
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test"
);
sleep
(
2
);
//选中组件
clickByClass
(
"plugin-content-hover"
,
1
);
sleep
(
1
);
//点击删除
clickByClass
(
"plugin-delete-icon common-cursor-pointer iconfont-handle handle-guanbi el-popover__reference"
,
1
);
sleep
(
1
);
clickByTextEqual
(
"确定"
,
1
);
scrollToTop
();
clickByTextContains
(
"保存"
);
sleep
(
5
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
10
);
}
}
src/test/java/ui/cases/cms/活动分组.java
0 → 100644
View file @
b4306a2d
package
ui
.
cases
.
cms
;
import
base.DuibaBaseUi
;
import
http.service.Authorization
;
import
org.openqa.selenium.Cookie
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
ui.service.CmsLoginPage
;
import
ui.service.DafuwengLogin
;
import
java.util.Map
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
open
;
/**
* Created by mabo on 2019/4/15
*/
public
class
活动分组
extends
DuibaBaseUi
{
@Autowired
Authorization
authorization
;
@Autowired
CmsLoginPage
cmsLoginPage
;
@Autowired
DafuwengLogin
dafuwengLogin
;
@Test
(
description
=
"组件配置"
)
public
void
A
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test"
);
sleep
(
2
);
clickByTextEqual
(
"活动分组"
);
sleep
(
3
);
clickByTextEqual
(
"选择分组"
,
0
);
clickByXpath
(
"//*[@class=\"el-table__row\"]"
);
clickByTextEqual
(
"确 定"
);
clickByTextEqual
(
"选择分组"
,
0
);
clickByXpath
(
"//*[@class=\"el-table__row\"]"
);
clickByTextEqual
(
"确 定"
);
inputByXpath
(
"//*[@class=\"el-input__inner\"]"
,
"test1"
,
1
);
inputByXpath
(
"//*[@class=\"el-input__inner\"]"
,
"test2"
,
3
);
clickByTextEqual
(
"保存"
,
1
);
sleep
(
5
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
10
);
}
@Test
(
description
=
"手机端"
)
public
void
B
()
throws
Exception
{
String
url
=
"http://wechat.duiba.com.cn/dbredirect/dafuweng?dbredirect=%2F%2Factivity.m.duibatest.com.cn%2Fchw%2Fvisual-editor%2Fskins%3Fid%3D134"
;
dafuwengLogin
.
init
(
6926
,
url
,
this
);
Assert
.
assertTrue
(
isExistByText
(
"test1"
));
Assert
.
assertTrue
(
isExistByText
(
"test2"
));
Assert
.
assertTrue
(
isExistByText
(
"活动组测试1"
));
Assert
.
assertTrue
(
isExistByText
(
"活动组测试2"
));
clickByTextEqual
(
"活动组测试1"
);
sleep
(
2
);
String
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"活动组测试1"
);
driver
.
navigate
().
back
();
clickByTextEqual
(
"test2"
);
clickByTextEqual
(
"活动组测试2"
,
1
);
sleep
(
2
);
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"活动组测试2"
);
}
@Test
(
description
=
"删除楼层"
)
public
void
C
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test"
);
sleep
(
2
);
//选中组件
clickByClass
(
"plugin-content-hover"
,
1
);
sleep
(
1
);
//点击删除
clickByClass
(
"plugin-delete-icon common-cursor-pointer iconfont-handle handle-guanbi el-popover__reference"
,
1
);
sleep
(
1
);
clickByTextEqual
(
"确定"
,
1
);
scrollToTop
();
clickByTextContains
(
"保存"
);
sleep
(
5
);
clickByTextEqual
(
"发布"
);
sleep
(
10
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment