diff --git a/pages/grid/grid.test.js b/pages/grid/grid.test.js index 16a44e2b68722fb074e57b8ace757832a95efb6f..aad385e57d2adc845dd03e4b6c9ba55382b8242f 100644 --- a/pages/grid/grid.test.js +++ b/pages/grid/grid.test.js @@ -18,7 +18,7 @@ describe('pages/grid/grid.vue', () => { }) it('点击宫格', async () => { - if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM === "app-plus") { + if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM.startsWith("app")) { const perPage = await page.$('.uni-grid-wrap') await perPage.callMethod('change') } diff --git a/pages/ucenter/about/about.test.js b/pages/ucenter/about/about.test.js index dc0be62dc8e565d8b3b2f6610e1cef90ba798f6f..48294188ae1b4ee25fda73de625eaec36074168b 100644 --- a/pages/ucenter/about/about.test.js +++ b/pages/ucenter/about/about.test.js @@ -17,23 +17,23 @@ describe('pages/ucenter/about/about.vue', () => { }) it('screenshot', async () => { + if(isWX){ + return + } console.log("process.env.UNI_PLATFORM: ",process.env.UNI_PLATFORM); expect.assertions(1); expect((await page.data('about')).appName).toBe('uni-starter') + await page.waitFor(1000) - if (process.env.UNI_PLATFORM === "app-plus") { + if (process.env.UNI_PLATFORM.startsWith("app")) { await program.screenshot({ path: "static/screenshot/about-app.png" // 默认项目根目录 }) - + await page.waitFor(1000) await page.callMethod('navigateTo', { url: "https://ask.dcloud.net.cn/protocol.html", title: "用户服务条款" }) - }else if(process.env.UNI_PLATFORM === "mp-weixin"){ - await program.screenshot({ - path: "static/screenshot/about-weixin.png" // 默认项目根目录 - }) }else if(process.env.UNI_PLATFORM === "h5"){ await program.screenshot({ path: "static/screenshot/about-h5.png" // 默认项目根目录 diff --git a/pages/ucenter/settings/settings.test.js b/pages/ucenter/settings/settings.test.js index 99480b2c2d845d6444c39fd4ae7a3f89f52cbaee..221bf6f6ce2b0d276b58f4b744560e744ddcc776 100644 --- a/pages/ucenter/settings/settings.test.js +++ b/pages/ucenter/settings/settings.test.js @@ -15,7 +15,7 @@ describe('pages/ucenter/settings/settings', () => { }) it('settings', async () => { - if (process.env.UNI_PLATFORM == "app-plus") { + if (process.env.UNI_PLATFORM.startsWith("app")) { await page.callMethod('clearTmp') // console.log(await page.data('pushIsOn'), "pushIsOn-------------"); const pushRes = await page.data('pushIsOn') diff --git a/pages/ucenter/ucenter.test.js b/pages/ucenter/ucenter.test.js index 002152f3620c46e3b548f07d22a9f6eeda52ad2a..5acca99c17186dfa06e0bddd77b68d6d5930c006 100644 --- a/pages/ucenter/ucenter.test.js +++ b/pages/ucenter/ucenter.test.js @@ -24,7 +24,7 @@ describe('pages/ucenter/ucenter.vue', () => { it('列表', async () => { const getUcenterList = await page.data('ucenterList') console.log("getUcenterList: ",getUcenterList); - if(process.env.UNI_PLATFORM === "app-plus"){ + if(process.env.UNI_PLATFORM.startsWith("app")){ expect(getUcenterList.length).toBe(3) } @@ -34,7 +34,7 @@ describe('pages/ucenter/ucenter.vue', () => { it('普通签到', async () => { if(uniToken){ - if(process.env.UNI_PLATFORM === "app-plus"){ + if(process.env.UNI_PLATFORM.startsWith("app")){ console.log('app-plus----普通签到'); const signInByAdRes = await page.callMethod('signInByAd') console.log("signInByAdRes: ",signInByAdRes);