提交 ebca2fba 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新video自动化测试用例

上级 3016e52f
jest.setTimeout(60000);
describe('component-native-video', () => { describe('component-native-video', () => {
if(process.env.uniTestPlatformInfo.startsWith('web')){ if(process.env.uniTestPlatformInfo.startsWith('web')){
// TODO: web 端暂不支持测试 // TODO: web 端暂不支持测试
...@@ -138,12 +139,12 @@ describe('component-native-video', () => { ...@@ -138,12 +139,12 @@ describe('component-native-video', () => {
}); });
const infos = process.env.uniTestPlatformInfo.split(' '); const infos = process.env.uniTestPlatformInfo.split(' ');
const version = parseInt(infos[infos.length - 1]); const version = parseInt(infos[infos.length - 1]);
if (process.env.uniTestPlatformInfo.startsWith('android') && process.env.android_cpu_type != 'x86' && process.env.android_cpu_type != 'x86_64' && version > 5) { // android5.1模拟器全屏时会弹出系统提示框,无法响应adb tap命令 if (process.env.uniTestPlatformInfo.startsWith('android') && version > 5) { // android5.1模拟器全屏时会弹出系统提示框,无法响应adb tap命令
await page.waitFor(5000); await page.waitFor(5000);
await program.adbCommand('input tap 10 10'); await program.adbCommand('input tap 10 10');
start = Date.now(); start = Date.now();
await page.waitFor(async () => { await page.waitFor(async () => {
return (await page.data('eventFullscreenclick')) || (Date.now() - start > 500); return (await page.data('eventFullscreenclick')) || (Date.now() - start > 1000);
}); });
const res = await program.adbCommand('wm size'); const res = await program.adbCommand('wm size');
const width = res.data.split(' ').at(-1).split('x')[0]; const width = res.data.split(' ').at(-1).split('x')[0];
...@@ -169,7 +170,7 @@ describe('component-native-video', () => { ...@@ -169,7 +170,7 @@ describe('component-native-video', () => {
await page.callMethod('seek', 120); await page.callMethod('seek', 120);
start = Date.now(); start = Date.now();
await page.waitFor(async () => { await page.waitFor(async () => {
return (await page.data('eventEnded')) || (Date.now() - start > 5000); return (await page.data('eventEnded')) || (Date.now() - start > 30000);
}); });
expect(await page.data('eventEnded')).toEqual({ expect(await page.data('eventEnded')).toEqual({
tagName: 'VIDEO', tagName: 'VIDEO',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册