From d614ed3eeefe8b52b15a653555b82830448a8586 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Fri, 14 Jun 2024 19:32:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0media=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 --- .../API/compress-image/compress-image.test.js | 2 +- .../API/compress-video/compress-video.test.js | 2 +- .../API/get-image-info/get-image-info.test.js | 2 +- .../API/get-video-info/get-video-info.test.js | 26 +++++++++++-------- .../save-image-to-photos-album.test.js | 2 +- .../save-video-to-photos-album.test.js | 2 +- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/pages/API/compress-image/compress-image.test.js b/pages/API/compress-image/compress-image.test.js index e647dd4c..15477b13 100644 --- a/pages/API/compress-image/compress-image.test.js +++ b/pages/API/compress-image/compress-image.test.js @@ -1,6 +1,6 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-compressImage', () => { - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('ios')) { + if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { it('pass', async () => { expect(1).toBe(1); }); diff --git a/pages/API/compress-video/compress-video.test.js b/pages/API/compress-video/compress-video.test.js index a80a04e4..9afa4633 100644 --- a/pages/API/compress-video/compress-video.test.js +++ b/pages/API/compress-video/compress-video.test.js @@ -1,6 +1,6 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-compressVideo', () => { - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('ios')) { + if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { it('pass', async () => { expect(1).toBe(1); }); diff --git a/pages/API/get-image-info/get-image-info.test.js b/pages/API/get-image-info/get-image-info.test.js index 387a6852..13fc83d5 100644 --- a/pages/API/get-image-info/get-image-info.test.js +++ b/pages/API/get-image-info/get-image-info.test.js @@ -1,6 +1,6 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-getImageInfo', () => { - if (process.env.uniTestPlatformInfo.startsWith('ios')) { + if (process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { it('pass', async () => { expect(1).toBe(1); }); diff --git a/pages/API/get-video-info/get-video-info.test.js b/pages/API/get-video-info/get-video-info.test.js index c9d4fc25..c7c9fc55 100644 --- a/pages/API/get-video-info/get-video-info.test.js +++ b/pages/API/get-video-info/get-video-info.test.js @@ -1,6 +1,6 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-getVideoInfo', () => { - if (process.env.uniTestPlatformInfo.startsWith('ios')) { + if (process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { it('pass', async () => { expect(1).toBe(1); }); @@ -25,15 +25,19 @@ describe('API-getVideoInfo', () => { }); return; } - expect(await page.data('videoInfoForTest')).toEqual({ - orientation: 'up', - type: 'video/mp4', - duration: 10, - size: 211, - width: 1280, - height: 720, - fps: 30, - bitrate: 172 - }); + const infos = process.env.uniTestPlatformInfo.split(' '); + const version = parseInt(infos[infos.length - 1]); + if (process.env.uniTestPlatformInfo.startsWith('android') && version > 5) { + expect(await page.data('videoInfoForTest')).toEqual({ + orientation: 'up', + type: 'video/mp4', + duration: 10, + size: 211, + width: 1280, + height: 720, + fps: 30, + bitrate: 172 + }); + } }); }); diff --git a/pages/API/save-image-to-photos-album/save-image-to-photos-album.test.js b/pages/API/save-image-to-photos-album/save-image-to-photos-album.test.js index 4cd0748b..46e34fcf 100644 --- a/pages/API/save-image-to-photos-album/save-image-to-photos-album.test.js +++ b/pages/API/save-image-to-photos-album/save-image-to-photos-album.test.js @@ -1,6 +1,6 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-saveImageToPhotosAlbum', () => { - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('ios')) { + if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { it('pass', async () => { expect(1).toBe(1); }); diff --git a/pages/API/save-video-to-photos-album/save-video-to-photos-album.test.js b/pages/API/save-video-to-photos-album/save-video-to-photos-album.test.js index a0be43e5..69f46b20 100644 --- a/pages/API/save-video-to-photos-album/save-video-to-photos-album.test.js +++ b/pages/API/save-video-to-photos-album/save-video-to-photos-album.test.js @@ -1,6 +1,6 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-saveVideoToPhotosAlbum', () => { - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('ios')) { + if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { it('pass', async () => { expect(1).toBe(1); }); -- GitLab