Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-starter
提交
89b492f1
U
uni-starter
项目概览
DCloud
/
uni-starter
通知
4684
Star
229
Fork
210
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
89b492f1
编写于
9月 29, 2021
作者:
study夏羽
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
screenshot test
上级
1016a3ac
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
72 addition
and
30 deletion
+72
-30
jest.config.js
jest.config.js
+2
-1
pages/grid/grid.test.js
pages/grid/grid.test.js
+0
-11
pages/list/search/search.test.js
pages/list/search/search.test.js
+3
-1
pages/ucenter/about/about.test.js
pages/ucenter/about/about.test.js
+12
-10
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.test.js
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.test.js
+18
-6
pages/ucenter/settings/settings.test.js
pages/ucenter/settings/settings.test.js
+37
-0
pages/ucenter/userinfo/bind-mobile/bind-mobile.test.js
pages/ucenter/userinfo/bind-mobile/bind-mobile.test.js
+0
-1
static/screenshot/about.png
static/screenshot/about.png
+0
-0
未找到文件。
jest.config.js
浏览文件 @
89b492f1
...
@@ -8,10 +8,11 @@ module.exports = {
...
@@ -8,10 +8,11 @@ module.exports = {
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
rootDir
:
__dirname
,
rootDir
:
__dirname
,
testMatch
:
[
"
<rootDir>/pages/**/*test.[jt]s?(x)
"
],
testMatch
:
[
"
<rootDir>/pages/**/*test.[jt]s?(x)
"
],
// testMatch: ["<rootDir>/pages/ucenter/
login-page/pwd-retrieve/pwd-retrieve
.test.js"],
// testMatch: ["<rootDir>/pages/ucenter/
about/about
.test.js"],
testPathIgnorePatterns
:
[
'
/node_modules/
'
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
],
testSequencer
:
path
.
join
(
__dirname
,
"
testSequencer.js
"
)
testSequencer
:
path
.
join
(
__dirname
,
"
testSequencer.js
"
)
//pages/ucenter/userinfo/userinfo.test.js
//pages/ucenter/userinfo/userinfo.test.js
//pages/ucenter/login-page/pwd-login/pwd-login.test.js
//pages/ucenter/login-page/pwd-login/pwd-login.test.js
}
}
pages/grid/grid.test.js
浏览文件 @
89b492f1
...
@@ -9,11 +9,6 @@ describe('pages/grid/grid.vue', () => {
...
@@ -9,11 +9,6 @@ describe('pages/grid/grid.vue', () => {
})
})
it
(
'
检测宫格
'
,
async
()
=>
{
it
(
'
检测宫格
'
,
async
()
=>
{
// expect.assertions(1);
// const perPage = await page.$('.warp')
// const getData = await perPage.data('gridList')
// console.log("getData: ",getData);
// expect(getData.length).toBe(9)
expect
.
assertions
(
1
);
expect
.
assertions
(
1
);
const
getData
=
await
page
.
data
(
'
gridList
'
)
const
getData
=
await
page
.
data
(
'
gridList
'
)
console
.
log
(
"
getData:
"
,
getData
);
console
.
log
(
"
getData:
"
,
getData
);
...
@@ -26,13 +21,7 @@ describe('pages/grid/grid.vue', () => {
...
@@ -26,13 +21,7 @@ describe('pages/grid/grid.vue', () => {
const
perPage
=
await
page
.
$
(
'
.warp
'
)
const
perPage
=
await
page
.
$
(
'
.warp
'
)
const
uGrid
=
await
perPage
.
$
(
'
.uni-grid-box
'
)
const
uGrid
=
await
perPage
.
$
(
'
.uni-grid-box
'
)
console
.
log
(
"
uGrid-----------:
"
,
uGrid
);
console
.
log
(
"
uGrid-----------:
"
,
uGrid
);
// await uGrid.callMethod('change')
// await uGrid.callMethod('change')
// const tapRes = await uGrid.tap()
// const tapRes = await uGrid.callMethod('change')
// await page.waitFor(300)
// console.log("tapRes: ",tapRes);
})
})
...
...
pages/list/search/search.test.js
浏览文件 @
89b492f1
...
@@ -8,13 +8,15 @@ describe('pages/list/search/search.vue', () => {
...
@@ -8,13 +8,15 @@ describe('pages/list/search/search.vue', () => {
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
})
})
it
(
'
搜索发现-显示-影藏
'
,
async
()
=>
{
it
(
'
搜索发现-显示-影藏
'
,
async
()
=>
{
expect
.
assertions
(
2
);
//
expect.assertions(2);
await
page
.
callMethod
(
'
searchHotRefresh
'
)
await
page
.
callMethod
(
'
searchHotRefresh
'
)
await
page
.
waitFor
(
300
)
await
page
.
waitFor
(
300
)
const
getShow
=
await
page
.
data
(
'
netHotListIsHide
'
)
const
getShow
=
await
page
.
data
(
'
netHotListIsHide
'
)
console
.
log
(
getShow
,
"
0000000000000
"
);
expect
(
getShow
).
toBeFalsy
()
expect
(
getShow
).
toBeFalsy
()
if
(
!
getShow
){
if
(
!
getShow
){
await
page
.
setData
({
netHotListIsHide
:
true
})
await
page
.
setData
({
netHotListIsHide
:
true
})
console
.
log
(
await
page
.
data
(
'
netHotListIsHide
'
),
"
1111111111
"
);
expect
(
await
page
.
data
(
'
netHotListIsHide
'
)).
toBeTruthy
()
expect
(
await
page
.
data
(
'
netHotListIsHide
'
)).
toBeTruthy
()
}
}
})
})
...
...
pages/ucenter/about/about.test.js
浏览文件 @
89b492f1
...
@@ -8,21 +8,23 @@ describe('pages/ucenter/about/about.vue', () => {
...
@@ -8,21 +8,23 @@ describe('pages/ucenter/about/about.vue', () => {
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
})
})
it
(
'
检测标题
'
,
async
()
=>
{
it
(
'
about
'
,
async
()
=>
{
// expect.assertions(1);
expect
.
assertions
(
2
);
// const perPage = await page.$('.about')
// await page.waitFor(500)
const
getData
=
await
page
.
data
(
'
about
'
)
const
getData
=
await
page
.
data
(
'
about
'
)
console
.
log
(
"
getData-----------:
"
,
getData
);
console
.
log
(
"
getData-----------:
"
,
getData
);
//
expect(getData.appName).toBe('uni-starter')
expect
(
getData
.
appName
).
toBe
(
'
uni-starter
'
)
//
expect(getData.slogan).toBe('云端一体应用快速开发模版')
expect
(
getData
.
slogan
).
toBe
(
'
云端一体应用快速开发模版
'
)
})
})
it
(
'
隐私政策协议-点击跳转
'
,
async
()
=>
{
it
(
'
screenshot
'
,
async
()
=>
{
// expect.assertions(1);
var
image
=
await
program
.
screenshot
({
const
elAgree
=
await
page
.
$
(
'
.agreement
'
)
path
:
"
static/screenshot/about.png
"
// 默认项目根目录
// console.log("elAgree: ", elAgree);
})
console
.
log
(
image
,
"
image--------------------
"
)
})
it
(
'
隐私政策协议-点击跳转
'
,
async
()
=>
{
await
page
.
callMethod
(
'
navigateTo
'
,
{
await
page
.
callMethod
(
'
navigateTo
'
,
{
url
:
"
https://ask.dcloud.net.cn/protocol.html
"
,
url
:
"
https://ask.dcloud.net.cn/protocol.html
"
,
title
:
"
用户服务条款
"
title
:
"
用户服务条款
"
...
...
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.test.js
浏览文件 @
89b492f1
...
@@ -18,15 +18,27 @@ describe('pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue', () => {
...
@@ -18,15 +18,27 @@ describe('pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue', () => {
}
}
})
})
if
(
process
.
env
.
UNI_PLATFORM
===
"
h5
"
)
{
// if (process.env.UNI_PLATFORM === "h5") {
const
submitRes
=
await
page
.
callMethod
(
'
submit
'
)
console
.
log
(
"
submitRes:
"
,
submitRes
);
// }
// expect(submitRes.msg).toBe('密码重置成功')
await
page
.
waitFor
(
500
)
}
console
.
log
(
await
program
.
currentPage
());
console
.
log
(
await
program
.
currentPage
());
// expect((await program.currentPage()).path).toBe('/pages/ucenter/settings/settings')
// expect((await program.currentPage()).path).toBe('/pages/ucenter/settings/settings')
const
submitRes
=
await
page
.
callMethod
(
'
submit
'
)
console
.
log
(
"
submitRes:
"
,
submitRes
);
if
(
submitRes
){
switch
(
submitRes
.
code
){
case
0
:
expect
(
submitRes
.
msg
).
toBe
(
'
密码重置成功
'
)
break
;
case
10202
:
expect
(
submitRes
.
msg
).
toBe
(
'
此手机号尚未注册
'
)
break
;
default
:
break
;
}
}
})
})
})
})
pages/ucenter/settings/settings.test.js
浏览文件 @
89b492f1
...
@@ -9,6 +9,43 @@ describe('pages/ucenter/settings/settings', () => {
...
@@ -9,6 +9,43 @@ describe('pages/ucenter/settings/settings', () => {
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
})
})
it
(
'
切换语言
'
,
async
()
=>
{
console
.
log
(
await
page
.
data
(
'
uniToken
'
),
'
uniToken-------------------------
'
);
// await page.callMethod('changeLanguage') 弹框不支持点击
console
.
log
((
await
program
.
currentPage
()).
path
);
if
(
process
.
env
.
UNI_PLATFORM
===
"
app-plus
"
)
{
//清理缓存
await
page
.
callMethod
(
'
clearTmp
'
)
console
.
log
(
"
clearTmp: -------------
"
);
console
.
log
(
await
page
.
data
(
'
pushIsOn
'
),
"
pushIsOn-------------
"
);
const
pushRes
=
await
page
.
data
(
'
pushIsOn
'
)
if
(
pushRes
==
"
wait
"
){
await
page
.
callMethod
(
'
pushServer.off
'
)
console
.
log
(
"
pushServer---------
"
);
}
}
})
it
(
'
退出登录
'
,
async
()
=>
{
it
(
'
退出登录
'
,
async
()
=>
{
const
perPage
=
await
page
.
$
(
'
.content
'
)
const
perPage
=
await
page
.
$
(
'
.content
'
)
const
uList
=
await
perPage
.
$
(
'
.userInfo-class
'
)
const
uList
=
await
perPage
.
$
(
'
.userInfo-class
'
)
...
...
pages/ucenter/userinfo/bind-mobile/bind-mobile.test.js
浏览文件 @
89b492f1
...
@@ -14,7 +14,6 @@ describe('pages/ucenter/userinfo/bind-mobile/bind-mobile.vue', () => {
...
@@ -14,7 +14,6 @@ describe('pages/ucenter/userinfo/bind-mobile/bind-mobile.vue', () => {
"
phone
"
:
phone
"
phone
"
:
phone
}
}
})
})
// console.log(await page.data("formData"));
expect
(
phone
).
toMatch
(
/^1
\d{10}
$/
);
expect
(
phone
).
toMatch
(
/^1
\d{10}
$/
);
if
(
process
.
env
.
UNI_PLATFORM
===
"
mp-weixin
"
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
"
mp-weixin
"
)
{
...
...
static/screenshot/about.png
0 → 100644
浏览文件 @
89b492f1
103.1 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录