From 98e9e0f83d282ea144f05b2bc14a222298f69c1b Mon Sep 17 00:00:00 2001 From: Atharv Chandratre Date: Thu, 19 Oct 2023 08:51:03 -0500 Subject: [PATCH] test(demo-playwright): tests for addon-table (#5680) Co-authored-by: Vidhi Rambhia <39163240+VidhiRambhia@users.noreply.github.com> Co-authored-by: Nikita Barsukov Co-authored-by: VidhiRambhia --- .../cypress/tests/addon-table/table/table.cy.ts | 12 ------------ .../tests/addon-table/table/table.spec.ts | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 projects/demo-cypress/cypress/tests/addon-table/table/table.cy.ts create mode 100644 projects/demo-playwright/tests/addon-table/table/table.spec.ts diff --git a/projects/demo-cypress/cypress/tests/addon-table/table/table.cy.ts b/projects/demo-cypress/cypress/tests/addon-table/table/table.cy.ts deleted file mode 100644 index 65c53fb7d768..000000000000 --- a/projects/demo-cypress/cypress/tests/addon-table/table/table.cy.ts +++ /dev/null @@ -1,12 +0,0 @@ -describe(`Table`, () => { - beforeEach(() => { - cy.viewport(`macbook-13`); - cy.tuiVisit(`components/table`); - }); - - it(`Dynamic column`, () => { - cy.get(`#dynamic button`).first().click(); - - cy.get(`#dynamic`).matchImageSnapshot(`table-dynamic`); - }); -}); diff --git a/projects/demo-playwright/tests/addon-table/table/table.spec.ts b/projects/demo-playwright/tests/addon-table/table/table.spec.ts new file mode 100644 index 000000000000..3ff788cecd6c --- /dev/null +++ b/projects/demo-playwright/tests/addon-table/table/table.spec.ts @@ -0,0 +1,13 @@ +import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils'; +import {expect, test} from '@playwright/test'; + +test.describe(`Table`, () => { + test(`Dynamic column`, async ({page}) => { + await tuiGoto(page, `components/table`); + const example = new TuiDocumentationPagePO(page).getExample(`#dynamic`); + const addColumnButton = example.locator(`button`).first(); + + await addColumnButton.click(); + await expect(example).toHaveScreenshot(`01-table-dynamic.png`); + }); +});