diff --git a/pages/API/get-current-pages/get-current-pages.test.js b/pages/API/get-current-pages/get-current-pages.test.js index f4b78e342ba0218334f78882ecdf74a40be25dc8..962be6d867f08ca7423378099f7037489c7be62f 100644 --- a/pages/API/get-current-pages/get-current-pages.test.js +++ b/pages/API/get-current-pages/get-current-pages.test.js @@ -1,5 +1,7 @@ const HOME_PAGE_PATH = '/pages/tabBar/component' const PAGE_PATH = '/pages/API/get-current-pages/get-current-pages?test=123' +const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase() +const isAndroid = platformInfo.startsWith('android') describe('getCurrentPages', () => { let page @@ -92,6 +94,6 @@ describe('getCurrentPages', () => { }) it('getAndroidView', async () => { const res = await page.callMethod('checkGetAndroidView') - expect(res).toBe(true) + expect(res).toBe(isAndroid) }) }) diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue index 3e0e3d08e764be6849c8bfe76df880f830149ff2..a81d30e19a9fbc2aaf6c5213421c434ba736ff60 100644 --- a/pages/API/get-current-pages/get-current-pages.uvue +++ b/pages/API/get-current-pages/get-current-pages.uvue @@ -208,12 +208,7 @@ checkGetAndroidView() : boolean { const page = this.getCurrentPage() const androidView = page.getAndroidView() - // #ifdef APP-ANDROID const res = androidView != null - // #endif - // #ifndef APP-ANDROID - const res = androidView == null - // #endif console.log('check getAndroidView', res) uni.showToast(res ? { title: 'check success' } : { title: 'check fail', icon: 'error' }) return res @@ -262,4 +257,4 @@ .radio-value { margin-left: 10px; } - +