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 2256810b2168b62b4e38cce7e220f19bcb6938d4..c048d80025db01e63fc5d09c4d3961bf22c6d318 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 bb2c64b625a6d53b540bfdbec3354c846d5857c7..b059a2380e36c3c1100feae34ba45565dffc2f87 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 f06698919183675c6a0c0b20e2ecbb3767905065..dfc1abf90de6cb65827ef12cfbf93f4818fc80d7 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 381e4ed0c246add5248f0ff5524a8ad31e83ec05..9e0234460722ac882d2cb308f9a81c98c23c7f98 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 ad4bb738525a6507ec19deb8eb9beb0b3e985234..dc7613441c072fff395d6e65825fb2c4425a6282 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 05d96e5df76a51772258414bb994d9b26a0cccd6..3b669085fbeee1f20a29e8b443d81d198d28c947 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 {