From 0cf685e15932456ea39749f585254098e6f3b5d2 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Wed, 24 Jan 2024 19:01:17 +0300 Subject: [PATCH] chore: wait before screenshot (#6543) --- .../kit/dropdown-selection/dropdown-selection.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/demo-playwright/tests/kit/dropdown-selection/dropdown-selection.spec.ts b/projects/demo-playwright/tests/kit/dropdown-selection/dropdown-selection.spec.ts index 79c996c0d269..f74ac6cb9579 100644 --- a/projects/demo-playwright/tests/kit/dropdown-selection/dropdown-selection.spec.ts +++ b/projects/demo-playwright/tests/kit/dropdown-selection/dropdown-selection.spec.ts @@ -7,22 +7,27 @@ test.describe('DropdownSelection', () => { test.beforeEach(async ({page}) => tuiGoto(page, '/directives/dropdown-selection')); test('current range must be a text node only', async ({page}) => { - const example = new TuiDocumentationPagePO(page).getExample('#textarea'); + const api = new TuiDocumentationPagePO(page); + const example = api.getExample('#textarea'); await example.scrollIntoViewIfNeeded(); await example.locator('textarea').focus(); await page.keyboard.press('Control+ArrowLeft'); + await api.networkidle(); await expect(page).toHaveScreenshot('01-dropdown-selection.png'); await page.keyboard.press('ArrowRight'); await page.keyboard.press('ArrowRight'); await page.keyboard.press('ArrowRight'); await page.keyboard.press('ArrowRight'); await page.keyboard.press('ArrowRight'); + await api.networkidle(); await expect(page).toHaveScreenshot('02-dropdown-selection.png'); await example.locator('textarea').fill(''); await example.locator('textarea').fill('@'); + await api.networkidle(); await expect(page).toHaveScreenshot('03-dropdown-selection.png'); await page.locator('button[tuiOption]').first().click(); + await api.networkidle(); await expect(page).toHaveScreenshot('04-dropdown-selection.png'); }); });