tests(Playwright): Full implementation of Page Object Models (POMs) to Playwright tests (#5608)
This commit is contained in:
1 parent
7b12dcf048
commit
d917e74e68
58 files changed
+1167
-496
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class DataOverlayPageObject {
|
||||
readonly page: Page;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
async toggle(viewportId: string = 'default') {
|
||||
await this.page.getByTestId(`dataOverlayMenu-${viewportId}-btn`).click();
|
||||
}
|
||||
|
||||
async addSegmentation(segmentation: string, viewportId: string = 'default') {
|
||||
await this.page.getByTestId(`AddSegmentationDataOverlay-${viewportId}`).click();
|
||||
await this.page.getByText('SELECT A SEGMENTATION').click();
|
||||
await this.page.getByTestId(segmentation).click();
|
||||
}
|
||||
|
||||
async changeSegmentation(from: string, to: string) {
|
||||
await this.page.getByTestId(`overlay-ds-select-value-${from.toUpperCase()}`).click();
|
||||
await this.page.getByTestId(`${to}-SEG`).click();
|
||||
}
|
||||
|
||||
async remove(segmentation: string) {
|
||||
await this.page.getByTestId(`overlay-ds-more-button-${segmentation}`).click();
|
||||
await this.page.getByTestId(`overlay-ds-remove-button-${segmentation}`).click();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user