From 17015846f6eb7a3648804d4f1f951122ccde714a Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Sat, 7 Dec 2024 13:22:45 +0800 Subject: [PATCH] =?UTF-8?q?test(chooseLocation):=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=92=E4=BB=B6=E8=A7=84=E9=81=BF?= =?UTF-8?q?=20ios=2015=E4=BB=A5=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../choose-location/choose-location.test.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pages/API/choose-location/choose-location.test.js b/pages/API/choose-location/choose-location.test.js index 7277edf8..3b7761af 100644 --- a/pages/API/choose-location/choose-location.test.js +++ b/pages/API/choose-location/choose-location.test.js @@ -38,14 +38,20 @@ describe('dialog page', () => { expect(lifecycleNum).toBe(originLifeCycleNum - 1) }) if (isIos) { - it('call chooseLocation in uts plugin', async () => { - page = await program.reLaunch('/pages/API/choose-location/choose-location') - await page.waitFor('view'); - await page.callMethod('chooseLocationByPlugin') - await page.waitFor(1000) - const lifecycleNum = await page.callMethod('getLifeCycleNum') - expect(lifecycleNum).toBe(originLifeCycleNum - 1) - }) + // 15以下的模拟器所对应的xcode不能编译自定义插件,大于15是因为某台设备,会用xcode14.1跑15.5的设备 + let version = process.env.uniTestPlatformInfo + let split = version.split(" ") + version = parseInt(split[split.length - 1]) + if (version > 15) { + it('call chooseLocation in uts plugin', async () => { + page = await program.reLaunch('/pages/API/choose-location/choose-location') + await page.waitFor('view'); + await page.callMethod('chooseLocationByPlugin') + await page.waitFor(1000) + const lifecycleNum = await page.callMethod('getLifeCycleNum') + expect(lifecycleNum).toBe(originLifeCycleNum - 1) + }) + } } afterAll(async () => { -- GitLab