Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
selenium-test
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
selenium-test
Commits
51895434
提交
51895434
authored
11月 26, 2021
作者:
黄夏豪
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[会议室测试] 新增了 跳转到排座页面和跳转到管理页面的方法
上级
55fa477b
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
89 行增加
和
26 行删除
+89
-26
pom.xml
pom.xml
+7
-0
SeleniumTestApplication.java
...ava/com/example/seleniumtest/SeleniumTestApplication.java
+18
-0
ConferenceActive.java
...ple/seleniumtest/conferenceRoomTest/ConferenceActive.java
+38
-0
SeleniumTestApplication.java
...xample/seleniumtest/selenium/SeleniumTestApplication.java
+0
-22
application-dev.properties
src/main/resources/application-dev.properties
+2
-0
application.properties
src/main/resources/application.properties
+2
-1
SeleniumTestApplicationTests.java
...om/example/seleniumtest/SeleniumTestApplicationTests.java
+22
-3
没有找到文件。
pom.xml
浏览文件 @
51895434
...
@@ -43,6 +43,13 @@
...
@@ -43,6 +43,13 @@
<artifactId>
guava
</artifactId>
<artifactId>
guava
</artifactId>
<version>
31.0.1-jre
</version>
<version>
31.0.1-jre
</version>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.22
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/example/seleniumtest/SeleniumTestApplication.java
0 → 100644
浏览文件 @
51895434
package
com
.
example
.
seleniumtest
;
import
com.example.seleniumtest.conferenceRoomTest.ConferenceActive
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
(
scanBasePackages
=
{
"com.example.seleniumtest"
})
public
class
SeleniumTestApplication
{
@Autowired
ConferenceActive
conferenceActive
;
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SeleniumTestApplication
.
class
,
args
);
}
}
src/main/java/com/example/seleniumtest/conferenceRoomTest/ConferenceActive.java
0 → 100644
浏览文件 @
51895434
package
com
.
example
.
seleniumtest
.
conferenceRoomTest
;
import
lombok.Data
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Data
@Component
public
class
ConferenceActive
{
@Value
(
value
=
"${conferenceRoomTest.url}"
)
private
String
baseUrl
;
private
WebDriver
webDriver
;
public
void
login
(
String
username
,
String
password
){
//todo 这个系统暂时没有登录的功能
}
public
void
toRowSeat
(){
webDriver
.
get
(
baseUrl
);
WebElement
rowSeatButton
=
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[2]/form/div[3]/div/div/button[1]/span"
));
rowSeatButton
.
click
();
}
public
void
toManager
(){
webDriver
.
get
(
baseUrl
);
WebElement
managerButton
=
webDriver
.
findElement
(
By
.
xpath
(
"/html/body/div/div/div[2]/form/div[3]/div/div/button[2]/span"
));
managerButton
.
click
();
}
}
src/main/java/com/example/seleniumtest/selenium/SeleniumTestApplication.java
deleted
100644 → 0
浏览文件 @
55fa477b
package
com
.
example
.
seleniumtest
.
selenium
;
import
com.example.seleniumtest.selenium.enums.Browser
;
import
com.example.seleniumtest.selenium.util.WebDriverUtil
;
import
org.openqa.selenium.WebDriver
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SeleniumTestApplication
{
public
static
void
main
(
String
[]
args
)
{
// SpringApplication.run(SeleniumTestApplication.class, args);
WebDriver
driver
=
WebDriverUtil
.
getWebDriver
(
Browser
.
FIREFOX
,
false
);
driver
.
get
(
"http://www.itest.info"
);
String
title
=
driver
.
getTitle
();
System
.
out
.
printf
(
title
);
driver
.
close
();
}
}
src/main/resources/application-dev.properties
0 → 100644
浏览文件 @
51895434
conferenceRoomTest.url
=
http://123.60.53.83:8080/confhd/
\ No newline at end of file
src/main/resources/application.properties
浏览文件 @
51895434
spring.profiles.active
=
dev
\ No newline at end of file
src/test/java/com/example/seleniumtest/SeleniumTestApplicationTests.java
浏览文件 @
51895434
package
com
.
example
.
seleniumtest
;
package
com
.
example
.
seleniumtest
;
import
com.example.seleniumtest.conferenceRoomTest.ConferenceActive
;
import
com.example.seleniumtest.selenium.enums.Browser
;
import
com.example.seleniumtest.selenium.util.WebDriverUtil
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.openqa.selenium.WebDriver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@SpringBootTest
@RunWith
(
SpringRunner
.
class
)
class
SeleniumTestApplicationTests
{
@SpringBootTest
(
classes
=
{
SeleniumTestApplication
.
class
})
public
class
SeleniumTestApplicationTests
{
@Autowired
ConferenceActive
conferenceActive
;
@Test
@Test
void
contextLoads
()
{
public
void
test1
()
{
WebDriver
driver
=
WebDriverUtil
.
getWebDriver
(
Browser
.
FIREFOX
,
false
);
conferenceActive
.
setWebDriver
(
driver
);
conferenceActive
.
toManager
();
// driver.close();
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论