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

更新video自动化测试用例

上级 c317a117
...@@ -125,22 +125,20 @@ describe('component-native-video', () => { ...@@ -125,22 +125,20 @@ describe('component-native-video', () => {
fullScreen: true, fullScreen: true,
direction: 'horizontal' direction: 'horizontal'
}); });
if (process.env.uniTestPlatformInfo.startsWith('android')) { const infos = process.env.uniTestPlatformInfo.split(' ');
const version = parseInt(infos[infos.length - 1]);
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('eventControlstoggle')) && (await page.data('eventFullscreenclick')) || (Date.now() - start > 500); return (await page.data('eventControlstoggle')) && (await page.data('eventFullscreenclick')) || (Date.now() - start > 500);
}); });
const infos = process.env.uniTestPlatformInfo.split(' '); expect(await page.data('eventControlstoggle')).toEqual({
const version = parseInt(infos[infos.length - 1]); tagName: 'VIDEO',
if (version > 5) { // android5.1模拟器全屏时会弹出系统提示框,无法响应adb tap命令 type: 'controlstoggle',
expect(await page.data('eventControlstoggle')).toEqual({ show: true
tagName: 'VIDEO', });
type: 'controlstoggle',
show: true
});
}
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];
const height = res.data.split(' ').at(-1).split('x')[1]; const height = res.data.split(' ').at(-1).split('x')[1];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册