From e434e5cb1bac12f846d7b79ce4297708401c48f5 Mon Sep 17 00:00:00 2001 From: David Matejka Date: Tue, 1 Aug 2023 15:27:24 +0200 Subject: [PATCH] chore: update pw config --- packages/admin/playwright.config.js | 4 ++-- .../playwright/cases/blockEditor.spec.ts | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/admin/playwright.config.js b/packages/admin/playwright.config.js index e7511d6232..97fbf9b207 100644 --- a/packages/admin/playwright.config.js +++ b/packages/admin/playwright.config.js @@ -7,8 +7,8 @@ const config = { expect: { toMatchSnapshot: { - threshold: process.env.CI ? 0.05 : 0, - maxDiffPixelRatio: process.env.CI ? 0.05 : 0, + threshold: process.env.CI ? 0.03 : 0, + maxDiffPixelRatio: process.env.CI ? 0.0005 : 0, }, }, diff --git a/packages/admin/tests/playwright/cases/blockEditor.spec.ts b/packages/admin/tests/playwright/cases/blockEditor.spec.ts index 5f7b03bcb4..e9da570f53 100644 --- a/packages/admin/tests/playwright/cases/blockEditor.spec.ts +++ b/packages/admin/tests/playwright/cases/blockEditor.spec.ts @@ -14,12 +14,15 @@ test('basic test', async ({ page }) => { await page.goto(`/${projectSlug}/block-editor`) await page.waitForLoadState('networkidle') // wait for fonts await page.waitForSelector('p.cui-editorParagraph') + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('initial.png') await page.locator('p.cui-editorParagraph').click() await page.keyboard.type('Hello world') + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('filled.png') await page.locator('p.cui-editorParagraph').selectText() await page.waitForSelector('.cui-hoveringToolbar.is-active') + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('selected.png') }) @@ -37,10 +40,10 @@ test('inline buttons: ordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-ordered-list-initial.png') await page.locator(':nth-match(button.cui-editorToolbarButton, 1)').click() - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-ordered-list-clicked.png') await page.locator('text=Hello world').click() await page.keyboard.press('End', keyboardPressOptions) @@ -48,7 +51,7 @@ test('inline buttons: ordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-ordered-list-first.png') await page.locator(':nth-match(button.cui-editorToolbarButton, 2)').click() await page.locator('text=Hello world').click() @@ -57,7 +60,7 @@ test('inline buttons: ordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-ordered-list-second.png') await page.locator(':nth-match(button.cui-editorToolbarButton, 3)').click() await page.locator('text=Hello world').click() @@ -66,7 +69,7 @@ test('inline buttons: ordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-ordered-list-third.png') }) @@ -83,10 +86,10 @@ test('inline buttons: unordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-unordered-list-initial.png') await page.locator(':nth-match(button.cui-editorToolbarButton, 1)').click() - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-unordered-list-clicked.png') await page.locator('text=Hello world').click() await page.keyboard.press('End', keyboardPressOptions) @@ -94,7 +97,7 @@ test('inline buttons: unordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-unordered-list-first.png') await page.locator(':nth-match(button.cui-editorToolbarButton, 2)').click() await page.locator('text=Hello world').click() @@ -103,7 +106,7 @@ test('inline buttons: unordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-unordered-list-second.png') await page.locator(':nth-match(button.cui-editorToolbarButton, 3)').click() await page.locator('text=Hello world').click() @@ -112,6 +115,6 @@ test('inline buttons: unordered list', async ({ page }) => { await page.keyboard.press('Shift+ArrowLeft', keyboardPressOptions) } await page.waitForSelector('.cui-hoveringToolbar.is-active') - await page.waitForTimeout(200) + await page.waitForTimeout(500) expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot('inline-buttons-unordered-list-third.png') })