From 83407edfe4afa7492fbc031afa6038ea5ad1743d Mon Sep 17 00:00:00 2001 From: wangjinxin613 <1749574663@qq.com> Date: Wed, 3 Apr 2024 18:05:32 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E8=B0=83=E6=95=B4=20ios=20=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=88=A4=E6=96=AD=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../keep-alive/keep-alive.test.js | 2 +- .../teleport/teleport.test.js | 20 +++++++++---------- .../basic/define-props/define-props.test.js | 6 +++--- .../watch-effect/watch-effect.test.js | 10 +++++----- .../watch-post-effect.test.js | 12 +++++------ .../watch-sync-effect.test.js | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pages/built-in-component/keep-alive/keep-alive.test.js b/pages/built-in-component/keep-alive/keep-alive.test.js index 2256810..c048d80 100644 --- a/pages/built-in-component/keep-alive/keep-alive.test.js +++ b/pages/built-in-component/keep-alive/keep-alive.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/built-in-component/keep-alive/keep-alive' describe('keep-alive', () => { - if(process.env.uniTestPlatformInfo.startsWith('IOS')){ + if(process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')){ it("IOS platform not support", async () => { expect(1).toBe(1); }); diff --git a/pages/built-in-component/teleport/teleport.test.js b/pages/built-in-component/teleport/teleport.test.js index bb2c64b..b059a23 100644 --- a/pages/built-in-component/teleport/teleport.test.js +++ b/pages/built-in-component/teleport/teleport.test.js @@ -1,22 +1,22 @@ -const PAGE_PATH = '/pages/built-in-component/teleport/teleport' +const PAGE_PATH = '/pages/built-in-component/teleport/teleport' describe('teleport', () => { - if(process.env.uniTestPlatformInfo.startsWith('IOS')){ + if(process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')){ it("IOS platform not support", async () => { expect(1).toBe(1); }); return } - - let page = null - beforeAll(async () => { - page = await program.reLaunch(PAGE_PATH) - await page.waitFor('view') - }) + + let page = null + beforeAll(async () => { + page = await program.reLaunch(PAGE_PATH) + await page.waitFor('view') + }) it('teleport', async () => { await page.waitFor(500) const image = await program.screenshot(); expect(image).toMatchImageSnapshot(); - }) -}) + }) +}) diff --git a/pages/composition-api/basic/define-props/define-props.test.js b/pages/composition-api/basic/define-props/define-props.test.js index f066989..dfc1abf 100644 --- a/pages/composition-api/basic/define-props/define-props.test.js +++ b/pages/composition-api/basic/define-props/define-props.test.js @@ -20,8 +20,8 @@ describe('defineProps', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await arrayLiteralObj.text()).toBe('obj: {"arr":[1,2,3],"num":0,"str":"obj str"}') } - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('IOS')) { - expect(await arrayLiteralObj.text()).toBe('obj: {"str":"obj str","num":0,"arr":[1,2,3]}') + if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { + expect(await arrayLiteralObj.text()).toBe('obj: {"str":"obj str","num":0,"arr":[1,2,3]}') } const arrayLiteralFn = await page.$('#array-literal-fn') @@ -55,7 +55,7 @@ describe('defineProps', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await typeObj.text()).toBe('obj: {"arr":[1,2,3],"num":0,"str":"obj str"}') } - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('IOS')) { + if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await typeObj.text()).toBe('obj: {"str":"obj str","num":0,"arr":[1,2,3]}') } const typeFn = await page.$('#type-fn') diff --git a/pages/composition-api/reactivity/watch-effect/watch-effect.test.js b/pages/composition-api/reactivity/watch-effect/watch-effect.test.js index 381e4ed..9e02344 100644 --- a/pages/composition-api/reactivity/watch-effect/watch-effect.test.js +++ b/pages/composition-api/reactivity/watch-effect/watch-effect.test.js @@ -17,8 +17,8 @@ describe('watchEffect', () => { // track const watchCountTrackNum = await page.$('#watch-count-track-num') if (process.env.uniTestPlatformInfo.startsWith('android')) { - expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { // TODO: 确认 IOS 的差异是否正常 expect(await watchCountTrackNum.text()).toBe('watch count track number: 11') } else { @@ -41,7 +41,7 @@ describe('watchEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 19') } else { expect(await watchCountTrackNum.text()).toBe('watch count track number: 9') @@ -59,7 +59,7 @@ describe('watchEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 27') } else { expect(await watchCountTrackNum.text()).toBe('watch count track number: 12') @@ -80,7 +80,7 @@ describe('watchEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 27') } else { expect(await watchCountTrackNum.text()).toBe('watch count track number: 12') diff --git a/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js b/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js index ad4bb73..dc76134 100644 --- a/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js +++ b/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/watch-post-effect/watch-post-effect' -describe('watchPostEffect', () => { - const isWeb = process.env.uniTestPlatformInfo.startsWith('web') +describe('watchPostEffect', () => { + const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) @@ -20,7 +20,7 @@ describe('watchPostEffect', () => { const watchCountTrackNum = await page.$('#watch-count-track-num') if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { // TODO: 确认 IOS 的差异是否正常 expect(await watchCountTrackNum.text()).toBe('watch count track number: 8') } else { @@ -45,7 +45,7 @@ describe('watchPostEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 16') } else { expect(await watchCountTrackNum.text()).toBe('watch count track number: 6') @@ -63,7 +63,7 @@ describe('watchPostEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 24') } else { expect(await watchCountTrackNum.text()).toBe('watch count track number: 9') @@ -85,7 +85,7 @@ describe('watchPostEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 24') } else { expect(await watchCountTrackNum.text()).toBe('watch count track number: 9') diff --git a/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect.test.js b/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect.test.js index 05d96e5..3b66908 100644 --- a/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect.test.js +++ b/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect.test.js @@ -19,7 +19,7 @@ describe('watchSyncEffect', () => { const watchCountTrackNum = await page.$('#watch-count-track-num') if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { // TODO: 确认 IOS 的差异是否正常 expect(await watchCountTrackNum.text()).toBe('watch count track number: 11') } else { @@ -42,7 +42,7 @@ describe('watchSyncEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { // TODO: 确认 IOS 的差异是否正常 expect(await watchCountTrackNum.text()).toBe('watch count track number: 19') } else { @@ -61,7 +61,7 @@ describe('watchSyncEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { // TODO: 确认 IOS 的差异是否正常 expect(await watchCountTrackNum.text()).toBe('watch count track number: 27') } else { @@ -84,7 +84,7 @@ describe('watchSyncEffect', () => { if (process.env.uniTestPlatformInfo.startsWith('android')) { expect(await watchCountTrackNum.text()).toBe('watch count track number: 3') - } else if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + } else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { // TODO: 确认 IOS 的差异是否正常 expect(await watchCountTrackNum.text()).toBe('watch count track number: 27') } else { -- GitLab