-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(accordion): migrate component tests to playwright
- Loading branch information
1 parent
0878063
commit 2ba588a
Showing
9 changed files
with
1,402 additions
and
665 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
import type { Page } from "@playwright/test"; | ||
import { | ||
ACCORDION_PREVIEW, | ||
ACCORDION_TITLE_CONTAINER, | ||
ACCORDION_ICON, | ||
ACCORDION_CONTENT, | ||
} from "./locators"; | ||
|
||
// locators | ||
const accordionTitleContainer = (page: Page) => { | ||
return page.locator(ACCORDION_PREVIEW).locator(ACCORDION_TITLE_CONTAINER); | ||
}; | ||
|
||
const accordionDefaultTitle = (page: Page) => { | ||
return page.locator(ACCORDION_TITLE_CONTAINER); | ||
}; | ||
|
||
const accordionTitleContainerByPosition = (page: Page, index: number) => { | ||
return page | ||
.locator(ACCORDION_PREVIEW) | ||
.locator(`${ACCORDION_TITLE_CONTAINER}:nth-child(${index + 1}) > *`); | ||
}; | ||
|
||
const accordionIcon = (page: Page) => { | ||
return accordionTitleContainer(page).locator(ACCORDION_ICON); | ||
}; | ||
|
||
const accordionContent = (page: Page) => { | ||
return page.locator(ACCORDION_PREVIEW).locator(ACCORDION_CONTENT); | ||
}; | ||
|
||
const accordion = (page: Page) => { | ||
return page.locator(ACCORDION_PREVIEW); | ||
}; | ||
|
||
export { | ||
accordionTitleContainer, | ||
accordionDefaultTitle, | ||
accordionTitleContainerByPosition, | ||
accordionIcon, | ||
accordionContent, | ||
accordion, | ||
}; |
File renamed without changes.
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import type { Page } from "@playwright/test"; | ||
import { ICON } from "./locators"; | ||
|
||
const icon = (page: Page) => { | ||
export const icon = (page: Page) => { | ||
return page.locator(ICON); | ||
}; | ||
|
||
export default icon; | ||
export const getDataElementByValue = (page: Page, element: string) => { | ||
return page.locator(`[data-element="${element}"]`); | ||
}; |
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.