From b3df4eb22e693de5b81dd6155443df85317bab27 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Tue, 27 Dec 2022 15:45:44 +0800 Subject: [PATCH] chore: update playwright workker to 100% --- playwright.config.ts | 2 +- tests/local-first-new-page.spec.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index fec10a72fd..1e5defb999 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -28,7 +28,7 @@ const config: PlaywrightTestConfig = { /* Retry on CI only */ retries: process.env.CI ? 2 : 0, /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + workers: '100%', /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'list', // reporter: 'html', diff --git a/tests/local-first-new-page.spec.ts b/tests/local-first-new-page.spec.ts index 775afcc0e2..ee07835e54 100644 --- a/tests/local-first-new-page.spec.ts +++ b/tests/local-first-new-page.spec.ts @@ -5,11 +5,10 @@ loadPage(); test.describe('local first new page', () => { test('click btn new page', async ({ page }) => { - const originPageUrl = page.url(); + const originPageId = page.url().split('/').reverse()[0]; await page.getByText('New Page').click(); - const newPageUrl = page.url(); - expect(newPageUrl).not.toBe(originPageUrl); - expect(newPageUrl.length).toBe(originPageUrl.length); + const newPageId = page.url().split('/').reverse()[0]; + expect(newPageId).not.toBe(originPageId); }); test('click btn bew page and find it in all pages', async ({ page }) => {