Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uniCloud
提交
fbfcb7fc
H
hello-uniCloud
项目概览
DCloud
/
hello-uniCloud
通知
294
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uniCloud
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fbfcb7fc
编写于
11月 22, 2023
作者:
A
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update demo.test.js
上级
f39a22c1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
16 deletion
+27
-16
pages/clientDB/demo/demo.test.js
pages/clientDB/demo/demo.test.js
+27
-16
未找到文件。
pages/clientDB/demo/demo.test.js
浏览文件 @
fbfcb7fc
...
@@ -5,31 +5,34 @@ describe('pages/clientDB/demo/demo.vue', () => {
...
@@ -5,31 +5,34 @@ describe('pages/clientDB/demo/demo.vue', () => {
page
=
await
program
.
reLaunch
(
page
=
await
program
.
reLaunch
(
'
/pages/clientDB/demo/demo
'
)
'
/pages/clientDB/demo/demo
'
)
await
page
.
waitFor
(
"
view
"
)
await
page
.
waitFor
(
"
view
"
)
page
=
await
program
.
currentPage
()
perPage
=
await
page
.
$
(
'
.page
'
)
perPage
=
await
page
.
$
(
'
.page
'
)
//底部角色控制条
//底部角色控制条
roles
=
await
perPage
.
$$
(
'
.roles-item
'
)
roles
=
await
perPage
.
$$
(
'
.roles-item
'
)
})
})
it
(
'
未登陆
'
,
async
()
=>
{
it
(
'
未登陆
'
,
async
()
=>
{
//点击创建
await
roles
[
0
].
tap
()
await
roles
[
0
].
tap
()
await
page
.
waitFor
(
500
)
const
start
=
Date
.
now
(
)
const
unLogin
=
await
page
.
waitFor
(
async
()
=>
{
const
unLogin
=
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
4000
){
console
.
warn
(
'
连接服务器超时
'
)
return
true
}
const
unLoginRole
=
await
page
.
data
(
'
currentRole
'
)
const
unLoginRole
=
await
page
.
data
(
'
currentRole
'
)
return
unLoginRole
===
0
return
unLoginRole
===
0
})
})
console
.
log
(
"
unLogin:
"
,
unLogin
,
unLogin
===
0
);
console
.
log
(
"
未登陆:
"
,
unLogin
);
const
commentBtn
=
await
page
.
$
(
'
.comment-btn
'
)
const
commentBtn
=
await
page
.
$
(
'
.comment-btn
'
)
//
console.log(await commentBtn.text(),"text---------");
console
.
log
(
await
commentBtn
.
text
(),
"
text---------
"
);
expect
(
await
commentBtn
.
text
()).
toBe
(
'
写留言
'
)
expect
(
(
await
commentBtn
.
text
()).
trim
()).
toBe
(
'
写留言
'
)
})
})
it
(
'
用户
'
,
async
()
=>
{
it
(
'
用户
'
,
async
()
=>
{
//点击创建
await
roles
[
1
].
tap
()
await
roles
[
1
].
tap
()
const
start
=
Date
.
now
()
const
user
=
await
page
.
waitFor
(
async
()
=>
{
const
user
=
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
4000
){
console
.
warn
(
'
连接服务器超时
'
)
return
true
}
const
userRole
=
await
page
.
data
(
'
currentRole
'
)
const
userRole
=
await
page
.
data
(
'
currentRole
'
)
return
userRole
===
'
user
'
return
userRole
===
'
user
'
})
})
...
@@ -38,14 +41,18 @@ describe('pages/clientDB/demo/demo.vue', () => {
...
@@ -38,14 +41,18 @@ describe('pages/clientDB/demo/demo.vue', () => {
//新增一条留言
//新增一条留言
const
userWrite
=
await
page
.
callMethod
(
'
submitComment
'
,
'
我是用户
'
)
const
userWrite
=
await
page
.
callMethod
(
'
submitComment
'
,
'
我是用户
'
)
const
usId
=
userWrite
.
id
const
usId
=
userWrite
.
id
console
.
log
(
'
usId:
'
,
usId
);
//expect(usId).not.toBeUndefined();
//expect(usId).not.toBeUndefined();
// await page.waitFor(1000)
}
}
})
})
it
(
'
审核员
'
,
async
()
=>
{
it
(
'
审核员
'
,
async
()
=>
{
//点击创建
await
roles
[
2
].
tap
()
await
roles
[
2
].
tap
()
const
start
=
Date
.
now
()
const
auditor
=
await
page
.
waitFor
(
async
()
=>
{
const
auditor
=
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
4000
){
console
.
warn
(
'
连接服务器超时
'
)
return
true
}
const
auditorRole
=
await
page
.
data
(
'
currentRole
'
)
const
auditorRole
=
await
page
.
data
(
'
currentRole
'
)
return
auditorRole
===
'
auditor
'
return
auditorRole
===
'
auditor
'
})
})
...
@@ -67,18 +74,22 @@ describe('pages/clientDB/demo/demo.vue', () => {
...
@@ -67,18 +74,22 @@ describe('pages/clientDB/demo/demo.vue', () => {
)
)
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
//审核员更改留言
//审核员更改留言
const
setUid
=
await
page
.
setData
({
await
page
.
setData
({
"
activeNoticeId
"
:
audId
"
activeNoticeId
"
:
audId
})
})
const
auditorUpdate
=
await
page
.
callMethod
(
'
updateComment
'
,
await
page
.
callMethod
(
'
updateComment
'
,
"
我是审核员123
"
"
我是审核员123
"
)
)
}
}
})
})
it
(
'
管理员
'
,
async
()
=>
{
it
(
'
管理员
'
,
async
()
=>
{
//点击创建
await
roles
[
3
].
tap
()
await
roles
[
3
].
tap
()
const
start
=
Date
.
now
()
const
admin
=
await
page
.
waitFor
(
async
()
=>
{
const
admin
=
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
4000
){
console
.
warn
(
'
连接服务器超时
'
)
return
true
}
const
adminRole
=
await
page
.
data
(
'
currentRole
'
)
const
adminRole
=
await
page
.
data
(
'
currentRole
'
)
return
adminRole
===
'
admin
'
return
adminRole
===
'
admin
'
})
})
...
@@ -102,7 +113,7 @@ describe('pages/clientDB/demo/demo.vue', () => {
...
@@ -102,7 +113,7 @@ describe('pages/clientDB/demo/demo.vue', () => {
)
)
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
//审核一条为拒绝
//审核一条为拒绝
const
adminRefuse
=
await
page
.
callMethod
(
'
updateState
'
,
await
page
.
callMethod
(
'
updateState
'
,
{
{
"
detail
"
:
{
"
detail
"
:
{
"
value
"
:
false
"
value
"
:
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录