diff --git a/pages/grid/grid.test.js b/pages/grid/grid.test.js index f2f10efd726066f20b3ba677986ff07135d10f74..40752a2b3f6b73cc146b13f61adae9d25b895e94 100644 --- a/pages/grid/grid.test.js +++ b/pages/grid/grid.test.js @@ -13,17 +13,18 @@ describe('pages/grid/grid.vue', () => { const getData = await page.data('gridList') console.log("getData: ",getData); expect(getData.length).toBe(9) - }) it('点击宫格', async () => { - // expect.assertions(1); - const perPage = await page.$('.warp') - const uGrid = await perPage.$('.uni-grid-box') - console.log("uGrid-----------: ",uGrid); - // await uGrid.callMethod('change') + if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM === "app-plus") { + const perPage = await page.$('.uni-grid-wrap') + console.log("perPage: ",perPage); + await perPage.callMethod('change') + } + if (process.env.UNI_PLATFORM === "mp-weixin") { + const uniGrid = await page.$('uni-grid') + console.log("uniGrid: ",uniGrid); + await uniGrid.callMethod('change') + } }) - - - }); \ No newline at end of file diff --git a/pages/list/list.test.js b/pages/list/list.test.js index 94a599574da4987c92a8007f6d3a879b32db43e2..e7b7b80f76ae93cc6dae046dd762586027685160 100644 --- a/pages/list/list.test.js +++ b/pages/list/list.test.js @@ -7,18 +7,9 @@ describe('pages/list/list.vue', () => { }) it('检测标题', async () => { - // expect.assertions(2); - // const perPage = await page.$('.pages') - // await page.waitFor(500) - // const getData = await perPage.data('dataList') - // console.log("getData: ",getData); - // expect(getData.title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务') - // expect(getData.length).toBe(1) - const getData = await page.data('dataList') console.log("getData: ",getData); - - + expect(getData.title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务') }) it('点击搜索跳转', async () => { diff --git a/pages/ucenter/about/about.test.js b/pages/ucenter/about/about.test.js index dd4d3cbd24b0ccdf6bdd25723a629499b0288797..0e029b4d2cff56767e789078d1d679118af66d02 100644 --- a/pages/ucenter/about/about.test.js +++ b/pages/ucenter/about/about.test.js @@ -17,10 +17,22 @@ describe('pages/ucenter/about/about.vue', () => { }) it('screenshot', async () => { - var image = await program.screenshot({ - path: "static/screenshot/about.png" // 默认项目根目录 - }) - console.log(image,"image--------------------") + + if (process.env.UNI_PLATFORM === "h5") { + const image = await program.screenshot({ + path: "static/screenshot/about-h5.png" // 默认项目根目录 + }) + console.log(image,"image--------------------") + }else if(process.env.UNI_PLATFORM === "app-plus"){ + await program.screenshot({ + path: "static/screenshot/about-app.png" + }) + }else if(process.env.UNI_PLATFORM === "mp-weixin"){ + await program.screenshot({ + path: "static/screenshot/about-mp.png" + }) + } + }) diff --git a/pages/ucenter/login-page/pwd-login/pwd-login.test.js b/pages/ucenter/login-page/pwd-login/pwd-login.test.js index 8f9bc86292f1dbf159f1b0579e2d7b1f3722f8cc..bf20f2c22829a2d1f5d6ff7e58517285dde0453e 100644 --- a/pages/ucenter/login-page/pwd-login/pwd-login.test.js +++ b/pages/ucenter/login-page/pwd-login/pwd-login.test.js @@ -5,7 +5,7 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => { let page beforeAll(async () => { - page = await program.navigateTo('/pages/ucenter/login-page/pwd-login/pwd-login') + page = await program.redirectTo('/pages/ucenter/login-page/pwd-login/pwd-login') await page.waitFor(500) }) @@ -15,10 +15,11 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => { await page.waitFor(300) expect((await program.currentPage()).path).toBe( 'pages/ucenter/login-page/register/register') - await page.waitFor(500) - // 执行 navigateBack 验证是否返回 - expect((await program.navigateBack()).path).toBe( - 'pages/ucenter/login-page/pwd-login/pwd-login') + console.log(await program.currentPage(),"111111111"); + // await page.waitFor(500) + // 执行 navigateBack 验证是否返回navigateTo + // expect((await program.navigateBack()).path).toBe( + // 'pages/ucenter/login-page/pwd-login/pwd-login') }) it('跳转到忘记密码页', async () => { @@ -27,11 +28,11 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => { await page.waitFor(300) expect((await program.currentPage()).path).toBe( 'pages/ucenter/login-page/pwd-retrieve/pwd-retrieve') - - await page.waitFor(500) + console.log(await program.currentPage(),"222222"); + // await page.waitFor(500) // 执行 navigateBack 验证是否返回 - expect((await program.navigateBack()).path).toBe( - 'pages/ucenter/login-page/pwd-login/pwd-login') + // expect((await program.navigateBack()).path).toBe( + // 'pages/ucenter/login-page/pwd-login/pwd-login') }) it('用户名密码登录', async () => { @@ -47,12 +48,12 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => { switch (resLogin.msg){ case 10102: expect(resLogin.msg).toBe("密码错误"); - const setForm = await page.setData({ + await page.setData({ "password": "222222", "username": "数字天堂", "agree": true, }) - const resLogin = await page.callMethod('pwdLogin') + await page.callMethod('pwdLogin') break; case 10103: expect(resLogin.msg).toBe("密码错误次数过多"); diff --git a/pages/ucenter/userinfo/userinfo.test.js b/pages/ucenter/userinfo/userinfo.test.js index 0523001884fcadc4227747fed988a9164e4a39bf..4daadde328c320fe286ff3d96fe3fdf11a2be0e2 100644 --- a/pages/ucenter/userinfo/userinfo.test.js +++ b/pages/ucenter/userinfo/userinfo.test.js @@ -9,7 +9,7 @@ describe('pages/ucenter/userinfo/userinfo.vue', () => { }) - it('设置昵称', async () => { + /* it('设置昵称', async () => { const getTokenRes = await page.waitFor(async()=>{ return await page.data('uniToken') }) @@ -17,14 +17,15 @@ describe('pages/ucenter/userinfo/userinfo.vue', () => { var name = "数字天堂DCloud" + Math.round(Math.random()*10); console.log("name: ",name); - + console.log(await page.data('uniToken'),"---------------------"); if(getTokenRes){ const nicknameRes = await page.callMethod("setNickname",name) await page.waitFor(300) console.log("nicknameRes: ",nicknameRes); expect(nicknameRes.updated).toBe(1) } - }) + + }) */ it('绑定手机号', async () => { console.log(await page.data('uniToken'),"-------------------------"); diff --git a/static/screenshot/about-app.jpg b/static/screenshot/about-app.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9ab2a7521bf3bc9c5a449bed6919b27dcab1422b Binary files /dev/null and b/static/screenshot/about-app.jpg differ diff --git a/static/screenshot/about-h5.png b/static/screenshot/about-h5.png new file mode 100644 index 0000000000000000000000000000000000000000..a8e6729526408f0de25db1b864f3e98dde33081b Binary files /dev/null and b/static/screenshot/about-h5.png differ diff --git a/static/screenshot/about-mp.jpg b/static/screenshot/about-mp.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0d3b488a2eb7b1a72310d1858576a4b4ca81aab7 Binary files /dev/null and b/static/screenshot/about-mp.jpg differ diff --git a/static/screenshot/about.png b/static/screenshot/about.png deleted file mode 100644 index 714703fb28cc83a9dbed50c1a119ef90c9001dd5..0000000000000000000000000000000000000000 Binary files a/static/screenshot/about.png and /dev/null differ