ohif-viewer/tests/mpr2.spec.ts
Bill Wallace 1df671e9ab
feat: Add combined build (#5895)
* Add combined build

* Link script location update

* Security and validation fixes

* Allow specifying target path in PR description

* fix: Version match

* Fix build detection issue

* fix: Playwright deploy

* Separate out the branch merge guard

* Update docs and link info

* test: Update the layout change to wait for network idle

* Move audit late so the rest of the build can be worked on

* Add text with network check to ensure we see this change is updated

* Attempt to fix the mpr loading on ohif-downstream

* PR review comments

* Update docs

* Update to CS3D 4.20.0

* PR comments

* Add log on ohif-integration builds

* Update build test

* Removed unused space to kickoff build
2026-03-17 07:52:17 -04:00

40 lines
1.3 KiB
TypeScript

import { test, visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID =
'1.3.12.2.1107.5.2.32.35162.30000015050317233592200000046&hangingprotocolid=mpr';
const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 10000);
});
test('should properly display MPR for MR', async ({ page, mainToolbarPageObject }) => {
await mainToolbarPageObject.waitForVolumeLoad();
await page.getByTestId('side-panel-header-right').click();
// await page.getByTestId('study-browser-thumbnail-no-image').dblclick();
await checkForScreenshot(page, page, screenShotPaths.mpr2.mprDisplayedCorrectly);
await page.evaluate(() => {
// Access cornerstone directly from the window object
const cornerstone = window.cornerstone;
if (!cornerstone) {
return;
}
const enabledElements = cornerstone.getEnabledElements();
if (enabledElements.length === 0) {
return;
}
// Apply zoom to all viewports
for (let i = 0; i < enabledElements.length; i++) {
const viewport = enabledElements[i].viewport;
if (viewport) {
viewport.setZoom(4);
viewport.render();
}
}
});
await checkForScreenshot(page, page, screenShotPaths.mpr2.mprDisplayedCorrectlyZoomed);
});