Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uniCloud
提交
c255655a
H
hello-uniCloud
项目概览
DCloud
/
hello-uniCloud
通知
299
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看板
提交
c255655a
编写于
5月 07, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test fix space-storage locked
上级
69e3eac7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
51 deletion
+58
-51
pages/storage/storage.test.js
pages/storage/storage.test.js
+0
-4
pages/user-info/list.test.js
pages/user-info/list.test.js
+48
-45
pages/user-info/list.vue
pages/user-info/list.vue
+10
-2
未找到文件。
pages/storage/storage.test.js
浏览文件 @
c255655a
...
...
@@ -11,8 +11,4 @@ describe('pages/storage/storage.vue', () => {
expect
(
await
btnText
[
0
].
text
()).
toBe
(
'
空间内置云存储
'
);
expect
(
await
btnText
[
1
].
text
()).
toBe
(
'
扩展存储-七牛云
'
);
})
it
(
'
空间内置云存储
'
,
async
()
=>
{
await
btnText
[
0
].
tap
()
console
.
log
(
"
---
"
,
await
program
.
currentPage
())
})
})
\ No newline at end of file
pages/user-info/list.test.js
浏览文件 @
c255655a
// jest.setTimeout(20000)
describe
(
'
pages/user-info/list.vue
'
,
()
=>
{
let
page
,
currentPage
;
console
.
log
(
'
uniTestPlatformInfo
'
,
process
.
env
.
uniTestPlatformInfo
)
if
(
process
.
env
.
uniTestPlatformInfo
==
'
ios_simulator 13.7
'
)
{
it
(
'
ios
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
beforeAll
(
async
()
=>
{
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page
=
await
program
.
navigateTo
(
'
/pages/user-info/list
'
)
await
page
.
waitFor
(
'
view
'
)
console
.
log
(
'
process----
'
,
process
.
env
.
UNI_PLATFORM
)
})
async
function
waitTime
()
{
if
(
process
.
env
.
UNI_PLATFORM
==
'
mp-weixin
'
)
{
await
page
.
waitFor
(
2000
)
}
else
{
await
page
.
waitFor
(
1000
)
}
}
it
(
'
点击fab跳转到添加页
'
,
async
()
=>
{
await
page
.
callMethod
(
'
fabClick
'
)
await
page
.
waitFor
(
'
view
'
)
currentPage
=
await
program
.
currentPage
()
console
.
log
(
'
currentPage
'
,
currentPage
)
expect
(
currentPage
.
path
).
toBe
(
'
pages/user-info/add
'
)
await
program
.
navigateBack
()
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
点击第一条
'
,
async
()
=>
{
await
page
.
waitFor
(
2000
)
const
items
=
await
page
.
$$
(
'
.uni-list-item
'
)
if
(
items
.
length
>
0
)
{
await
items
[
0
].
tap
()
await
waitTime
()
currentPage
=
await
program
.
currentPage
()
console
.
log
(
'
currentPage
'
,
currentPage
)
expect
(
currentPage
.
path
).
toBe
(
'
pages/user-info/detail
'
)
// await program.navigateBack()
// console.log('currentPage', await program.currentPage())
}
else
{
console
.
log
(
'
no items
'
);
}
})
let
page
,
currentPage
;
console
.
log
(
'
uniTestPlatformInfo
'
,
process
.
env
.
uniTestPlatformInfo
)
if
(
process
.
env
.
uniTestPlatformInfo
==
'
ios_simulator 13.7
'
)
{
it
(
'
ios
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
beforeAll
(
async
()
=>
{
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page
=
await
program
.
navigateTo
(
'
/pages/user-info/list
'
)
await
page
.
waitFor
(
'
view
'
)
console
.
log
(
'
process----
'
,
process
.
env
.
UNI_PLATFORM
)
})
async
function
waitTime
()
{
if
(
process
.
env
.
UNI_PLATFORM
==
'
mp-weixin
'
)
{
await
page
.
waitFor
(
2000
)
}
else
{
await
page
.
waitFor
(
1000
)
}
}
it
(
'
点击fab跳转到添加页
'
,
async
()
=>
{
await
page
.
callMethod
(
'
fabClick
'
)
await
page
.
waitFor
(
'
view
'
)
await
waitTime
()
const
jestResult
=
await
page
.
data
(
'
jestResult
'
)
expect
(
jestResult
).
toBe
(
true
)
currentPage
=
await
program
.
currentPage
()
console
.
log
(
'
currentPage
'
,
currentPage
)
expect
(
currentPage
.
path
).
toBe
(
'
pages/user-info/add
'
)
await
program
.
navigateBack
()
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
点击第一条
'
,
async
()
=>
{
await
waitTime
()
const
items
=
await
page
.
$$
(
'
.uni-list-item
'
)
if
(
items
.
length
>
0
)
{
await
items
[
0
].
tap
()
await
waitTime
()
currentPage
=
await
program
.
currentPage
()
console
.
log
(
'
currentPage
'
,
currentPage
)
expect
(
currentPage
.
path
).
toBe
(
'
pages/user-info/detail
'
)
// await program.navigateBack()
// console.log('currentPage', await program.currentPage())
}
else
{
console
.
log
(
'
no items
'
);
}
})
})
\ No newline at end of file
pages/user-info/list.vue
浏览文件 @
c255655a
...
...
@@ -32,7 +32,9 @@
contentdown
:
''
,
contentrefresh
:
''
,
contentnomore
:
''
}
},
// 自动化测试
jestResult
:
false
}
},
onPullDownRefresh
()
{
...
...
@@ -62,7 +64,13 @@
clear
:
true
})
}
}
},
success
:
()
=>
{
this
.
jestResult
=
true
},
fail
:
()
=>
{
this
.
jestResult
=
false
}
})
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录