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,11 +1,4 @@
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
checkForScreenshot,
|
||||
screenShotPaths,
|
||||
simulateNormalizedClicksOnElement,
|
||||
simulateNormalizedClickOnElement,
|
||||
} from './utils';
|
||||
import { checkForScreenshot, screenShotPaths, test, visitStudy } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
|
||||
@@ -15,36 +8,20 @@ test.beforeEach(async ({ page }) => {
|
||||
|
||||
test('should the context menu completely on screen and is not clipped for a point near the bottom edge of the screen', async ({
|
||||
page,
|
||||
mainToolbarPageObject,
|
||||
viewportPageObject,
|
||||
}) => {
|
||||
await page.getByTestId('MeasurementTools-split-button-secondary').click();
|
||||
await page.locator('css=div[data-cy="Length"]').click();
|
||||
const locator = page.getByTestId('viewport-pane').locator('canvas');
|
||||
await simulateNormalizedClicksOnElement({
|
||||
locator,
|
||||
normalizedPoints: [
|
||||
{
|
||||
x: 0.45,
|
||||
y: 0.98,
|
||||
},
|
||||
{
|
||||
x: 0.55,
|
||||
y: 0.98,
|
||||
},
|
||||
],
|
||||
});
|
||||
await mainToolbarPageObject.measurementTools.length.click();
|
||||
await viewportPageObject.active.normalizedClickAt([
|
||||
{ x: 0.45, y: 0.98 },
|
||||
{ x: 0.55, y: 0.98 },
|
||||
]);
|
||||
|
||||
await page.getByTestId('prompt-begin-tracking-yes-btn').click();
|
||||
|
||||
await checkForScreenshot(page, page, screenShotPaths.contextMenu.preContextMenuNearBottomEdge);
|
||||
|
||||
await simulateNormalizedClickOnElement({
|
||||
locator,
|
||||
normalizedPoint: {
|
||||
x: 0.55,
|
||||
y: 0.98,
|
||||
},
|
||||
button: 'right',
|
||||
});
|
||||
await viewportPageObject.active.normalizedClickAt([{ x: 0.55, y: 0.98 }], 'right');
|
||||
|
||||
await checkForScreenshot({
|
||||
page,
|
||||
|
||||
Reference in new issue
Block a user