diff --git a/playwright.config.js b/playwright.config.js index 6025cbb..4ff0209 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -30,6 +30,12 @@ module.exports = defineConfig({ /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + timeout: 5 * 60000, + expect: { + toPass: { + timeout: 30000, + }, + }, use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL: process.env.BASE_URL, diff --git a/tests/hlk/demo.spec.js b/tests/hlk/demo.spec.js index 6b6d4a1..c647c4b 100644 --- a/tests/hlk/demo.spec.js +++ b/tests/hlk/demo.spec.js @@ -8,11 +8,11 @@ test.describe const customer = new Customer(1, 1, { phone: phone }); console.log(`${customer.phone}-${customer.username}`); - test('创建顾客', async ({ touchCustomerPage }) => { - await touchCustomerPage.createCustomer(customer); - }); + test('登录touch和h5,创建顾客购买会员卡', async ({ touchPage, touchCustomerPage }) => { + await test.step('创建顾客', async () => { + await touchCustomerPage.createCustomer(customer); + }); - test('登录touch和h5,创建顾客购买会员卡', async ({ touchPage }) => { await test.step('在touch页面购买会员卡', async () => { await touchPage.getByText('去开单').click(); await touchPage.locator('.more > .icon > svg').click(); diff --git a/tests/zhb/csv-demo.spec.js b/tests/zhb/csv-demo.spec.js index 2d6c93a..780d1c9 100644 --- a/tests/zhb/csv-demo.spec.js +++ b/tests/zhb/csv-demo.spec.js @@ -65,8 +65,10 @@ test('csv', async ({ zhbPage }, workerInfo) => { .locator('span') .first() .click(); - await zhbPage.getByRole('button', { name: '完成开单' }).click(); - await expect(zhbPage.getByRole('button', { name: '结账' })).toBeVisible(); + await expect(async () => { + await zhbPage.getByRole('button', { name: '完成开单' }).click(); + await expect(zhbPage.getByRole('button', { name: '结账' })).toBeVisible({ timeout: 2000 }); + }).toPass(); await zhbPage.getByRole('button', { name: '结账' }).click(); await zhbPage.locator('#page_footBathPay').getByText('结算签字').click();