Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
selenium-meeting
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
mry
selenium-meeting
Commits
b189e78b
提交
b189e78b
authored
12月 10, 2021
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(初始测试):初始自动测试
上级
3e239cf2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
39 行增加
和
15 行删除
+39
-15
SeleniumApplication.java
src/main/java/com/tykj/selenium/SeleniumApplication.java
+9
-2
ConferenceActive.java
...om/tykj/selenium/conferenceRoomTest/ConferenceActive.java
+28
-5
ExtentTestNGIReporterListener.java
...selenium/extentsreport/ExtentTestNGIReporterListener.java
+1
-1
testng.xml
testng.xml
+1
-7
没有找到文件。
src/main/java/com/tykj/selenium/SeleniumApplication.java
浏览文件 @
b189e78b
package
com
.
tykj
.
selenium
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.testng.TestNG
;
import
java.util.ArrayList
;
import
java.util.List
;
@SpringBootApplication
public
class
SeleniumApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SeleniumApplication
.
class
,
args
);
List
<
String
>
suites
=
new
ArrayList
<
String
>();
suites
.
add
(
"testng.xml"
);
TestNG
testNG
=
new
TestNG
();
testNG
.
setTestSuites
(
suites
);
testNG
.
run
();
}
}
src/main/java/com/tykj/selenium/conferenceRoomTest/ConferenceActive.java
浏览文件 @
b189e78b
...
...
@@ -7,8 +7,10 @@ import org.apache.commons.io.FileUtils;
import
org.openqa.selenium.*
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.testng.Assert
;
import
org.testng.Reporter
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
java.io.File
;
import
java.io.IOException
;
...
...
@@ -37,13 +39,34 @@ public class ConferenceActive {
Reporter
.
log
(
"<img src=/opt/conference_manage_deploy/images/"
+
fileName
+
" style=width:30px;height:30px />"
,
true
);
}
@BeforeClass
public
void
url
(){
public
void
login
(
String
username
,
String
password
)
{
//todo 这个系统暂时没有登录的功能
}
@Test
//进入页面
public
void
url
(){
webDriver
.
get
(
baseUrl
);
webDriver
.
manage
().
window
().
maximize
();
webDriver
.
findElement
(
By
.
className
(
"router_nav"
)).
click
();
}
public
void
login
(
String
username
,
String
password
)
{
//todo 这个系统暂时没有登录的功能
// @Test(description = "新增会议室")
// public void insertMeeting(){
//
// }
@AfterClass
(
alwaysRun
=
true
)
public
void
quit
(){
webDriver
.
quit
();
}
}
src/main/java/com/tykj/selenium/extentsreport/ExtentTestNGIReporterListener.java
浏览文件 @
b189e78b
...
...
@@ -17,7 +17,7 @@ import java.util.*;
public
class
ExtentTestNGIReporterListener
implements
IReporter
{
//生成的路径以及文件名
private
static
final
String
OUTPUT_FOLDER
=
"/opt/conference_manage_deploy/
test_report
/"
;
private
static
final
String
OUTPUT_FOLDER
=
"/opt/conference_manage_deploy/
reports
/"
;
private
static
final
String
FILE_NAME
=
new
SimpleDateFormat
(
"yyyy年MM月dd日HH时mm分ss秒的报告"
).
format
(
new
Date
())
+
".html"
;
...
...
src/main/resources/
testng.xml
→
testng.xml
浏览文件 @
b189e78b
...
...
@@ -11,13 +11,7 @@
<classes>
<class
name=
"com.tykj.selenium.conferenceRoomTest.ConferenceActive"
/>
<methods>
<include
name=
"insertConferenceRoomFailAll"
/>
<include
name=
"insertConferenceRoomOne"
/>
<include
name=
"insertConferenceRoom"
/>
<include
name=
"updateConferenceRoom"
/>
<include
name=
"findConferenceRoom"
/>
<include
name=
"findConferenceRoomNumber"
/>
<include
name=
"deleteConferenceRoom"
/>
<include
name=
"url"
/>
</methods>
</classes>
</test>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论