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
20a50fd1
Commit
20a50fd1
authored
Jul 29, 2019
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
6e1c9de3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
232 additions
and
0 deletions
+232
-0
积分_Cms_ui.java
src/test/java/ui/cases/cms/积分_Cms_ui.java
+106
-0
轮播图_Cms_ui.java
src/test/java/ui/cases/cms/轮播图_Cms_ui.java
+126
-0
No files found.
src/test/java/ui/cases/cms/积分_Cms_ui.java
0 → 100644
View file @
20a50fd1
package
ui
.
cases
.
cms
;
import
base.DuibaBaseUi
;
import
http.service.Authorization
;
import
org.openqa.selenium.WebElement
;
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.List
;
/**
* Created by mabo on 2019/7/26
*/
public
class
积分
_Cms_ui
extends
DuibaBaseUi
{
@Autowired
Authorization
authorization
;
@Autowired
CmsLoginPage
cmsLoginPage
;
@Autowired
DafuwengLogin
dafuwengLogin
;
@Test
(
description
=
"组件配置"
)
public
void
A
()
throws
Exception
{
logger
.
info
(
driver
.
toString
());
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test11"
);
sleep
(
2
);
clickByTextEqual
(
"积分"
);
sleep
(
2
);
clickByTextEqual
(
"+"
,
2
);
clickByTextEqual
(
"100x100 2.png"
);
clickByTextEqual
(
"保存"
,
1
);
clickByTextEqual
(
"+"
,
3
);
clickByTextEqual
(
"100x100 2.png"
);
clickByTextEqual
(
"保存"
,
1
);
scrollToTop
();
clickByTextEqual
(
"保存"
,
0
);
sleep
(
4
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
10
);
screenshot
();
}
@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%3D390"
;
dafuwengLogin
.
init
(
6926
,
url
,
this
);
sleep
(
2
);
Assert
.
assertTrue
(
isExistByText
(
"兑换记录"
));
Assert
.
assertTrue
(
isExistByText
(
"积分"
));
clickByTextEqual
(
"兑换记录"
);
String
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"兑换记录"
);
driver
.
navigate
().
back
();
screenshot
();
}
@Test
(
description
=
"删除楼层"
)
public
void
C
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test11"
);
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
);
screenshot
();
}
}
src/test/java/ui/cases/cms/轮播图_Cms_ui.java
0 → 100644
View file @
20a50fd1
package
ui
.
cases
.
cms
;
import
base.DuibaBaseUi
;
import
http.service.Authorization
;
import
org.openqa.selenium.WebElement
;
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.List
;
/**
* Created by mabo on 2019/7/24
*/
public
class
轮播图
_Cms_ui
extends
DuibaBaseUi
{
@Autowired
Authorization
authorization
;
@Autowired
CmsLoginPage
cmsLoginPage
;
@Autowired
DafuwengLogin
dafuwengLogin
;
@Test
(
description
=
"组件配置"
)
public
void
A
()
throws
Exception
{
logger
.
info
(
driver
.
toString
());
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test7"
);
sleep
(
2
);
clickByTextEqual
(
"轮播图"
);
sleep
(
2
);
clickByTextEqual
(
"添加图片"
,
0
);
clickByTextEqual
(
"1.png"
);
clickByTextEqual
(
"保存"
,
1
);
clickByTextContains
(
"添加轮播图"
);
clickByTextEqual
(
"添加图片"
,
1
);
clickByTextEqual
(
"1.png"
);
clickByTextEqual
(
"保存"
,
1
);
clickByTextContains
(
"添加轮播图"
);
clickByTextEqual
(
"添加图片"
,
2
);
clickByTextEqual
(
"1.png"
);
clickByTextEqual
(
"保存"
,
1
);
clickByTextEqual
(
"添加跳转链接"
,
0
);
inputByContainsAttribut
(
"placeholder"
,
"请输入无线链接"
,
"input"
,
"http://www.baidu.com"
);
sleep
(
2
);
clickByXpath
(
"//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary el-button--medium']"
);
clickByTextEqual
(
"添加跳转链接"
,
0
);
sleep
(
2
);
clickByXpath
(
"//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary el-button--medium']"
);
sleep
(
1
);
clickByTextEqual
(
"添加跳转链接"
,
0
);
sleep
(
2
);
clickByXpath
(
"//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary el-button--medium']"
);
sleep
(
1
);
scrollToTop
();
clickByTextEqual
(
"保存"
,
0
);
sleep
(
4
);
scrollToTop
();
clickByTextEqual
(
"发布"
);
sleep
(
10
);
screenshot
();
}
@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%3D353"
;
dafuwengLogin
.
init
(
6926
,
url
,
this
);
sleep
(
2
);
List
<
WebElement
>
lists
=
driver
.
findElementsByXPath
(
"//*[@class=\"swiper-pagination swiper-pagination-bullets\"]/span"
);
Assert
.
assertEquals
(
lists
.
size
(),
3
,
"校验数量错误"
);
lists
.
get
(
0
).
click
();
String
title
=
driver
.
getTitle
();
Assert
.
assertEquals
(
title
,
"百度一下,你就知道"
);
driver
.
navigate
().
back
();
screenshot
();
}
@Test
(
description
=
"删除楼层"
)
public
void
C
()
throws
Exception
{
cmsLoginPage
.
init
(
"15968831723"
,
this
);
clickByTextEqual
(
"test7"
);
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
);
screenshot
();
}
}
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