Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
982763ec
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
大约 1 年 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
982763ec
编写于
9月 29, 2022
作者:
雨
雨爱无痕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add case id
上级
9324c40e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
183 addition
and
30 deletion
+183
-30
test/ui/ui_bug_test.go
test/ui/ui_bug_test.go
+4
-0
test/ui/ui_interpreter_test.go
test/ui/ui_interpreter_test.go
+8
-8
test/ui/ui_log_test.go
test/ui/ui_log_test.go
+1
-1
test/ui/ui_proxy_test.go
test/ui/ui_proxy_test.go
+6
-6
test/ui/ui_run_from_result_test.go
test/ui/ui_run_from_result_test.go
+1
-1
test/ui/ui_run_test.go
test/ui/ui_run_test.go
+150
-1
test/ui/ui_server_test.go
test/ui/ui_server_test.go
+9
-9
test/ui/ui_workspace_test.go
test/ui/ui_workspace_test.go
+4
-4
未找到文件。
test/ui/ui_bug_test.go
浏览文件 @
982763ec
...
...
@@ -11,6 +11,8 @@ import (
var
bugBrowser
playwright
.
Browser
func
ScriptBug
(
t
provider
.
T
)
{
t
.
ID
(
"5747"
)
t
.
AddParentSuite
(
"查看bug列表"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -87,6 +89,8 @@ func ScriptBug(t provider.T) {
}
func
ScriptsBug
(
t
provider
.
T
)
{
t
.
ID
(
"5748"
)
t
.
AddParentSuite
(
"查看bug列表"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
test/ui/ui_interpreter_test.go
浏览文件 @
982763ec
...
...
@@ -11,8 +11,8 @@ import (
var
interpreterBrowser
playwright
.
Browser
func
CreateInterpreter
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
AddParentSuite
(
"
设置界面语言
"
)
t
.
ID
(
"5
744
"
)
t
.
AddParentSuite
(
"
管理解析器
"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -105,8 +105,8 @@ func CreateInterpreter(t provider.T) {
}
}
func
EditInterpreter
(
t
provider
.
T
)
{
t
.
ID
(
"5
46
5"
)
t
.
AddParentSuite
(
"
设置界面语言
"
)
t
.
ID
(
"5
74
5"
)
t
.
AddParentSuite
(
"
管理解析器
"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -212,7 +212,7 @@ func EditInterpreter(t provider.T) {
}
func
DeleteInterpreter
(
t
provider
.
T
)
{
t
.
ID
(
"5465"
)
t
.
AddParentSuite
(
"
设置界面语言
"
)
t
.
AddParentSuite
(
"
管理解析器
"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -291,7 +291,7 @@ func DeleteInterpreter(t provider.T) {
}
func
TestUiInterpreter
(
t
*
testing
.
T
)
{
runner
.
Run
(
t
,
"客户端-创建解析器"
,
CreateInterpreter
)
runner
.
Run
(
t
,
"客户端-编辑解析器"
,
EditInterpreter
)
runner
.
Run
(
t
,
"客户端-删除解析器"
,
DeleteInterpreter
)
runner
.
Run
(
t
,
"客户端-创建
语言
解析器"
,
CreateInterpreter
)
runner
.
Run
(
t
,
"客户端-编辑
语言
解析器"
,
EditInterpreter
)
runner
.
Run
(
t
,
"客户端-删除
语言
解析器"
,
DeleteInterpreter
)
}
test/ui/ui_log_test.go
浏览文件 @
982763ec
...
...
@@ -109,7 +109,7 @@ func CollapseLog(t provider.T) {
}
func
FullScreenLog
(
t
provider
.
T
)
{
t
.
ID
(
"5
502
"
)
t
.
ID
(
"5
749
"
)
t
.
AddParentSuite
(
"脚本执行日志"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
test/ui/ui_proxy_test.go
浏览文件 @
982763ec
...
...
@@ -11,7 +11,7 @@ import (
var
proxyBrowser
playwright
.
Browser
func
CreateProxy
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
ID
(
"5
740
"
)
t
.
AddParentSuite
(
"设置界面语言"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -102,7 +102,7 @@ func CreateProxy(t provider.T) {
}
}
func
EditProxy
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
ID
(
"5
741
"
)
t
.
AddParentSuite
(
"设置界面语言"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -193,7 +193,7 @@ func EditProxy(t provider.T) {
}
}
func
DeleteProxy
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
ID
(
"5
742
"
)
t
.
AddParentSuite
(
"设置界面语言"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -268,7 +268,7 @@ func DeleteProxy(t provider.T) {
}
func
TestUiProxy
(
t
*
testing
.
T
)
{
runner
.
Run
(
t
,
"客户端-创建
解析器
"
,
CreateProxy
)
runner
.
Run
(
t
,
"客户端-编辑
解析器
"
,
EditProxy
)
runner
.
Run
(
t
,
"客户端-删除
解析器
"
,
DeleteProxy
)
runner
.
Run
(
t
,
"客户端-创建
执行节点
"
,
CreateProxy
)
runner
.
Run
(
t
,
"客户端-编辑
执行节点
"
,
EditProxy
)
runner
.
Run
(
t
,
"客户端-删除
执行节点
"
,
DeleteProxy
)
}
test/ui/ui_run_from_result_test.go
浏览文件 @
982763ec
...
...
@@ -139,7 +139,7 @@ func RunReExecFailCase(t provider.T) {
}
func
RunReExecAllCase
(
t
provider
.
T
)
{
t
.
ID
(
"5
491
"
)
t
.
ID
(
"5
750
"
)
t
.
AddParentSuite
(
"测试结果页面执行脚本"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
test/ui/ui_run_test.go
浏览文件 @
982763ec
...
...
@@ -14,7 +14,7 @@ import (
)
func
RunScript
(
t
provider
.
T
)
{
t
.
ID
(
"5
479
"
)
t
.
ID
(
"5
743
"
)
t
.
AddParentSuite
(
"执行脚本"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -1233,6 +1233,154 @@ func createWorkspace(t provider.T, workspacePath string, page playwright.Page) {
}
}
func
RunUseProxy
(
t
provider
.
T
)
{
t
.
ID
(
"5746"
)
t
.
AddParentSuite
(
"执行脚本"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
FailNow
()
}
headless
:=
true
var
slowMo
float64
=
100
runBrowser
,
err
:=
pw
.
Chromium
.
Launch
(
playwright
.
BrowserTypeLaunchOptions
{
Headless
:
&
headless
,
SlowMo
:
&
slowMo
})
if
err
!=
nil
{
t
.
Errorf
(
"Fail to launch the web runBrowser: %v"
,
err
)
t
.
FailNow
()
}
page
,
err
:=
runBrowser
.
NewPage
()
if
err
!=
nil
{
t
.
Errorf
(
"Create the new page fail: %v"
,
err
)
t
.
FailNow
()
}
defer
func
()
{
if
err
=
runBrowser
.
Close
();
err
!=
nil
{
t
.
Errorf
(
"The workspaceBrowser cannot be closed: %v"
,
err
)
t
.
FailNow
()
return
}
if
err
=
pw
.
Stop
();
err
!=
nil
{
t
.
Errorf
(
"The playwright cannot be stopped: %v"
,
err
)
t
.
FailNow
()
return
}
}()
if
_
,
err
=
page
.
Goto
(
"http://127.0.0.1:8000/"
,
playwright
.
PageGotoOptions
{
WaitUntil
:
playwright
.
WaitUntilStateDomcontentloaded
});
err
!=
nil
{
t
.
Errorf
(
"The specific URL is missing: %v"
,
err
)
t
.
FailNow
()
}
CreateProxyAndInterpreter
(
page
,
t
)
_
,
err
=
page
.
WaitForSelector
(
".tree-node"
)
if
err
!=
nil
{
t
.
Errorf
(
"Wait tree-node fail: %v"
,
err
)
t
.
FailNow
()
}
locator
,
err
:=
page
.
Locator
(
".tree-node"
,
playwright
.
PageLocatorOptions
{
HasText
:
"单元测试工作目录"
})
c
,
err
:=
locator
.
Count
()
if
err
!=
nil
||
c
==
0
{
t
.
Errorf
(
"Find workspace fail: %v"
,
err
)
t
.
FailNow
()
}
err
=
locator
.
Click
()
if
err
!=
nil
{
t
.
Errorf
(
"Click node fail: %v"
,
err
)
t
.
FailNow
()
}
scriptLocator
,
err
:=
locator
.
Locator
(
"text=1_string_match.php"
)
if
err
!=
nil
{
t
.
Errorf
(
"Find 1_string_match.php fail: %v"
,
err
)
t
.
FailNow
()
}
err
=
scriptLocator
.
Click
()
if
err
!=
nil
{
t
.
Errorf
(
"Click script fail: %v"
,
err
)
t
.
FailNow
()
}
err
=
page
.
Click
(
"#proxyMenuToggle"
)
if
err
!=
nil
{
t
.
Errorf
(
"Click proxy nav fail: %v"
,
err
)
t
.
FailNow
()
}
err
=
page
.
Click
(
".list-item-title:has-text('测试执行节点')"
)
if
err
!=
nil
{
t
.
Errorf
(
"Select proxy fail: %v"
,
err
)
t
.
FailNow
()
}
err
=
page
.
Click
(
".tabs-nav-toolbar>>[title=
\"
Run
\"
]"
)
if
err
!=
nil
{
t
.
Errorf
(
"Click run fail: %v"
,
err
)
t
.
FailNow
()
}
_
,
err
=
page
.
WaitForSelector
(
"#log-list>>.msg-span>>:has-text('执行1个用例,耗时')"
)
if
err
!=
nil
{
t
.
Errorf
(
"Wait exec result fail: %v"
,
err
)
t
.
FailNow
()
}
element
,
err
:=
page
.
QuerySelector
(
"#log-list>>.msg-span>>:has-text('执行1个用例,耗时')"
)
innerText
,
err
:=
element
.
InnerText
()
if
err
!=
nil
{
t
.
Errorf
(
"Find result fail: %v"
,
err
)
t
.
FailNow
()
}
if
!
strings
.
Contains
(
innerText
,
"1(100.0%) 失败"
)
{
t
.
Errorf
(
"Exec 1_string_match.php fail: %v"
,
err
)
t
.
FailNow
()
}
resultTitleElement
,
err
:=
page
.
QuerySelector
(
"#rightPane .result-list-item .list-item-title"
)
if
err
!=
nil
{
t
.
Errorf
(
"Find log title in logPane fail: %v"
,
err
)
t
.
FailNow
()
}
resultTitle
,
err
:=
resultTitleElement
.
InnerText
()
if
err
!=
nil
||
resultTitle
!=
"1_string_match.php"
{
t
.
Errorf
(
"Find result in rightPane fail: %v"
,
err
)
t
.
FailNow
()
}
timeElement
,
err
:=
page
.
QuerySelector
(
"#log-list .item .time"
)
if
err
!=
nil
{
t
.
Errorf
(
"Find log time in logPane fail: %v"
,
err
)
t
.
FailNow
()
}
logTime
,
err
:=
timeElement
.
InnerText
()
if
err
!=
nil
{
t
.
Errorf
(
"Find log time in logPane fail: %v"
,
err
)
t
.
FailNow
()
}
resultTimeElement
,
err
:=
page
.
QuerySelector
(
"#rightPane .result-list-item .list-item-trailing-text"
)
if
err
!=
nil
{
t
.
Errorf
(
"Find log time in logPane fail: %v"
,
err
)
t
.
FailNow
()
}
resultTime
,
err
:=
resultTimeElement
.
InnerText
()
if
err
!=
nil
||
logTime
[
:
5
]
!=
resultTime
{
t
.
Errorf
(
"Find result in rightPane fail: %v"
,
err
)
t
.
FailNow
()
}
}
func
CreateProxyAndInterpreter
(
page
playwright
.
Page
,
t
provider
.
T
)
{
page
.
Click
(
"#navbar>>[title=
\"
设置
\"
]"
)
page
.
WaitForSelector
(
"#proxyTable"
,
playwright
.
PageWaitForSelectorOptions
{
State
:
playwright
.
WaitForSelectorStateAttached
})
locator
,
_
:=
page
.
Locator
(
"#proxyTable>>.z-tbody-td>>:scope:has-text('测试执行节点')"
)
c
,
_
:=
locator
.
Count
()
if
c
>
0
{
page
.
Click
(
"#settingModal>>.modal-close"
)
return
}
page
.
Click
(
"#serverTable>>button:has-text('新建执行节点')"
)
locator
,
_
=
page
.
Locator
(
"#proxyFormModal input"
)
nameInput
,
_
:=
locator
.
Nth
(
0
)
nameInput
.
Fill
(
"测试执行节点"
)
page
.
WaitForTimeout
(
200
)
pathSelect
,
_
:=
locator
.
Nth
(
1
)
pathSelect
.
Fill
(
"http://127.0.0.1:8085"
)
page
.
Click
(
"#proxyFormModal>>text=确定"
)
page
.
WaitForSelector
(
"#proxyFormModal"
,
playwright
.
PageWaitForSelectorOptions
{
State
:
playwright
.
WaitForSelectorStateDetached
})
page
.
WaitForTimeout
(
1000
)
page
.
Click
(
"#settingModal>>.modal-close"
)
}
func
TestUiRun
(
t
*
testing
.
T
)
{
runner
.
Run
(
t
,
"客户端-执行单个脚本"
,
RunScript
)
runner
.
Run
(
t
,
"客户端-右键执行单个脚本"
,
RunScriptByRightClick
)
...
...
@@ -1243,4 +1391,5 @@ func TestUiRun(t *testing.T) {
runner
.
Run
(
t
,
"客户端-右键执行工作目录"
,
RunWorkspace
)
runner
.
Run
(
t
,
"客户端-右键执行文件夹"
,
RunDir
)
runner
.
Run
(
t
,
"客户端-执行TestNG单元测试"
,
RunUnit
)
runner
.
Run
(
t
,
"客户端-使用代理执行单个脚本"
,
RunUseProxy
)
}
test/ui/ui_server_test.go
浏览文件 @
982763ec
...
...
@@ -11,8 +11,8 @@ import (
var
serverBrowser
playwright
.
Browser
func
CreateServer
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
AddParentSuite
(
"
设置界面语言
"
)
t
.
ID
(
"5
737
"
)
t
.
AddParentSuite
(
"
管理服务器
"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -100,8 +100,8 @@ func CreateServer(t provider.T) {
}
}
func
EditServer
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
AddParentSuite
(
"
设置界面语言
"
)
t
.
ID
(
"5
738
"
)
t
.
AddParentSuite
(
"
管理服务器
"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -190,8 +190,8 @@ func EditServer(t provider.T) {
}
}
func
DeleteServer
(
t
provider
.
T
)
{
t
.
ID
(
"5
465
"
)
t
.
AddParentSuite
(
"
设置界面语言
"
)
t
.
ID
(
"5
739
"
)
t
.
AddParentSuite
(
"
管理服务器
"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -265,7 +265,7 @@ func DeleteServer(t provider.T) {
}
func
TestUiServer
(
t
*
testing
.
T
)
{
runner
.
Run
(
t
,
"客户端-创建
解析
器"
,
CreateServer
)
runner
.
Run
(
t
,
"客户端-编辑
解析
器"
,
EditServer
)
runner
.
Run
(
t
,
"客户端-删除
解析
器"
,
DeleteServer
)
runner
.
Run
(
t
,
"客户端-创建
服务
器"
,
CreateServer
)
runner
.
Run
(
t
,
"客户端-编辑
服务
器"
,
EditServer
)
runner
.
Run
(
t
,
"客户端-删除
服务
器"
,
DeleteServer
)
}
test/ui/ui_workspace_test.go
浏览文件 @
982763ec
...
...
@@ -173,7 +173,7 @@ func CreateWorkspace(t provider.T) {
}
func
SyncFromZentao
(
t
provider
.
T
)
{
t
.
ID
(
"5
468
"
)
t
.
ID
(
"5
751
"
)
t
.
AddParentSuite
(
"管理禅道站点下工作目录"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -267,7 +267,7 @@ func SyncFromZentao(t provider.T) {
}
func
SyncTwoCaseFromZentao
(
t
provider
.
T
)
{
t
.
ID
(
"5
468
"
)
t
.
ID
(
"5
752
"
)
t
.
AddParentSuite
(
"管理禅道站点下工作目录"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -365,7 +365,7 @@ func SyncTwoCaseFromZentao(t provider.T) {
}
func
SyncToZentao
(
t
provider
.
T
)
{
t
.
ID
(
"54
68
"
)
t
.
ID
(
"54
31
"
)
t
.
AddParentSuite
(
"管理禅道站点下工作目录"
)
pw
,
err
:=
playwright
.
Run
()
if
err
!=
nil
{
...
...
@@ -1425,7 +1425,7 @@ func Collapse(t provider.T) {
}
func
TestUiWorkspace
(
t
*
testing
.
T
)
{
runner
.
Run
(
t
,
"客户端-同步到禅道"
,
SyncToZentao
)
runner
.
Run
(
t
,
"客户端-从禅道同步
部分
用例"
,
SyncTwoCaseFromZentao
)
runner
.
Run
(
t
,
"客户端-从禅道同步
选中
用例"
,
SyncTwoCaseFromZentao
)
runner
.
Run
(
t
,
"客户端-从禅道同步"
,
SyncFromZentao
)
runner
.
Run
(
t
,
"客户端-复制粘贴树状脚本文件"
,
Copy
)
runner
.
Run
(
t
,
"客户端-剪切粘贴树状脚本文件"
,
Clip
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录