Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-starter
提交
8d716363
U
uni-starter
项目概览
DCloud
/
uni-starter
通知
4574
Star
227
Fork
208
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8d716363
编写于
12月 22, 2023
作者:
A
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:adjust PAGE_PATH
上级
1c41d512
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
32 addition
and
49 deletion
+32
-49
pages/grid/grid.test.js
pages/grid/grid.test.js
+4
-3
pages/grid/grid.vue
pages/grid/grid.vue
+0
-2
pages/list/list.test.js
pages/list/list.test.js
+3
-2
pages/list/search/search.test.js
pages/list/search/search.test.js
+3
-3
pages/ucenter/about/about.test.js
pages/ucenter/about/about.test.js
+3
-3
pages/ucenter/settings/settings.test.js
pages/ucenter/settings/settings.test.js
+3
-4
pages/ucenter/ucenter.test.js
pages/ucenter/ucenter.test.js
+3
-2
uni_modules/uni-id-pages/pages/login/login-withpwd.test.js
uni_modules/uni-id-pages/pages/login/login-withpwd.test.js
+3
-9
uni_modules/uni-id-pages/pages/register/register.test.js
uni_modules/uni-id-pages/pages/register/register.test.js
+7
-17
uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js
uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js
+3
-4
未找到文件。
pages/grid/grid.test.js
浏览文件 @
8d716363
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/grid/grid.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/pages/grid/grid
'
describe
(
'
grid
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
switchTab
(
'
/pages/grid/grid
'
)
page
=
await
program
.
switchTab
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
检测宫格
'
,
async
()
=>
{
expect
.
assertions
(
2
);
expect
((
await
page
.
data
(
'
gridList
'
)).
length
).
toBe
(
9
)
console
.
log
(
"
hasLogin
"
,
await
page
.
data
(
'
hasLogin
'
))
expect
(
await
page
.
data
(
'
hasLogin
'
)).
toBeFalsy
()
})
it
(
'
点击宫格
'
,
async
()
=>
{
...
...
pages/grid/grid.vue
浏览文件 @
8d716363
...
...
@@ -78,7 +78,6 @@
},
methods
:
{
change
(
e
)
{
console
.
log
(
"
e:
"
,
e
);
uni
.
showToast
({
title
:
this
.
$t
(
'
grid.clickTip
'
)
+
"
"
+
`
${
e
.
detail
.
index
+
1
}
`
+
"
"
+
this
.
$t
(
'
grid.clickTipGrid
'
),
icon
:
'
none
'
...
...
@@ -90,7 +89,6 @@
onqueryload
(
data
)
{
},
changeSwiper
(
e
)
{
console
.
log
(
"
e:
"
,
e
);
this
.
current
=
e
.
detail
.
current
},
/**
...
...
pages/list/list.test.js
浏览文件 @
8d716363
describe
(
'
pages/list/list.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/pages/list/list
'
describe
(
'
list
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
switchTab
(
'
/pages/list/list
'
)
page
=
await
program
.
switchTab
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
检测标题
'
,
async
()
=>
{
...
...
pages/list/search/search.test.js
浏览文件 @
8d716363
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/list/search/search.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/pages/list/search/search
'
describe
(
'
search
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
'
/pages/list/search/search
'
)
page
=
await
program
.
navigateTo
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
搜索发现-显示-隐藏
'
,
async
()
=>
{
...
...
pages/ucenter/about/about.test.js
浏览文件 @
8d716363
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/ucenter/about/about.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/pages/ucenter/about/about
'
describe
(
'
about
'
,
()
=>
{
let
page
,
isWX
;
beforeAll
(
async
()
=>
{
try
{
isWX
=
process
.
env
.
UNI_PLATFORM
===
"
mp-weixin
"
if
(
!
isWX
){
page
=
await
program
.
reLaunch
(
'
/pages/ucenter/about/about
'
)
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
}
}
catch
(
err
)
{
...
...
pages/ucenter/settings/settings.test.js
浏览文件 @
8d716363
// uniapp自动化测试教程: https://uniapp-test.dcloud.net.cn/docs/testcase/start
describe
(
'
pages/ucenter/settings/
settings
'
,
()
=>
{
const
PAGE_PATH
=
'
/pages/ucenter/settings/settings
'
describe
(
'
settings
'
,
()
=>
{
let
page
,
uniToken
;
beforeAll
(
async
()
=>
{
try
{
page
=
await
program
.
navigateTo
(
'
/pages/ucenter/settings/settings
'
)
page
=
await
program
.
navigateTo
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
uniToken
=
await
program
.
callUniMethod
(
'
getStorageSync
'
,
'
uni_id_token
'
)
console
.
log
(
"
uniToken:
"
,
uniToken
);
...
...
@@ -22,7 +22,6 @@ describe('pages/ucenter/settings/settings', () => {
const
el
=
await
page
.
$
(
'
.content
'
)
await
page
.
waitFor
(
'
view
'
)
expect
.
assertions
(
1
);
let
res
=
await
el
.
$$
(
'
.mt10
'
)
expect
((
await
el
.
$$
(
'
.mt10
'
)).
length
).
toBe
(
2
)
}
})
...
...
pages/ucenter/ucenter.test.js
浏览文件 @
8d716363
jest
.
setTimeout
(
20000
);
describe
(
'
pages/ucenter/ucenter.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/pages/ucenter/ucenter
'
describe
(
'
ucenter
'
,
()
=>
{
let
page
,
uniToken
,
platform
;
beforeAll
(
async
()
=>
{
try
{
page
=
await
program
.
switchTab
(
'
/pages/ucenter/ucenter
'
)
page
=
await
program
.
switchTab
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
console
.
log
(
'
page:
'
,
page
);
console
.
log
(
'
pageStack:
'
,
await
program
.
pageStack
());
...
...
uni_modules/uni-id-pages/pages/login/login-withpwd.test.js
浏览文件 @
8d716363
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.io/collocation/auto/hbuilderx-extension/index
describe
(
'
uni_modules/uni-id-pages/pages/login/login-withpwd.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/uni_modules/uni-id-pages/pages/login/login-withpwd
'
describe
(
'
login-withpwd
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
'
/uni_modules/uni-id-pages/pages/login/login-withpwd
'
)
page
=
await
program
.
navigateTo
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
});
// it('screenshot',async()=>{
// const image = await program.screenshot();
// expect(image).toMatchImageSnapshot();
// await page.waitFor(500);
// })
it
(
'
账号密码登录
'
,
async
()
=>
{
await
page
.
setData
({
"
username
"
:
"
DCloud
"
,
...
...
@@ -30,7 +25,6 @@ describe('uni_modules/uni-id-pages/pages/login/login-withpwd.vue', () => {
switch
(
resLogin
.
errCode
){
case
0
:
console
.
log
(
'
登录成功
'
)
expect
(
resLogin
.
uid
).
toHaveLength
(
24
);
break
;
case
"
uni-id-account-not-exists
"
:
...
...
uni_modules/uni-id-pages/pages/register/register.test.js
浏览文件 @
8d716363
describe
(
'
uni_modules/uni-id-pages/pages/register/register.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/uni_modules/uni-id-pages/pages/register/register
'
describe
(
'
register
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
'
/uni_modules/uni-id-pages/pages/register/register
'
)
page
=
await
program
.
navigateTo
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
注册账号
'
,
async
()
=>
{
// expect.assertions(1);
let
username
=
"
DCloud
"
let
nickname
=
"
DCloud
"
let
password
=
"
dcloud2022
"
let
password2
=
"
dcloud2022
"
await
page
.
setData
({
formData
:
{
"
username
"
:
username
,
"
nickname
"
:
nickname
,
'
password
'
:
password
,
'
password2
'
:
password2
,
"
username
"
:
"
DCloud
"
,
"
nickname
"
:
"
DCloud
"
,
'
password
'
:
"
dcloud2022
"
,
'
password2
'
:
"
dcloud2022
"
,
"
captcha
"
:
"
1234
"
,
isAgree
:
true
,
needPopupAgreements
:
false
},
})
// expect(username).toMatch(/^1\d{10}$/);
expect
(
password
).
toMatch
(
/^.
{6,20}
$/
);
expect
(
password2
).
toMatch
(
/^.
{6,20}
$/
);
expect
(
password2
).
toEqual
(
password
);
if
(
process
.
env
.
UNI_PLATFORM
!=
"
mp-weixin
"
)
{
const
element
=
await
page
.
$
(
'
.uni-content
'
)
const
agreeEl
=
await
element
.
$
(
'
.root
'
)
...
...
uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js
浏览文件 @
8d716363
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.io/collocation/auto/hbuilderx-extension/index
describe
(
'
u
ni_modules/uni-id-pages/pages/userinfo/userinfo.vue
'
,
()
=>
{
const
PAGE_PATH
=
'
/uni_modules/uni-id-pages/pages/userinfo/userinfo
'
describe
(
'
u
serinfo
'
,
()
=>
{
let
page
,
uniToken
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
'
/uni_modules/uni-id-pages/pages/userinfo/userinfo
'
)
page
=
await
program
.
navigateTo
(
PAGE_PATH
)
await
page
.
waitFor
(
"
view
"
)
uniToken
=
await
program
.
callUniMethod
(
'
getStorageSync
'
,
'
uni_id_token
'
)
console
.
log
(
"
uniToken:
"
,
uniToken
);
...
...
@@ -29,7 +29,6 @@ describe('uni_modules/uni-id-pages/pages/userinfo/userinfo.vue', () => {
console
.
log
(
"
avatar_file:
"
,
avatar_file
);
if
(
process
.
env
.
UNI_PLATFORM
!=
"
mp-weixin
"
)
{
const
elBox
=
await
page
.
$
(
'
.box
'
)
// console.log("elBox: ",elBox);
await
elBox
.
callMethod
(
'
setAvatarFile
'
,
avatar_file
)
await
page
.
waitFor
(
500
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录