-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6304 from Sage/FE-6102_card-pw-refactor
test(card): migrate tests from cypress to playwright - FE-6102
- Loading branch information
Showing
6 changed files
with
619 additions
and
275 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Page } from "@playwright/test"; | ||
import { | ||
CARD, | ||
CARD_COLUMN, | ||
CARD_DRAGGABLE_ELEMENT, | ||
CARD_FOOTER, | ||
DRAGGABLE_CARD_AT_IDEX, | ||
DRAGGABLE_CONTAINER_AT_INDEX, | ||
} from "./locators"; | ||
|
||
// component preview locators | ||
export const card = (page: Page) => page.locator(CARD); | ||
|
||
export const draggableCard = (page: Page, index: number) => | ||
page.locator(DRAGGABLE_CARD_AT_IDEX(index)).locator(CARD_DRAGGABLE_ELEMENT); | ||
|
||
export const draggableContainer = (page: Page, index: number) => | ||
page.locator(DRAGGABLE_CONTAINER_AT_INDEX(index)); | ||
|
||
export const columnCard = (page: Page) => page.locator(CARD_COLUMN); | ||
|
||
export const footerCard = (page: Page) => page.locator(CARD_FOOTER); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// component preview locators | ||
export const CARD = '[data-component="card"]'; | ||
export const CARD_DRAGGABLE_ELEMENT = '[data-element="drag"]'; | ||
export const CARD_COLUMN = '[data-element="card-column"]'; | ||
export const CARD_FOOTER = '[data-element="card-footer"]'; | ||
|
||
export const DRAGGABLE_CARD_AT_IDEX = (index: number) => | ||
`[data-element="draggable-card-${index}"]`; | ||
|
||
export const DRAGGABLE_CONTAINER_AT_INDEX = (index: number) => | ||
`[data-element="draggable-container-${index}"]`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.