test(contour): contour color change coverage (#6042)
This commit is contained in:
1 parent
419366bd25
commit
5955151ba1
5 files changed
+242
-2
No files matched your search
@@ -60,6 +60,39 @@ export class DOMOverlayPageObject {
|
||||
return new DicomTagBrowserPageObject(page);
|
||||
},
|
||||
|
||||
get colorPicker() {
|
||||
const locator = page.getByTestId('color-picker-dialog');
|
||||
const hexInput = locator.getByLabel('hex');
|
||||
const saveButton = locator.getByTestId('color-picker-save-btn');
|
||||
const cancelButton = locator.getByTestId('color-picker-cancel-btn');
|
||||
return {
|
||||
locator,
|
||||
hexInput,
|
||||
saveButton,
|
||||
cancelButton,
|
||||
fillHex: async (hex: string) => {
|
||||
await hexInput.fill(hex);
|
||||
await hexInput.press('Enter');
|
||||
},
|
||||
save: async () => {
|
||||
await saveButton.click();
|
||||
},
|
||||
cancel: async () => {
|
||||
await cancelButton.click();
|
||||
},
|
||||
fillHexAndSave: async (hex: string) => {
|
||||
await hexInput.fill(hex);
|
||||
await hexInput.press('Enter');
|
||||
await saveButton.click();
|
||||
},
|
||||
fillHexAndCancel: async (hex: string) => {
|
||||
await hexInput.fill(hex);
|
||||
await hexInput.press('Enter');
|
||||
await cancelButton.click();
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
title: page.locator('[role="dialog"] h2'),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -73,6 +73,26 @@ export class RightPanelPageObject {
|
||||
await actionsButton.click();
|
||||
await this.page.getByTestId('Duplicate').click();
|
||||
},
|
||||
openChangeColor: async () => {
|
||||
await actionsButton.click();
|
||||
await this.page.getByTestId('Change Color').click();
|
||||
},
|
||||
changeColor: async (hex: string) => {
|
||||
await actionsButton.click();
|
||||
await this.page.getByTestId('Change Color').click();
|
||||
await this.DOMOverlayPageObject.dialog.colorPicker.fillHexAndSave(hex);
|
||||
},
|
||||
// This function assumes the user opens the change color dialog,
|
||||
// but then cancels out of it instead of saving a new color.
|
||||
cancelChangeColor: async (hex?: string) => {
|
||||
await actionsButton.click();
|
||||
await this.page.getByTestId('Change Color').click();
|
||||
if (hex) {
|
||||
await this.DOMOverlayPageObject.dialog.colorPicker.fillHexAndCancel(hex);
|
||||
} else {
|
||||
await this.DOMOverlayPageObject.dialog.colorPicker.cancel();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -86,6 +106,9 @@ export class RightPanelPageObject {
|
||||
get title() {
|
||||
return row.getByTestId('data-row-title');
|
||||
},
|
||||
get rowDataColorHex() {
|
||||
return row.getByTestId('data-row-colorhex');
|
||||
},
|
||||
click: async () => {
|
||||
await row.getByTestId('data-row-title').click();
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user