chore(tests): contour segment interactions e2e tests - rename and togglevisibility (#5891)
This commit is contained in:
1 parent
87eeefdf1b
commit
fe762b68e8
6 files changed
+214
-1
No files matched your search
@@ -33,6 +33,7 @@ export class DOMOverlayPageObject {
|
||||
get input() {
|
||||
const locator = page.getByTestId('dialog-input');
|
||||
const saveButton = page.getByTestId('input-dialog-save-button');
|
||||
const cancelButton = page.getByTestId('input-dialog-cancel-button');
|
||||
return {
|
||||
locator,
|
||||
fill: async (text: string) => {
|
||||
@@ -45,6 +46,13 @@ export class DOMOverlayPageObject {
|
||||
save: async () => {
|
||||
await saveButton.click();
|
||||
},
|
||||
fillAndCancel: async (text: string) => {
|
||||
await locator.fill(text);
|
||||
await cancelButton.click();
|
||||
},
|
||||
cancel: async () => {
|
||||
await cancelButton.click();
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -60,6 +60,19 @@ export class RightPanelPageObject {
|
||||
await this.page.getByTestId('Rename').click();
|
||||
await this.DOMOverlayPageObject.dialog.input.fillAndSave(text);
|
||||
},
|
||||
cancelRename: async (newName?: string) => {
|
||||
await actionsButton.click();
|
||||
await this.page.getByTestId('Rename').click();
|
||||
if (newName) {
|
||||
await this.DOMOverlayPageObject.dialog.input.fillAndCancel(newName);
|
||||
} else {
|
||||
await this.DOMOverlayPageObject.dialog.input.cancel();
|
||||
}
|
||||
},
|
||||
duplicate: async () => {
|
||||
await actionsButton.click();
|
||||
await this.page.getByTestId('Duplicate').click();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,7 +87,7 @@ export class RightPanelPageObject {
|
||||
return row.getByTestId('data-row-title');
|
||||
},
|
||||
click: async () => {
|
||||
await row.click();
|
||||
await row.getByTestId('data-row-title').click();
|
||||
},
|
||||
locator: row,
|
||||
toggleVisibility: async () => {
|
||||
@@ -161,6 +174,19 @@ export class RightPanelPageObject {
|
||||
};
|
||||
}
|
||||
|
||||
private getSegmentsVisibilityToggle(type?: string) {
|
||||
const testId = type
|
||||
? `all-segments-visibility-toggle-${type}`
|
||||
: 'all-segments-visibility-toggle';
|
||||
const button = this.page.getByTestId(testId);
|
||||
return {
|
||||
button,
|
||||
click: async () => {
|
||||
await button.click();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private getSegmentationPanel(typeSuffix?: string) {
|
||||
const page = this.page;
|
||||
const getSegmentByIdx = (index: number) => this.getPanelRowByIdx(index);
|
||||
@@ -189,10 +215,12 @@ export class RightPanelPageObject {
|
||||
const panel = this.getSegmentationPanel('Contour');
|
||||
const menuButton = page.getByTestId('panelSegmentationWithToolsContour-btn');
|
||||
const segmentationSelect = this.getSegmentationSelect('Contour');
|
||||
const segmentsVisibilityToggle = this.getSegmentsVisibilityToggle('Contour');
|
||||
|
||||
return {
|
||||
addSegmentationButton,
|
||||
menuButton,
|
||||
segmentsVisibilityToggle,
|
||||
panel,
|
||||
segmentationSelect,
|
||||
select: async () => {
|
||||
|
||||
Reference in new issue
Block a user