diff --git a/pages/API/choose-location/choose-location.test.js b/pages/API/choose-location/choose-location.test.js
index 0c5d08ce7270cab9075baf4755db185a86f8808e..0dc82f5afed761a8033feeded79582c249fb7e7b 100644
--- a/pages/API/choose-location/choose-location.test.js
+++ b/pages/API/choose-location/choose-location.test.js
@@ -1,5 +1,5 @@
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
-isWeixin = platformInfo == 'mp-weixin'
+const isMP = platformInfo.startsWith('mp')
describe('dialog page', () => {
if (process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
@@ -8,8 +8,8 @@ describe('dialog page', () => {
})
return
}
- if (isWeixin) {
- it('skip app-webview', () => {
+ if (isMP) {
+ it('skip mp', () => {
expect(1).toBe(1)
})
return
diff --git a/pages/API/dialog-page/dialog-page.test.js b/pages/API/dialog-page/dialog-page.test.js
index e978d639eb832a5aabd768467f92ca916c020c98..ccdb05a19abc51349d9891e60e23f85aac430ce1 100644
--- a/pages/API/dialog-page/dialog-page.test.js
+++ b/pages/API/dialog-page/dialog-page.test.js
@@ -3,6 +3,7 @@ jest.setTimeout(20000)
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isWeb = platformInfo.startsWith('web')
const isAndroid = platformInfo.startsWith('android')
+const isMP = platformInfo.startsWith('mp')
const FIRST_PAGE_PATH = '/pages/API/dialog-page/dialog-page'
const NEXT_PAGE_PATH = '/pages/API/dialog-page/next-page'
@@ -13,6 +14,12 @@ describe('dialog page', () => {
})
return
}
+ if (isMP) {
+ it('skip mp', () => {
+ expect(1).toBe(1)
+ })
+ return
+ }
let page;
let initLifeCycleNum;
@@ -51,7 +58,7 @@ describe('dialog page', () => {
it('check dialogPage methods', async () => {
expect(await page.callMethod('dialogPageCheckGetDialogPages')).toBe(true)
let dialogPageStyle = await page.callMethod('dialogPageGetPageStyle')
- expect(dialogPageStyle.backgroundColorContent).not.toBe('red')
+ expect(dialogPageStyle.backgroundColorContent).not.toBe('red')
await page.callMethod('dialogPageSetPageStyle')
dialogPageStyle = await page.callMethod('dialogPageGetPageStyle')
expect(dialogPageStyle.backgroundColorContent).toBe('red')
diff --git a/pages/API/get-app/get-app.test.js b/pages/API/get-app/get-app.test.js
index c8306e5250b969f81a0be62a90dda64f827011fe..a0a5014faef8f444ce5d9f8c04fdd772bce146af 100644
--- a/pages/API/get-app/get-app.test.js
+++ b/pages/API/get-app/get-app.test.js
@@ -1,6 +1,7 @@
const PAGE_PATH = '/pages/API/get-app/get-app'
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
-const isAndroid = platformInfo.startsWith('android')
+const isAndroid = platformInfo.startsWith('android')
+const isMP = platformInfo.startsWith('mp')
describe('getApp', () => {
let page = null
@@ -49,8 +50,10 @@ describe('getApp', () => {
expect(newLifeCycleNum - oldLifeCycleNum).toBe(100)
await page.callMethod('setLifeCycleNum', oldLifeCycleNum)
})
- it('getAndroidApplication', async () => {
- const res = await page.callMethod('getAndroidApplication')
- expect(res).toBe(isAndroid)
- })
+ if (!isMP) {
+ it('getAndroidApplication', async () => {
+ const res = await page.callMethod('getAndroidApplication')
+ expect(res).toBe(isAndroid)
+ })
+ }
})
diff --git a/pages/API/get-app/get-app.uvue b/pages/API/get-app/get-app.uvue
index f1c2b08aa3ea7fbf2300ceb0516ed31bd5447c7d..64a2ef8b4e076b178dac13fecce2bc094d7939df 100644
--- a/pages/API/get-app/get-app.uvue
+++ b/pages/API/get-app/get-app.uvue
@@ -38,11 +38,13 @@
- lifeCycleNum: {{ lifeCycleNum }}
+ lifeCycleNum: {{ lifeCycleNum }}
+
androidApplication is null: {{ androidApplication == null }}
+
@@ -172,12 +174,14 @@
// 自动化测试
setLifeCycleNum(num : number) {
setLifeCycleNum(num)
- },
+ },
+ // #ifndef MP
getAndroidApplication() : boolean {
const app = getApp()
this.androidApplication = app.getAndroidApplication()
return this.androidApplication !== null
}
+ // #endif
},
}
diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue
index 62a3b3eef1b51eb1fc145a590ba2883929498b25..bcc791c1112cc920bd0cc4f13899f9c84f9c66cf 100644
--- a/pages/API/get-current-pages/get-current-pages.uvue
+++ b/pages/API/get-current-pages/get-current-pages.uvue
@@ -93,12 +93,12 @@
}
},
onLoad(options : OnLoadOptions) {
- // #ifndef APP-ANDROID
+ // #ifdef APP-IOS || WEB
if (options instanceof UTSJSONObject) {
this.checked = true
}
// #endif
- // #ifdef APP-ANDROID
+ // #ifndef APP-IOS || WEB
this.checked = true
// #endif
this.getPageStyle();