diff --git a/pages/ucenter/settings/settings.test.js b/pages/ucenter/settings/settings.test.js index cfefd28cf5aae769b958f26dbb68fcba83459be4..3f3bc4674bb9dfac9fdadaf2d1a3530350ed23ac 100644 --- a/pages/ucenter/settings/settings.test.js +++ b/pages/ucenter/settings/settings.test.js @@ -7,7 +7,7 @@ describe('pages/ucenter/settings/settings', () => { page = await program.navigateTo('/pages/ucenter/settings/settings') await page.waitFor('view') uniToken = await program.callUniMethod('getStorageSync', 'uni_id_token') - // console.log("uniToken: ",uniToken); + console.log("uniToken: ",uniToken); if(!uniToken)return; } catch (err) { console.log("err: ",err); @@ -26,12 +26,9 @@ describe('pages/ucenter/settings/settings', () => { expect((await el.$$('.mt10')).length).toBe(2) } }) - it('screenshot',async()=>{ - const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); - await page.waitFor(500); - }) + it('退出登录', async () => { + if(!uniToken)return; const bottomEl = await page.$('.bottom-back-text') expect(await bottomEl.text()).toBe('退出登录') await page.callMethod('changeLoginState') diff --git a/uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js b/uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js index 4bada2674c21611594d0296810afa60125f406d6..14c1e94370409454efbc18de8ca1dd426e669d08 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js +++ b/uni_modules/uni-id-pages/pages/userinfo/userinfo.test.js @@ -32,14 +32,13 @@ describe('uni_modules/uni-id-pages/pages/userinfo/userinfo.vue', () => { // console.log("elBox: ",elBox); await elBox.callMethod('setAvatarFile',avatar_file) await page.waitFor(500) - await program.screenshot({ - path: "static/screenshot/userinfo.png" // 默认项目根目录 - }) - }else{ - await page.waitFor(500) - await program.screenshot({ - path: "static/screenshot/userinfo-mp.png" // 默认项目根目录 - }) } }) + it("screenshot", async () => { + if(!uniToken)return; + await program.screenshot({ + path: "static/screenshot/userinfo.png" // 默认项目根目录 + }) + await page.waitFor(500) + }) });