From 200984266da67dd3af6ca25f73680c9193db99d2 Mon Sep 17 00:00:00 2001 From: splincode Date: Thu, 3 Oct 2024 15:15:19 +0300 Subject: [PATCH] chore: drop difficult code --- .../tests/kit/input-date/input-date.spec.ts | 4 ++-- .../page-objects/documentation-api-page.po.ts | 17 +---------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts b/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts index 0825a4fe473b..988831b2aebe 100644 --- a/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts +++ b/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts @@ -20,7 +20,7 @@ test.describe('InputDate', () => { const api = new TuiDocumentationPagePO(page); const example = api.getExample('#sizes'); - await api.prepareBeforeScreenshot(':not(#sizes)'); + await api.prepareBeforeScreenshot(); for (const size of ['s', 'm', 'l']) { const input = example @@ -164,7 +164,7 @@ test.describe('InputDate', () => { const example = api.getExample('#base'); await example.scrollIntoViewIfNeeded(); - await api.prepareBeforeScreenshot(':not(#base)'); + await api.prepareBeforeScreenshot(); await example.locator('tui-input-date .t-icon tui-icon').click(); await expect(page).toHaveScreenshot(`08-input-date-${language}.png`); diff --git a/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts b/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts index 2caf6042b34f..1f5eb51a4e47 100644 --- a/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts +++ b/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts @@ -50,27 +50,12 @@ export class TuiDocumentationApiPagePO { } } - public async prepareBeforeScreenshot(hasNot = ''): Promise { + public async prepareBeforeScreenshot(): Promise { await this.hideDocumentation(); await this.hideScrollControls(); await this.hideNavigation(); await this.hideNotifications(); - const wrapper = this.page.locator('tui-doc-page'); - const hideElements = [ - ...(await wrapper - .locator(`header:not(.t-content > *:not(tui-doc-demo)${hasNot} header)`) - .all()), - ...(await wrapper - .locator(`> .t-content > *:not(tui-doc-demo)${hasNot}`) - .all()), - ...(await wrapper.locator('.t-bg-toggle').all()), - ]; - - for (const element of hideElements) { - await tuiHideElement(element); - } - if ((await this.apiPageExample.all()).length) { await this.apiPageExample.evaluate((el) => el.scrollIntoView()); await expect(async () => {