From 933ff76de630bdd38552a643e3c105407a442872 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Thu, 11 Jul 2024 16:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0video=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/video/video.test.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pages/component/video/video.test.js b/pages/component/video/video.test.js index a49e5813..15967b3a 100644 --- a/pages/component/video/video.test.js +++ b/pages/component/video/video.test.js @@ -125,22 +125,20 @@ describe('component-native-video', () => { fullScreen: true, 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 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); }); - const infos = process.env.uniTestPlatformInfo.split(' '); - const version = parseInt(infos[infos.length - 1]); - if (version > 5) { // android5.1模拟器全屏时会弹出系统提示框,无法响应adb tap命令 - expect(await page.data('eventControlstoggle')).toEqual({ - tagName: 'VIDEO', - type: 'controlstoggle', - show: true - }); - } + expect(await page.data('eventControlstoggle')).toEqual({ + tagName: 'VIDEO', + type: 'controlstoggle', + show: true + }); const res = await program.adbCommand('wm size'); const width = res.data.split(' ').at(-1).split('x')[0]; const height = res.data.split(' ').at(-1).split('x')[1]; -- GitLab