Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
24bb0478
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5977
Star
89
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
24bb0478
编写于
7月 22, 2024
作者:
DCloud-yinjiacheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新video自动化测试用例
上级
ce0f4b5e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
22 deletion
+18
-22
pages/component/video/video.test.js
pages/component/video/video.test.js
+16
-16
pages/component/video/video.uvue
pages/component/video/video.uvue
+2
-6
未找到文件。
pages/component/video/video.test.js
浏览文件 @
24bb0478
...
...
@@ -35,23 +35,21 @@ describe('component-native-video', () => {
autoTest
:
true
,
isError
:
false
});
const
oldSrc
=
await
page
.
data
(
'
src
'
);
await
page
.
callMethod
(
'
downloadSource
'
);
await
page
.
waitFor
(
5000
);
expect
(
await
page
.
data
(
'
isError
'
)).
toBe
(
false
);
await
page
.
setData
({
localS
rc
:
'
/static/test-video/2minute-demo.m3u8
'
s
rc
:
'
/static/test-video/2minute-demo.m3u8
'
});
await
page
.
waitFor
(
100
);
expect
(
await
page
.
data
(
'
isError
'
)).
toBe
(
false
);
await
page
.
setData
({
autoTest
:
false
src
:
oldSrc
});
});
it
(
'
test event play pause
'
,
async
()
=>
{
await
page
.
setData
({
autoTest
:
true
});
it
(
'
test event play pause controlstoggle
'
,
async
()
=>
{
await
page
.
callMethod
(
'
play
'
);
start
=
Date
.
now
();
await
page
.
waitFor
(
async
()
=>
{
...
...
@@ -67,7 +65,6 @@ describe('component-native-video', () => {
type
:
'
play
'
});
}
await
page
.
callMethod
(
'
pause
'
);
start
=
Date
.
now
();
await
page
.
waitFor
(
async
()
=>
{
...
...
@@ -83,8 +80,16 @@ describe('component-native-video', () => {
type
:
'
pause
'
});
}
await
page
.
callMethod
(
'
play
'
);
start
=
Date
.
now
();
await
page
.
waitFor
(
async
()
=>
{
return
(
await
page
.
data
(
'
eventControlstoggle
'
))
||
(
Date
.
now
()
-
start
>
500
);
});
expect
(
await
page
.
data
(
'
eventControlstoggle
'
)).
toEqual
({
tagName
:
'
VIDEO
'
,
type
:
'
controlstoggle
'
,
show
:
true
});
});
it
(
'
test event waiting progress
'
,
async
()
=>
{
...
...
@@ -110,7 +115,7 @@ describe('component-native-video', () => {
});
});
it
(
'
test event fullscreenchange
controlstoggle
fullscreenclick
'
,
async
()
=>
{
it
(
'
test event fullscreenchange fullscreenclick
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
return
;
}
...
...
@@ -132,12 +137,7 @@ describe('component-native-video', () => {
await
program
.
adbCommand
(
'
input tap 10 10
'
);
start
=
Date
.
now
();
await
page
.
waitFor
(
async
()
=>
{
return
(
await
page
.
data
(
'
eventControlstoggle
'
))
&&
(
await
page
.
data
(
'
eventFullscreenclick
'
))
||
(
Date
.
now
()
-
start
>
500
);
});
expect
(
await
page
.
data
(
'
eventControlstoggle
'
)).
toEqual
({
tagName
:
'
VIDEO
'
,
type
:
'
controlstoggle
'
,
show
:
true
return
(
await
page
.
data
(
'
eventFullscreenclick
'
))
||
(
Date
.
now
()
-
start
>
500
);
});
const
res
=
await
program
.
adbCommand
(
'
wm size
'
);
const
width
=
res
.
data
.
split
(
'
'
).
at
(
-
1
).
split
(
'
x
'
)[
0
];
...
...
@@ -166,7 +166,7 @@ describe('component-native-video', () => {
await
page
.
callMethod
(
'
seek
'
);
start
=
Date
.
now
();
await
page
.
waitFor
(
async
()
=>
{
return
(
await
page
.
data
(
'
eventEnded
'
))
||
(
Date
.
now
()
-
start
>
3
000
);
return
(
await
page
.
data
(
'
eventEnded
'
))
||
(
Date
.
now
()
-
start
>
5
000
);
});
expect
(
await
page
.
data
(
'
eventEnded
'
)).
toEqual
({
tagName
:
'
VIDEO
'
,
...
...
pages/component/video/video.uvue
浏览文件 @
24bb0478
...
...
@@ -82,7 +82,6 @@
<enum-data title="设置解码器(仅 App 平台,播放前设置有效)" :items="codecItemTypes" @change="onCodecChange"></enum-data>
<enum-data title="设置播放策略(仅 App 平台,播放前设置有效)" :items="playStrategyItemTypes" @change="onPlayStrategyChange"></enum-data>
</scroll-view>
<video v-if="autoTest" :src="localSrc" @error="onError"></video>
</view>
</template>
...
...
@@ -160,9 +159,7 @@
} as UTSJSONObject,
// API
pos: 0,
requestFullScreenOptions: {
direction: -90
} as RequestFullScreenOptions,
requestFullScreenOptions: null as RequestFullScreenOptions | null,
danmu: {
text: '要显示的文本',
color: '#FF0000'
...
...
@@ -175,7 +172,6 @@
isPlaying: false,
isPause: false,
isError: false,
localSrc: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4',
eventPlay: null as UTSJSONObject | null,
eventPause: null as UTSJSONObject | null,
eventEnded: null as UTSJSONObject | null,
...
...
@@ -480,7 +476,7 @@
uni.downloadFile({
url: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4',
success: (res) => {
this.
localS
rc = res.tempFilePath;
this.
s
rc = res.tempFilePath;
},
fail: (_) => {
this.isError = true;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录