Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
selenium-meeting
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
mry
selenium-meeting
Commits
88b1357b
提交
88b1357b
authored
12月 15, 2021
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(报告显示中文):报告显示中文信息
上级
b93592b7
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
15 行删除
+20
-15
pom.xml
pom.xml
+14
-0
ConferenceActive.java
...om/tykj/selenium/conferenceRoomTest/ConferenceActive.java
+3
-12
ExtentTestNGIReporterListener.java
...selenium/extentsreport/ExtentTestNGIReporterListener.java
+3
-3
没有找到文件。
pom.xml
浏览文件 @
88b1357b
...
...
@@ -23,6 +23,11 @@
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
@@ -103,6 +108,15 @@
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.1
</version>
<configuration>
<encoding>
UTF-8
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
...
...
src/main/java/com/tykj/selenium/conferenceRoomTest/ConferenceActive.java
浏览文件 @
88b1357b
...
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
import
org.testng.Assert
;
import
org.testng.Reporter
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.io.File
;
...
...
@@ -74,7 +75,6 @@ public class ConferenceActive {
//修改test会议室
private
void
updateErrorMeetTest
()
{
meetManager
();
WebElement
tbody
=
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[2]/div[2]/div/div/div[2]/div[1]/div[3]/table/tbody"
));
List
<
WebElement
>
rows
=
tbody
.
findElements
(
By
.
className
(
"el-table__row"
));
for
(
WebElement
row
:
rows
)
{
...
...
@@ -96,9 +96,10 @@ public class ConferenceActive {
//todo 这个系统暂时没有登录的功能
}
@BeforeMethod
//进入页面,并且到达会议室库管理页面
public
void
meetManager
()
{
webDriver
.
get
(
"http://123.60.53.83"
);
webDriver
.
get
(
"http://123.60.53.83
/
"
);
webDriver
.
manage
().
window
().
maximize
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[1]/div[2]/div[2]/span"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[2]/div[1]/div/ul/li/div/span"
)).
click
();
...
...
@@ -109,7 +110,6 @@ public class ConferenceActive {
public
void
resetTest
()
{
try
{
String
test
;
meetManager
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
clear
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
sendKeys
(
"100"
);
...
...
@@ -128,7 +128,6 @@ public class ConferenceActive {
@Test
(
description
=
"查询人数,输入负号"
)
public
void
findUnNumber
()
{
try
{
meetManager
();
//容纳人数查询
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
clear
();
...
...
@@ -153,7 +152,6 @@ public class ConferenceActive {
public
void
findMeetName
()
{
try
{
String
test
;
meetManager
();
//会议室名称查询
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input"
)).
clear
();
...
...
@@ -181,7 +179,6 @@ public class ConferenceActive {
public
void
findNumberMeet
()
{
try
{
String
test
;
meetManager
();
//容纳人数查询
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input"
)).
clear
();
...
...
@@ -197,7 +194,6 @@ public class ConferenceActive {
@Test
(
description
=
"按照会议室规模查询"
)
public
void
findScaleMeet
()
{
try
{
meetManager
();
WebElement
find
=
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[2]/div[2]/div/div/div[1]/form/div/div[4]/button[1]/span"
));
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[3]/div/div/div/div/input"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[2]/div[1]/div[1]/ul/li[1]/span"
)).
click
();
...
...
@@ -221,7 +217,6 @@ public class ConferenceActive {
public
void
findMeet
()
{
try
{
String
test
;
meetManager
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input"
)).
click
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input"
)).
clear
();
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input"
)).
sendKeys
(
"G"
);
...
...
@@ -254,7 +249,6 @@ public class ConferenceActive {
@Test
(
description
=
"会议室新增测试"
)
public
void
insertMeet
()
{
try
{
meetManager
();
//点击新增
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/button/span"
)).
click
();
popUp
(
"test"
,
"test1"
,
"100"
);
...
...
@@ -275,7 +269,6 @@ public class ConferenceActive {
@Test
(
description
=
"新增null会议"
)
public
void
insertNullMeetFail
()
{
try
{
meetManager
();
//点击新增
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/button/span"
)).
click
();
//点击保存
...
...
@@ -301,7 +294,6 @@ public class ConferenceActive {
@Test
(
description
=
"新增错误会议室"
)
public
void
insertErrorMeet
()
{
try
{
meetManager
();
//点击新增
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/button/span"
)).
click
();
popUp
(
"test"
,
"test1"
,
"-qwe123"
);
...
...
@@ -358,7 +350,6 @@ public class ConferenceActive {
@Test
(
description
=
"会议室删除测试"
)
public
void
deleteMeet
()
{
try
{
meetManager
();
WebElement
tbody
=
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[2]/div[2]/div/div/div[2]/div[1]/div[3]/table/tbody"
));
List
<
WebElement
>
rows
=
tbody
.
findElements
(
By
.
className
(
"el-table__row"
));
for
(
WebElement
row
:
rows
)
{
...
...
src/main/java/com/tykj/selenium/extentsreport/ExtentTestNGIReporterListener.java
浏览文件 @
88b1357b
...
...
@@ -154,7 +154,7 @@ public class ExtentTestNGIReporterListener implements IReporter {
name
=
name
.
substring
(
0
,
49
)+
"..."
;
}
}
else
{
name
=
result
.
getMethod
().
get
MethodName
();
name
=
result
.
getMethod
().
get
Description
();
}
if
(
extenttest
==
null
){
test
=
extent
.
createTest
(
name
);
...
...
@@ -162,8 +162,8 @@ public class ExtentTestNGIReporterListener implements IReporter {
//作为子节点进行创建时,设置同父节点的标签一致,便于报告检索。
test
=
extenttest
.
createNode
(
name
).
assignCategory
(
categories
);
}
//
test.getModel().setDescription(description.toString());
//
test = extent.createTest(result.getMethod().getMethodName());
//
test.getModel().setDescription(description.toString());
//
test = extent.createTest(result.getMethod().getMethodName());
for
(
String
group
:
result
.
getMethod
().
getGroups
())
test
.
assignCategory
(
group
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论