fix(cine): prevent crash on second view/hydration of SR series (#5724)
* test: add Playwright test for SR series reload after hydration * docs: remove Playwright VSCode extension video
This commit is contained in:
parent
7bcb6b8a94
commit
f70c9b932d
@ -2,6 +2,11 @@ import { cache, Types } from '@cornerstonejs/core';
|
|||||||
import { utilities } from '@cornerstonejs/tools';
|
import { utilities } from '@cornerstonejs/tools';
|
||||||
|
|
||||||
function _getVolumeFromViewport(viewport: Types.IBaseVolumeViewport) {
|
function _getVolumeFromViewport(viewport: Types.IBaseVolumeViewport) {
|
||||||
|
// Handle non-volume viewports that don't have getAllVolumeIds
|
||||||
|
if (!viewport?.getAllVolumeIds) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const volumeIds = viewport.getAllVolumeIds();
|
const volumeIds = viewport.getAllVolumeIds();
|
||||||
const volumes = volumeIds.map(id => cache.getVolume(id));
|
const volumes = volumeIds.map(id => cache.getVolume(id));
|
||||||
const dynamicVolume = volumes.find(volume => volume.isDynamicVolume());
|
const dynamicVolume = volumes.find(volume => volume.isDynamicVolume());
|
||||||
|
|||||||
@ -162,14 +162,9 @@ If you would like to access the cornerstone3D, services, or command managers in
|
|||||||
}, await page.evaluateHandle('window'));
|
}, await page.evaluateHandle('window'));
|
||||||
```
|
```
|
||||||
|
|
||||||
## Playwright VSCode Extension and Recording Tests
|
## Writing Playwright Tests
|
||||||
|
|
||||||
If you are using VSCode, you can use the Playwright extension to help you write your tests. The extension provides a test runner and many great features such as picking a locator using your mouse, recording a new test, and more. You can install the extension by searching for `Playwright` in the extensions tab in VSCode or by visiting the [Playwright extension page](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright).
|
The following video is an example for adding a `Playwright` test to OHIF.
|
||||||
|
|
||||||
<div style={{padding:"56.25% 0 0 0", position:"relative"}}>
|
|
||||||
<iframe src="https://player.vimeo.com/video/949208495?badge=0&autopause=0&player_id=0&app_id=58479"
|
|
||||||
frameBorder="0" allow="cross-origin-isolated" allowFullScreen style= {{ position:"absolute",top:0,left:0,width:"100%",height:"100%"}} title="Playwright Extension"></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div style={{padding:"56.25% 0 0 0", position:"relative"}}>
|
<div style={{padding:"56.25% 0 0 0", position:"relative"}}>
|
||||||
|
|||||||
36
tests/SRHydrationThenReload.spec.ts
Normal file
36
tests/SRHydrationThenReload.spec.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { checkForScreenshot, screenShotPaths, test, visitStudy } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.7310.5101.860473186348887719777907797922';
|
||||||
|
const mode = 'viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should properly reload SR series after hydration', async ({
|
||||||
|
page,
|
||||||
|
DOMOverlayPageObject,
|
||||||
|
leftPanelPageObject,
|
||||||
|
rightPanelPageObject,
|
||||||
|
}) => {
|
||||||
|
await rightPanelPageObject.toggle();
|
||||||
|
await rightPanelPageObject.measurementsPanel.select();
|
||||||
|
|
||||||
|
await leftPanelPageObject.loadSeriesByModality('SR');
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
await DOMOverlayPageObject.viewport.segmentationHydration.yes.click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await checkForScreenshot(page, page, screenShotPaths.srHydrationThenReload.srAfterHydration);
|
||||||
|
|
||||||
|
const measurementCount = await rightPanelPageObject.measurementsPanel.panel.getMeasurementCount();
|
||||||
|
|
||||||
|
if (measurementCount > 1) {
|
||||||
|
await rightPanelPageObject.measurementsPanel.panel.nthMeasurement(1).click();
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
await leftPanelPageObject.loadSeriesByModality('SR');
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await checkForScreenshot(page, page, screenShotPaths.srHydrationThenReload.srAfterReload);
|
||||||
|
});
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 415 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 419 KiB |
@ -124,6 +124,10 @@ const screenShotPaths = {
|
|||||||
srPreHydration: 'srPreHydration.png',
|
srPreHydration: 'srPreHydration.png',
|
||||||
srJumpToMeasurement: 'srJumpToMeasurement.png',
|
srJumpToMeasurement: 'srJumpToMeasurement.png',
|
||||||
},
|
},
|
||||||
|
srHydrationThenReload: {
|
||||||
|
srAfterHydration: 'srAfterHydration.png',
|
||||||
|
srAfterReload: 'srAfterReload.png',
|
||||||
|
},
|
||||||
segHydration: {
|
segHydration: {
|
||||||
segPostHydration: 'segPostHydration.png',
|
segPostHydration: 'segPostHydration.png',
|
||||||
segPreHydration: 'segPreHydration.png',
|
segPreHydration: 'segPreHydration.png',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user