Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦想橡皮擦
uni-starter
提交
01ae3d9f
U
uni-starter
项目概览
梦想橡皮擦
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
01ae3d9f
编写于
10月 12, 2021
作者:
study夏羽
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复搜索条件问题
上级
da862267
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
60 addition
and
54 deletion
+60
-54
pages/list/list.nvue
pages/list/list.nvue
+1
-1
pages/list/search/search.test.js
pages/list/search/search.test.js
+3
-4
pages/ucenter/about/about.test.js
pages/ucenter/about/about.test.js
+1
-1
pages/ucenter/login-page/pwd-login/pwd-login.test.js
pages/ucenter/login-page/pwd-login/pwd-login.test.js
+24
-2
pages/ucenter/settings/settings.test.js
pages/ucenter/settings/settings.test.js
+18
-38
pages/ucenter/userinfo/bind-mobile/bind-mobile.test.js
pages/ucenter/userinfo/bind-mobile/bind-mobile.test.js
+1
-0
pages/ucenter/userinfo/userinfo.test.js
pages/ucenter/userinfo/userinfo.test.js
+11
-7
static/screenshot/about.png
static/screenshot/about.png
+0
-0
testSequencer.js
testSequencer.js
+1
-1
未找到文件。
pages/list/list.nvue
浏览文件 @
01ae3d9f
...
...
@@ -77,7 +77,7 @@
keyword(keyword, oldValue) {
let where = '"article_status" == 1 '
if (keyword) {
this.where = where + `/${keyword}/.test(title)`;
this.where = where + `
&&
/${keyword}/.test(title)`;
} else {
this.where = where;
}
...
...
pages/list/search/search.test.js
浏览文件 @
01ae3d9f
...
...
@@ -22,15 +22,14 @@ describe('pages/list/search/search.vue', () => {
})
it
(
'
搜索内容
'
,
async
()
=>
{
expect
.
assertions
(
1
);
//
expect.assertions(1);
const
setSearchTest
=
await
page
.
setData
({
searchText
:
'
小程序
'
,
})
//
console.log(await page.data('searchText'));
console
.
log
(
await
page
.
data
(
'
searchText
'
));
await
page
.
callMethod
(
'
search
'
,
'
小程序
'
)
await
page
.
waitFor
(
300
)
console
.
log
(
await
program
.
currentPage
(),
"
-----------------------
"
);
expect
((
await
program
.
currentPage
()).
path
).
toBe
(
'
pages/list/list
'
)
// 执行 navigateBack 验证是否返回
// expect((await program.navigateBack()).path).toBe('pages/list/search/search')
})
});
pages/ucenter/about/about.test.js
浏览文件 @
01ae3d9f
...
...
@@ -4,7 +4,7 @@
describe
(
'
pages/ucenter/about/about.vue
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigate
To
(
'
/pages/ucenter/about/about
'
)
page
=
await
program
.
redirect
To
(
'
/pages/ucenter/about/about
'
)
await
page
.
waitFor
(
500
)
})
...
...
pages/ucenter/login-page/pwd-login/pwd-login.test.js
浏览文件 @
01ae3d9f
...
...
@@ -5,7 +5,7 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
redirect
To
(
'
/pages/ucenter/login-page/pwd-login/pwd-login
'
)
page
=
await
program
.
navigate
To
(
'
/pages/ucenter/login-page/pwd-login/pwd-login
'
)
await
page
.
waitFor
(
500
)
})
...
...
@@ -43,7 +43,29 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => {
})
const
resLogin
=
await
page
.
callMethod
(
'
pwdLogin
'
)
console
.
log
(
"
resLogin:
"
,
resLogin
.
msg
);
expect
(
resLogin
.
msg
).
toBe
(
"
登录成功
"
);
switch
(
resLogin
.
msg
){
case
10102
:
expect
(
resLogin
.
msg
).
toBe
(
"
密码错误
"
);
const
setForm
=
await
page
.
setData
({
"
password
"
:
"
222222
"
,
"
username
"
:
"
数字天堂
"
,
"
agree
"
:
true
,
})
const
resLogin
=
await
page
.
callMethod
(
'
pwdLogin
'
)
break
;
case
10103
:
expect
(
resLogin
.
msg
).
toBe
(
"
密码错误次数过多
"
);
break
;
case
10002
:
expect
(
resLogin
.
msg
).
toBe
(
"
验证码不可为空
"
);
break
;
case
0
:
expect
(
resLogin
.
msg
).
toBe
(
"
登录成功
"
);
break
;
default
:
break
;
}
})
})
pages/ucenter/settings/settings.test.js
浏览文件 @
01ae3d9f
...
...
@@ -8,55 +8,35 @@ describe('pages/ucenter/settings/settings', () => {
page
=
await
program
.
navigateTo
(
'
/pages/ucenter/settings/settings
'
)
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
"
){
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
()
=>
{
const
perPage
=
await
page
.
$
(
'
.content
'
)
const
uList
=
await
perPage
.
$
(
'
.userInfo-class
'
)
await
page
.
waitFor
(
300
)
const
getTokenRes
=
await
page
.
waitFor
(
async
()
=>
{
/* it('退出登录', async () => {
const getTokenRes = await page.waitFor(async () => {
return await page.data('uniToken')
})
console
.
log
(
"
getTokenRes:
"
,
getTokenRes
);
await
page
.
callMethod
(
'
clickLogout
'
)
console
.
log
((
await
program
.
currentPage
()).
path
);
console.log("getTokenRes: ", getTokenRes);
console.log(await page.data('uniToken'), 'uniToken-------------------------');
if(getTokenRes){
await page.callMethod('clickLogout')
}
})
});
\ No newline at end of file
*/
});
pages/ucenter/userinfo/bind-mobile/bind-mobile.test.js
浏览文件 @
01ae3d9f
...
...
@@ -22,6 +22,7 @@ describe('pages/ucenter/userinfo/bind-mobile/bind-mobile.vue', () => {
await
page
.
waitFor
(
300
)
}
else
{
const
codebtn
=
await
page
.
$
(
'
.short-code-btn
'
)
console
.
log
(
"
codebtn:
"
,
codebtn
);
const
sendMsgRes
=
await
codebtn
.
callMethod
(
'
sendMsg
'
)
await
page
.
waitFor
(
300
)
}
...
...
pages/ucenter/userinfo/userinfo.test.js
浏览文件 @
01ae3d9f
...
...
@@ -4,7 +4,7 @@ describe('pages/ucenter/userinfo/userinfo.vue', () => {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
redirect
To
(
'
/pages/ucenter/userinfo/userinfo
'
)
page
=
await
program
.
navigate
To
(
'
/pages/ucenter/userinfo/userinfo
'
)
await
page
.
waitFor
(
500
)
})
...
...
@@ -15,15 +15,19 @@ describe('pages/ucenter/userinfo/userinfo.vue', () => {
})
console
.
log
(
"
getTokenRes:
"
,
getTokenRes
);
// if(getTokenRes){
// const nicknameRes = await page.callMethod("setNickname","数字天堂DCloud")
// await page.waitFor(300)
// console.log("nicknameRes: ",nicknameRes);
// expect(nicknameRes.updated).toBe(1)
// }
var
name
=
"
数字天堂DCloud
"
+
Math
.
round
(
Math
.
random
()
*
10
);
console
.
log
(
"
name:
"
,
name
);
if
(
getTokenRes
){
const
nicknameRes
=
await
page
.
callMethod
(
"
setNickname
"
,
name
)
await
page
.
waitFor
(
300
)
console
.
log
(
"
nicknameRes:
"
,
nicknameRes
);
expect
(
nicknameRes
.
updated
).
toBe
(
1
)
}
})
it
(
'
绑定手机号
'
,
async
()
=>
{
console
.
log
(
await
page
.
data
(
'
uniToken
'
),
"
-------------------------
"
);
await
page
.
callMethod
(
'
bindMobileBySmsCode
'
)
await
page
.
waitFor
(
300
)
console
.
log
((
await
program
.
currentPage
()).
path
);
...
...
static/screenshot/about.png
查看替换文件 @
da862267
浏览文件 @
01ae3d9f
103.1 KB
|
W:
|
H:
67.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
testSequencer.js
浏览文件 @
01ae3d9f
const
Sequencer
=
require
(
"
@jest/test-sequencer
"
).
default
;
const
sortTestFilenames
=
[
"
register.test.js
"
,
"
pwd-login.test.js
"
,
"
userinfo.test.js
"
];
const
sortTestFilenames
=
[
"
register.test.js
"
,
"
pwd-login.test.js
"
,
"
userinfo.test.js
"
,
"
search.test.js
"
];
class
CustomSequencer
extends
Sequencer
{
sort
(
tests
)
{
// 测试例排序
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录