tests(Playwright): Introduction of Page Object Models (POMs) to Playwright tests (#5557)
This commit is contained in:
1 parent
1c991037ee
commit
bdad2264ed
59 files changed
+1040
-756
No files matched your search
@@ -1,7 +1,5 @@
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
import { checkForScreenshot, screenShotPaths, test, visitStudy } from './utils';
|
||||
import { assertNumberOfModalityLoadBadges } from './utils/assertions';
|
||||
import { viewportLocator } from './utils/locators';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
const studyInstanceUID = '1.3.6.1.4.1.5962.99.1.2968617883.1314880426.1493322302363.3.0';
|
||||
@@ -11,9 +9,10 @@ test.beforeEach(async ({ page }) => {
|
||||
|
||||
test('should launch MPR with unhydrated RTSTRUCT chosen from the data overlay menu', async ({
|
||||
page,
|
||||
mainToolbarPageObject,
|
||||
viewportPageObject,
|
||||
}) => {
|
||||
await page.getByTestId('Layout').click();
|
||||
await page.getByTestId('MPR').click();
|
||||
await mainToolbarPageObject.layoutSelection.MPR.click();
|
||||
|
||||
// Wait 5 seconds for MPR to load. This is necessary in particular when screen shots are added or replaced.
|
||||
await page.waitForTimeout(10000);
|
||||
@@ -25,14 +24,14 @@ test('should launch MPR with unhydrated RTSTRUCT chosen from the data overlay me
|
||||
);
|
||||
|
||||
// Hover over the middle/sagittal viewport so that the data overlay menu is available.
|
||||
await viewportLocator({ viewportId: 'mpr-sagittal', page }).hover();
|
||||
await page.getByTestId('dataOverlayMenu-mpr-sagittal-btn').click();
|
||||
await viewportPageObject.getById('mpr-sagittal').pane.hover();
|
||||
await viewportPageObject.getById('mpr-sagittal').overlayMenu.dataOverlay.click();
|
||||
await page.getByTestId('AddSegmentationDataOverlay-mpr-sagittal').click();
|
||||
await page.getByText('SELECT A SEGMENTATION').click();
|
||||
await page.getByTestId('ARIA RadOnc Structure Sets').click();
|
||||
|
||||
// Hide the overlay menu.
|
||||
await page.getByTestId('dataOverlayMenu-mpr-sagittal-btn').click();
|
||||
await viewportPageObject.getById('mpr-sagittal').overlayMenu.dataOverlay.click();
|
||||
|
||||
// Adding an overlay should not show the LOAD button.
|
||||
assertNumberOfModalityLoadBadges({ page, expectedCount: 0 });
|
||||
|
||||
Reference in new issue
Block a user