From bb0a0961ab7c859da5e584abf6ea286ddec9958f Mon Sep 17 00:00:00 2001 From: Anne_LXM Date: Mon, 29 Apr 2024 11:43:21 +0800 Subject: [PATCH] =?UTF-8?q?test=EF=BC=9AsetTimeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/grid/grid.test.js | 3 +++ pages/ucenter/settings/settings.test.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/grid/grid.test.js b/pages/grid/grid.test.js index 284014f..7283381 100644 --- a/pages/grid/grid.test.js +++ b/pages/grid/grid.test.js @@ -1,13 +1,16 @@ // jest官方文档: https://www.jestjs.cn/ // uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start const PAGE_PATH = '/pages/grid/grid' +jest.setTimeout(15000) describe('grid', () => { let page, hasLogin; beforeAll(async () => { page = await program.switchTab(PAGE_PATH) + console.log('page',page) await page.waitFor('view') }) it('检测宫格', async () => { + await page.waitFor(2000) hasLogin = await page.data('hasLogin') let gridList = await page.data('gridList') console.log("gridList", hasLogin,gridList.length) diff --git a/pages/ucenter/settings/settings.test.js b/pages/ucenter/settings/settings.test.js index 5190ecd..c76f079 100644 --- a/pages/ucenter/settings/settings.test.js +++ b/pages/ucenter/settings/settings.test.js @@ -34,7 +34,6 @@ describe('settings', () => { console.log('bottom-back-text',bottomEl,await bottomEl.text()) expect(await bottomEl.text()).toBe('退出登录') await page.callMethod('changeLoginState') - await page.waitFor(500) - console.log(await program.currentPage()); + await page.waitFor(1000) }) }); -- GitLab