Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
f478a4f7
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
367
Star
3
Fork
8
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uvue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f478a4f7
编写于
4月 28, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(ios): 针对 ios 优化测试例
上级
616cec6e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
13 deletion
+33
-13
pages/composition-api/reactivity/effect-scope/effect-scope.test.js
...position-api/reactivity/effect-scope/effect-scope.test.js
+14
-5
pages/composition-api/reactivity/watch-effect/watch-effect.test.js
...position-api/reactivity/watch-effect/watch-effect.test.js
+19
-8
未找到文件。
pages/composition-api/reactivity/effect-scope/effect-scope.test.js
浏览文件 @
f478a4f7
const
PAGE_PATH
=
'
/pages/composition-api/reactivity/effect-scope/effect-scope
'
const
PAGE_PATH
=
'
/pages/composition-api/reactivity/effect-scope/effect-scope
'
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
()
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
describe
(
'
effectScope
'
,
()
=>
{
const
isWeb
=
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)
describe
(
'
effectScope
'
,
()
=>
{
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
()
const
isWeb
=
platformInfo
.
startsWith
(
'
web
'
)
let
page
=
null
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
...
...
@@ -18,7 +21,10 @@ describe('effectScope', () => {
expect
(
await
watchEffectCounterRes
.
text
()).
toBe
(
'
watchEffect counter result: counter: 0
'
)
const
incrementCounterBtn
=
await
page
.
$
(
'
#increment-counter-btn
'
)
await
incrementCounterBtn
.
tap
()
await
incrementCounterBtn
.
tap
()
if
(
isIos
){
await
page
.
waitFor
(
200
)
}
expect
(
await
counter
.
text
()).
toBe
(
'
counter: 1
'
)
expect
(
await
watchCounterRes
.
text
()).
toBe
(
'
watch counter result: newVal: 1, oldVal: 0
'
)
...
...
@@ -27,7 +33,10 @@ describe('effectScope', () => {
const
stopEffectScopeBtn
=
await
page
.
$
(
'
#stop-effect-scope-btn
'
)
await
stopEffectScopeBtn
.
tap
()
await
incrementCounterBtn
.
tap
()
await
incrementCounterBtn
.
tap
()
if
(
isIos
){
await
page
.
waitFor
(
200
)
}
expect
(
await
counter
.
text
()).
toBe
(
'
counter: 2
'
)
expect
(
await
watchCounterRes
.
text
()).
toBe
(
'
watch counter result: newVal: 1, oldVal: 0
'
)
...
...
pages/composition-api/reactivity/watch-effect/watch-effect.test.js
浏览文件 @
f478a4f7
const
PAGE_PATH
=
'
/pages/composition-api/reactivity/watch-effect/watch-effect
'
const
PAGE_PATH
=
'
/pages/composition-api/reactivity/watch-effect/watch-effect
'
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
()
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
describe
(
'
watchEffect
'
,
()
=>
{
let
page
=
null
...
...
@@ -18,7 +20,7 @@ describe('watchEffect', () => {
const
watchCountTrackNum
=
await
page
.
$
(
'
#watch-count-track-num
'
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 3
'
)
}
else
if
(
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
().
startsWith
(
'
ios
'
)
)
{
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 11
'
)
}
else
{
...
...
@@ -33,7 +35,10 @@ describe('watchEffect', () => {
expect
(
await
watchCountAndObjNumRes
.
text
()).
toBe
(
'
watch count and obj.num result: count: 0, obj.num: 0
'
)
const
incrementBtn
=
await
page
.
$
(
'
.increment-btn
'
)
await
incrementBtn
.
tap
()
await
incrementBtn
.
tap
()
if
(
isIos
){
await
page
.
waitFor
(
200
)
}
expect
(
await
count
.
text
()).
toBe
(
'
count: 1
'
)
expect
(
await
watchCountRes
.
text
()).
toBe
(
...
...
@@ -41,7 +46,7 @@ describe('watchEffect', () => {
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 3
'
)
}
else
if
(
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
().
startsWith
(
'
ios
'
)
)
{
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 19
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 9
'
)
...
...
@@ -51,7 +56,10 @@ describe('watchEffect', () => {
expect
(
await
watchCountAndObjNumRes
.
text
()).
toBe
(
'
watch count and obj.num result: count: 1, obj.num: 0
'
)
await
incrementBtn
.
tap
()
await
incrementBtn
.
tap
()
if
(
isIos
){
await
page
.
waitFor
(
200
)
}
expect
(
await
count
.
text
()).
toBe
(
'
count: 2
'
)
expect
(
await
watchCountRes
.
text
()).
toBe
(
...
...
@@ -59,7 +67,7 @@ describe('watchEffect', () => {
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 3
'
)
}
else
if
(
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
().
startsWith
(
'
ios
'
)
)
{
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 27
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 12
'
)
...
...
@@ -72,7 +80,10 @@ describe('watchEffect', () => {
const
stopWatchCountBtn
=
await
page
.
$
(
'
.stop-watch-count-btn
'
)
await
stopWatchCountBtn
.
tap
()
await
incrementBtn
.
tap
()
await
incrementBtn
.
tap
()
if
(
isIos
){
await
page
.
waitFor
(
200
)
}
expect
(
await
count
.
text
()).
toBe
(
'
count: 3
'
)
expect
(
await
watchCountRes
.
text
()).
toBe
(
...
...
@@ -80,7 +91,7 @@ describe('watchEffect', () => {
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 3
'
)
}
else
if
(
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
().
startsWith
(
'
ios
'
)
)
{
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 27
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
watch count track number: 12
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录