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
@@ -10,16 +10,15 @@ test.beforeEach(async ({ page }) => {
|
||||
|
||||
test('should display multiple segmentation overlays (both SEG and RT)', async ({
|
||||
page,
|
||||
rightPanelPageObject,
|
||||
viewportPageObject,
|
||||
}) => {
|
||||
await page.getByTestId('side-panel-header-right').click();
|
||||
await rightPanelPageObject.toggle();
|
||||
|
||||
// Add multiple segmentation overlays and ensure the overlay menu reflects this change.
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click();
|
||||
|
||||
await page.getByTestId('AddSegmentationDataOverlay-default').click();
|
||||
await page.getByText('SELECT A SEGMENTATION').click();
|
||||
await page.getByTestId('2d-tta_nnU-Net_Segmentation').click();
|
||||
const dataOverlayPageObject = viewportPageObject.getById('default').overlayMenu.dataOverlay;
|
||||
await dataOverlayPageObject.toggle();
|
||||
await dataOverlayPageObject.addSegmentation('2d-tta_nnU-Net_Segmentation');
|
||||
|
||||
// A short wait after each overlay is selected to ensure it loads.
|
||||
await page.waitForTimeout(5000);
|
||||
@@ -27,9 +26,7 @@ test('should display multiple segmentation overlays (both SEG and RT)', async ({
|
||||
// Adding an overlay should not show the LOAD button.
|
||||
assertNumberOfModalityLoadBadges({ page, expectedCount: 0 });
|
||||
|
||||
await page.getByTestId('AddSegmentationDataOverlay-default').click();
|
||||
await page.getByText('SELECT A SEGMENTATION').click();
|
||||
await page.getByTestId('Segmentation').click();
|
||||
await dataOverlayPageObject.addSegmentation('Segmentation');
|
||||
|
||||
// A short wait after each overlay is selected to ensure it loads.
|
||||
await page.waitForTimeout(5000);
|
||||
@@ -37,9 +34,7 @@ test('should display multiple segmentation overlays (both SEG and RT)', async ({
|
||||
// Adding an overlay should not show the LOAD button.
|
||||
assertNumberOfModalityLoadBadges({ page, expectedCount: 0 });
|
||||
|
||||
await page.getByTestId('AddSegmentationDataOverlay-default').click();
|
||||
await page.getByText('SELECT A SEGMENTATION').click();
|
||||
await page.getByTestId('3d_lowres-tta_nnU-Net_Segmentation').click();
|
||||
await dataOverlayPageObject.addSegmentation('3d_lowres-tta_nnU-Net_Segmentation');
|
||||
|
||||
// A short wait after each overlay is selected to ensure it loads.
|
||||
await page.waitForTimeout(5000);
|
||||
@@ -53,15 +48,15 @@ test('should display multiple segmentation overlays (both SEG and RT)', async ({
|
||||
});
|
||||
|
||||
// Hide the overlay menu and then show it again. The overlays from before should still be displayed.
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click(); // hide
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click(); // show
|
||||
await dataOverlayPageObject.toggle(); // hide
|
||||
await dataOverlayPageObject.toggle(); // show
|
||||
|
||||
await checkForScreenshot({
|
||||
page,
|
||||
screenshotPath: screenShotPaths.multipleSegmentationDataOverlays.threeSegOverlaysInOverlayMenu,
|
||||
});
|
||||
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click(); // hide
|
||||
await dataOverlayPageObject.toggle(); // hide
|
||||
|
||||
// Navigate to image 56.
|
||||
await press({ page, key: 'ArrowDown', nTimes: 55 });
|
||||
@@ -74,11 +69,9 @@ test('should display multiple segmentation overlays (both SEG and RT)', async ({
|
||||
});
|
||||
|
||||
// Now add the RT overlay
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click();
|
||||
await dataOverlayPageObject.toggle();
|
||||
|
||||
await page.getByTestId('AddSegmentationDataOverlay-default').click();
|
||||
await page.getByText('SELECT A SEGMENTATION').click();
|
||||
await page.getByTestId('Series 3 - RTSTRUCT').click();
|
||||
await dataOverlayPageObject.addSegmentation('Series 3 - RTSTRUCT');
|
||||
|
||||
// A short wait after each overlay is selected to ensure it loads.
|
||||
await page.waitForTimeout(5000);
|
||||
@@ -92,8 +85,8 @@ test('should display multiple segmentation overlays (both SEG and RT)', async ({
|
||||
});
|
||||
|
||||
// Hide the overlay menu and then show it again. The overlays from before should still be displayed.
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click(); // hide
|
||||
await viewportPageObject.getById('default').overlayMenu.dataOverlay.click(); // show
|
||||
await dataOverlayPageObject.toggle(); // hide
|
||||
await dataOverlayPageObject.toggle(); // show
|
||||
|
||||
await checkForScreenshot({
|
||||
page,
|
||||
|
||||
Reference in new issue
Block a user