ohif-viewer/tests/ContextMenu.spec.ts
Joe Boccanfuso 24e0263fb9
chore: recovery 2 (#5014) merge to 3.11 (#5175)
Co-authored-by: Alireza <ar.sedghi@gmail.com>
Co-authored-by: Dan Rukas <dan.rukas@gmail.com>
Co-authored-by: Tang Cheng <45505657+tctco@users.noreply.github.com>
2025-07-03 14:08:46 -04:00

55 lines
1.4 KiB
TypeScript

import { test } from 'playwright-test-coverage';
import {
visitStudy,
checkForScreenshot,
screenShotPaths,
simulateNormalizedClicksOnElement,
simulateNormalizedClickOnElement,
} from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
test('should the context menu completely on screen and is not clipped for a point near the bottom edge of the screen', async ({
page,
}) => {
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 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 checkForScreenshot({
page,
locator: page,
screenshotPath: screenShotPaths.contextMenu.contextMenuNearBottomEdgeNotClipped,
});
});