Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
fcc62a75
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fcc62a75
编写于
7月 02, 2024
作者:
lizhongyi_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整部分组件测试例
(cherry picked from commit
d72aa828
)
上级
ffaa3a88
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
98 addition
and
43 deletion
+98
-43
pages/component/image/image.test.js
pages/component/image/image.test.js
+22
-7
pages/component/list-view/list-view.test.js
pages/component/list-view/list-view.test.js
+5
-5
pages/component/video/video.test.js
pages/component/video/video.test.js
+31
-8
pages/component/web-view-local/web-view-local.test.js
pages/component/web-view-local/web-view-local.test.js
+10
-10
pages/component/web-view/web-view.test.js
pages/component/web-view/web-view.test.js
+30
-13
未找到文件。
pages/component/image/image.test.js
浏览文件 @
fcc62a75
...
...
@@ -76,6 +76,14 @@ describe('component-native-image', () => {
imageSrc
:
'
https://request.dcloud.net.cn/api/http/contentType/image/png
'
});
await
page
.
waitFor
(
1000
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventLoad
'
)).
toEqual
({
type
:
'
load
'
,
width
:
10
,
height
:
10
});
return
}
expect
(
await
page
.
data
(
'
eventLoad
'
)).
toEqual
({
tagName
:
'
IMAGE
'
,
type
:
'
load
'
,
...
...
@@ -89,10 +97,17 @@ describe('component-native-image', () => {
imageSrc
:
'
https://request.dcloud.net.cn/api/http/contentType/404.png
'
});
await
page
.
waitFor
(
500
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventError
'
)).
toEqual
({
type
:
'
error
'
});
}
else
{
expect
(
await
page
.
data
(
'
eventError
'
)).
toEqual
({
tagName
:
'
IMAGE
'
,
type
:
'
error
'
});
}
await
page
.
setData
({
autoTest
:
false
});
...
...
pages/component/list-view/list-view.test.js
浏览文件 @
fcc62a75
...
...
@@ -75,12 +75,16 @@ describe('component-native-list-view', () => {
return
}
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
return
}
it
(
'
Event scrollend-滚动结束时触发
'
,
async
()
=>
{
// 仅App端支持,向上滑动页面
await
program
.
swipe
({
startPoint
:
{
x
:
100
,
y
:
300
},
endPoint
:
{
x
:
100
,
y
:
100
},
duration
:
100
0
duration
:
100
})
await
page
.
waitFor
(
600
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
...
...
@@ -94,10 +98,6 @@ describe('component-native-list-view', () => {
// expect(endDetail.scrollWidth).toBeGreaterThan(0)
})
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
return
}
//检测竖向可滚动区域
it
(
'
check_scroll_height
'
,
async
()
=>
{
await
page
.
callMethod
(
'
change_scroll_y_boolean
'
,
true
)
...
...
pages/component/video/video.test.js
浏览文件 @
fcc62a75
...
...
@@ -53,20 +53,37 @@ describe('component-native-video', () => {
});
await
page
.
callMethod
(
'
play
'
);
await
page
.
waitFor
(
100
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventPlay
'
)).
toEqual
({
type
:
'
play
'
});
}
else
{
expect
(
await
page
.
data
(
'
eventPlay
'
)).
toEqual
({
tagName
:
'
VIDEO
'
,
type
:
'
play
'
});
}
await
page
.
callMethod
(
'
pause
'
);
await
page
.
waitFor
(
100
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventPause
'
)).
toEqual
({
type
:
'
pause
'
});
}
else
{
expect
(
await
page
.
data
(
'
eventPause
'
)).
toEqual
({
tagName
:
'
VIDEO
'
,
type
:
'
pause
'
});
}
await
page
.
callMethod
(
'
play
'
);
});
it
(
'
test event waiting progress timeupdate
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
return
}
await
page
.
setData
({
pos
:
10
});
...
...
@@ -140,6 +157,9 @@ describe('component-native-video', () => {
});
it
(
'
test event ended
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
return
}
await
page
.
setData
({
pos
:
120
});
...
...
@@ -152,6 +172,9 @@ describe('component-native-video', () => {
});
it
(
'
test event error
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
return
}
const
oldSrc
=
await
page
.
data
(
'
src
'
);
await
page
.
setData
({
src
:
'
invalid url
'
...
...
pages/component/web-view-local/web-view-local.test.js
浏览文件 @
fcc62a75
...
...
@@ -29,15 +29,15 @@ describe('component-native-web-view', () => {
await
page
.
callMethod
(
'
testEventDownload
'
);
await
page
.
waitFor
(
500
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventDownload
'
)).
toEqual
({
tagName
:
'
WEB-VIEW
'
,
type
:
'
download
'
,
url
:
'
https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk
'
,
userAgent
:
`uni-app-x/
${
process
.
env
.
HX_Version
.
split
(
'
-
'
)[
0
].
split
(
'
.
'
).
slice
(
0
,
2
).
join
(
'
.
'
)}
`
,
contentDisposition
:
''
,
mimetype
:
'
application/vnd.android.package-archive
'
,
isContentLengthValid
:
true
});
//
expect(await page.data('eventDownload')).toEqual({
//
tagName: 'WEB-VIEW',
//
type: 'download',
//
url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk',
//
userAgent: `uni-app-x/${process.env.HX_Version.split('-')[0].split('.').slice(0, 2).join('.')}`,
//
contentDisposition: '',
//
mimetype: 'application/vnd.android.package-archive',
//
isContentLengthValid: true
//
});
return
;
}
const
infos
=
process
.
env
.
uniTestPlatformInfo
.
split
(
'
'
);
...
...
pages/component/web-view/web-view.test.js
浏览文件 @
fcc62a75
...
...
@@ -18,17 +18,34 @@ describe('component-native-web-view', () => {
});
await
page
.
callMethod
(
'
reload
'
);
await
page
.
waitFor
(
100
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventLoading
'
)).
toEqual
({
type
:
'
loading
'
,
src
:
'
https://www.dcloud.io/
'
});
}
else
{
expect
(
await
page
.
data
(
'
eventLoading
'
)).
toEqual
({
tagName
:
'
WEB-VIEW
'
,
type
:
'
loading
'
,
src
:
'
https://www.dcloud.io/
'
});
}
await
page
.
waitFor
(
1000
);
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
expect
(
await
page
.
data
(
'
eventLoad
'
)).
toEqual
({
tagName
:
'
WEB-VIEW
'
,
type
:
'
load
'
,
src
:
'
https://www.dcloud.io/
'
});
}
else
{
expect
(
await
page
.
data
(
'
eventLoad
'
)).
toEqual
({
tagName
:
'
WEB-VIEW
'
,
type
:
'
load
'
,
src
:
'
https://www.dcloud.io/
'
});
}
});
it
(
'
test event error
'
,
async
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录