-
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 #6258 from Sage/playwright_refactor_advancedcolorp…
…icker test(advanced-color-picker): Playwright refactor
- Loading branch information
Showing
8 changed files
with
563 additions
and
330 deletions.
There are no files selected for viewing
329 changes: 0 additions & 329 deletions
329
cypress/components/advanced-color-picker/advanced-color-picker.cy.tsx
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,50 @@ | ||
import type { Page } from "@playwright/test"; | ||
import { | ||
ADVANCED_COLOR_PICKER_CELL, | ||
CURRENT_COLOR_DESCRIPTION, | ||
SIMPLE_COLOR, | ||
SIMPLE_COLOR_PICKER, | ||
ADVANCED_COLOR_PREVIEW, | ||
} from "./locators"; | ||
|
||
const simpleColorPickerInput = (page: Page, index: number) => { | ||
return page.locator(SIMPLE_COLOR).locator("input").nth(index); | ||
}; | ||
|
||
const simpleColorPicker = (page: Page, index: number) => { | ||
return page | ||
.locator(SIMPLE_COLOR_PICKER) | ||
.locator(SIMPLE_COLOR) | ||
.nth(index) | ||
.locator("input"); | ||
}; | ||
|
||
const currentColorDescription = (page: Page) => { | ||
return page.locator(CURRENT_COLOR_DESCRIPTION); | ||
}; | ||
|
||
const advancedColorPickerCell = (page: Page) => { | ||
return page.locator(ADVANCED_COLOR_PICKER_CELL); | ||
}; | ||
|
||
const advancedColorPicker = (page: Page, index: number) => { | ||
return page.locator(SIMPLE_COLOR).nth(index); | ||
}; | ||
|
||
const simpleColorPickerComponent = (page: Page) => { | ||
return page.locator(SIMPLE_COLOR_PICKER); | ||
}; | ||
|
||
const advancedColorPickerPreview = (page: Page) => { | ||
return page.locator(ADVANCED_COLOR_PREVIEW); | ||
}; | ||
|
||
export { | ||
simpleColorPickerInput, | ||
simpleColorPicker, | ||
currentColorDescription, | ||
advancedColorPickerCell, | ||
advancedColorPicker, | ||
simpleColorPickerComponent, | ||
advancedColorPickerPreview, | ||
}; |
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,7 @@ | ||
// component preview locators | ||
export const ADVANCED_COLOR_PICKER_CELL = '[data-element="color-picker-cell"]'; | ||
export const CURRENT_COLOR_DESCRIPTION = | ||
'[data-element="current-color-description"]'; | ||
export const SIMPLE_COLOR = '[data-component="simple-color"]'; | ||
export const SIMPLE_COLOR_PICKER = '[data-component="simple-color-picker"]'; | ||
export const ADVANCED_COLOR_PREVIEW = '[data-element="color-picker-preview"]'; |
Oops, something went wrong.