From 3e8e256ea60de0fae0a68f6c6d54fe026d3d02ae Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 25 Jan 2024 22:05:27 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BE=8B=E5=85=BC=E5=AE=B9=20web=20safari?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component-instance/props/props.test.js | 2 +- .../composition-api/basic/define-props/define-props.test.js | 3 +-- .../composition-api/basic/define-slots/define-slots.test.js | 4 ++-- pages/composition-api/basic/use-slots/use-slots.test.js | 4 ++-- .../dependency-injection/provide/provide-inject.test.js | 4 ++-- .../component-lifecycle/component-lifecycle.test.js | 2 +- pages/composition-api/reactivity/computed/computed.test.js | 4 ++-- pages/composition-api/reactivity/reactive/reactive.test.js | 4 ++-- pages/composition-api/reactivity/readonly/readonly.test.js | 4 ++-- .../reactivity/watch-effect/watch-effect.test.js | 2 +- .../reactivity/watch-post-effect/watch-post-effect.test.js | 4 ++-- .../reactivity/watch-sync-effect/watch-sync-effect.test.js | 4 ++-- pages/composition-api/reactivity/watch/watch.test.js | 4 ++-- pages/composition/provide/provide-page2.test.js | 4 ++-- pages/composition/provide/provide.test.js | 6 +++--- 15 files changed, 27 insertions(+), 28 deletions(-) diff --git a/pages/component-instance/props/props.test.js b/pages/component-instance/props/props.test.js index a75a02a..102f37f 100644 --- a/pages/component-instance/props/props.test.js +++ b/pages/component-instance/props/props.test.js @@ -2,7 +2,7 @@ const PAGE_PATH = '/pages/component-instance/props/props' describe('$props', () => { const isWeb = process.env.uniTestPlatformInfo.startsWith('web') - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) 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 49f8bc5..f9dea0b 100644 --- a/pages/composition-api/basic/define-props/define-props.test.js +++ b/pages/composition-api/basic/define-props/define-props.test.js @@ -1,8 +1,7 @@ const PAGE_PATH = '/pages/composition-api/basic/define-props/define-props' describe('defineProps', () => { - console.log('process.env.uniTestPlatformInfo---------------', process.env.uniTestPlatformInfo) - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) diff --git a/pages/composition-api/basic/define-slots/define-slots.test.js b/pages/composition-api/basic/define-slots/define-slots.test.js index 6832cc8..6d79121 100644 --- a/pages/composition-api/basic/define-slots/define-slots.test.js +++ b/pages/composition-api/basic/define-slots/define-slots.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/basic/define-slots/define-slots' -describe('defineSlots', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('defineSlots', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) diff --git a/pages/composition-api/basic/use-slots/use-slots.test.js b/pages/composition-api/basic/use-slots/use-slots.test.js index 2dab503..f25aeb5 100644 --- a/pages/composition-api/basic/use-slots/use-slots.test.js +++ b/pages/composition-api/basic/use-slots/use-slots.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/basic/use-slots/use-slots' -describe('useSlots', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('useSlots', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) diff --git a/pages/composition-api/dependency-injection/provide/provide-inject.test.js b/pages/composition-api/dependency-injection/provide/provide-inject.test.js index f9031a0..0c1a449 100644 --- a/pages/composition-api/dependency-injection/provide/provide-inject.test.js +++ b/pages/composition-api/dependency-injection/provide/provide-inject.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/dependency-injection/provide/provide' -describe('provide-inject-hasInjectionContext', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('provide-inject-hasInjectionContext', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page = null beforeAll(async () => { diff --git a/pages/composition-api/lifecycle/component-lifecycle/component-lifecycle.test.js b/pages/composition-api/lifecycle/component-lifecycle/component-lifecycle.test.js index 31f6971..5cb18a7 100644 --- a/pages/composition-api/lifecycle/component-lifecycle/component-lifecycle.test.js +++ b/pages/composition-api/lifecycle/component-lifecycle/component-lifecycle.test.js @@ -44,7 +44,7 @@ describe('component-lifecycle', () => { }) it('onPageScroll onReachBottom', async () => { await program.pageScrollTo(2000) - // web 端组件内监听 onPageScroll onReachBottom 不触发 + // TODO: web 端组件内监听 onPageScroll onReachBottom 不触发 if (process.env.uniTestPlatformInfo.startsWith('android')) { const isScrolled = await page.callMethod('getIsScrolled') expect(isScrolled).toBe(true) diff --git a/pages/composition-api/reactivity/computed/computed.test.js b/pages/composition-api/reactivity/computed/computed.test.js index c64b307..1bad339 100644 --- a/pages/composition-api/reactivity/computed/computed.test.js +++ b/pages/composition-api/reactivity/computed/computed.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/computed/computed' -describe('computed', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('computed', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) diff --git a/pages/composition-api/reactivity/reactive/reactive.test.js b/pages/composition-api/reactivity/reactive/reactive.test.js index 242f47e..61b9b9f 100644 --- a/pages/composition-api/reactivity/reactive/reactive.test.js +++ b/pages/composition-api/reactivity/reactive/reactive.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/reactive/reactive' -describe('reactive', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('reactive', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) diff --git a/pages/composition-api/reactivity/readonly/readonly.test.js b/pages/composition-api/reactivity/readonly/readonly.test.js index 8ef249a..3648cad 100644 --- a/pages/composition-api/reactivity/readonly/readonly.test.js +++ b/pages/composition-api/reactivity/readonly/readonly.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/readonly/readonly' -describe('ref', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('ref', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) 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 e9c4a49..18979ed 100644 --- a/pages/composition-api/reactivity/watch-effect/watch-effect.test.js +++ b/pages/composition-api/reactivity/watch-effect/watch-effect.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/watch-effect/watch-effect' describe('watchEffect', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) 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 58bdf98..ca1370a 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 isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('watchPostEffect', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page = null beforeAll(async () => { 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 a72e32a..18b99ee 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 @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect' -describe('watchSyncEffect', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('watchSyncEffect', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page = null beforeAll(async () => { diff --git a/pages/composition-api/reactivity/watch/watch.test.js b/pages/composition-api/reactivity/watch/watch.test.js index b4c3aab..16778c6 100644 --- a/pages/composition-api/reactivity/watch/watch.test.js +++ b/pages/composition-api/reactivity/watch/watch.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/watch/watch' -describe('watch', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('watch', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) diff --git a/pages/composition/provide/provide-page2.test.js b/pages/composition/provide/provide-page2.test.js index a8c4285..4876bbe 100644 --- a/pages/composition/provide/provide-page2.test.js +++ b/pages/composition/provide/provide-page2.test.js @@ -1,6 +1,6 @@ const PAGE_PATH = '/pages/composition/provide/provide-page2' -describe('函数方式创建 provide', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('函数方式创建 provide', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page beforeAll(async () => { diff --git a/pages/composition/provide/provide.test.js b/pages/composition/provide/provide.test.js index 718779f..6c31863 100644 --- a/pages/composition/provide/provide.test.js +++ b/pages/composition/provide/provide.test.js @@ -1,6 +1,6 @@ const PAGE_PATH = '/pages/composition/provide/provide' -describe('字面量方式创建 provide', () => { - const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 +describe('字面量方式创建 provide', () => { + const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page beforeAll(async () => { @@ -50,7 +50,7 @@ describe('字面量方式创建 provide', () => { }) it('array', async () => { const providePageArrEl = await page.$('.provide-page-arr') - const providePageArrText = await providePageArrEl.text() + const providePageArrText = await providePageArrEl.text() expect(providePageArrText).toBe( isSafari ? 'providePageArr: [ "字面量方式定义 provide page arr"]' : 'providePageArr: ["字面量方式定义 provide page arr"]' ) -- GitLab