Skip to content

Commit

Permalink
Merge pull request #6354 from Sage/pw_refactor_dialogfullscreen
Browse files Browse the repository at this point in the history
test(dialog-full-screen): playwright refactor
  • Loading branch information
stephenogorman authored Oct 25, 2023
2 parents ba19c7b + af30f81 commit 68f587c
Show file tree
Hide file tree
Showing 8 changed files with 1,086 additions and 639 deletions.
427 changes: 0 additions & 427 deletions cypress/components/dialog-full-screen/dialog-full-screen.cy.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions cypress/locators/dialog-full-screen/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/locators/dialog-full-screen/locators.js

This file was deleted.

9 changes: 9 additions & 0 deletions playwright/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
LABEL,
STICKY_FOOTER,
COMMMON_DATA_ELEMENT_INPUT,
PORTAL,
} from "./locators";

export const icon = (page: Page) => {
Expand Down Expand Up @@ -67,3 +68,11 @@ export const label = (page: Page) => {
export const legendSpan = (page: Page) => {
return page.locator("legend > span");
};

export const openDialogByName = (page: Page, name: string) => {
getDataElementByValue(page, "main-text").filter({ hasText: name });
};

export const portal = (page: Page) => {
return page.locator(PORTAL).nth(1).locator("h1");
};
20 changes: 20 additions & 0 deletions playwright/support/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,23 @@ export const getDesignTokensByCssProperty = async (
}
return tokens;
};

export const continuePressingTAB = async (page: Page, count: number) => {
const promises = [];

for (let i = 0; i < count; i++) {
promises.push(page.keyboard.press(`Tab`));
}

await Promise.all(promises);
};

export const continuePressingSHIFTTAB = async (page: Page, count: number) => {
const promises = [];

for (let i = 0; i < count; i++) {
promises.push(page.keyboard.press(`Shift+Tab`));
}

await Promise.all(promises);
};
Loading

0 comments on commit 68f587c

Please sign in to comment.