test(contour): Add the ContourSegmentToggleLock.spec.ts test file to test contour locking (#6072)

This commit is contained in:
diattamo authored and GitHub committed 2026-06-23 01:52:35 -04:00
1 parent 1f6670c602
commit b24f039735
10 files changed
+253 -55

No files matched your search

+20 -16
View File
@@ -1,18 +1,23 @@
import { expect, test, visitStudy, waitForViewportsRendered, getSvgAttribute } from './utils';
import {
contourShowOnlyNthSegment,
expect,
getSvgAttribute,
test,
visitStudyAndHydrate,
} from './utils';
const studyInstanceUID = '1.2.840.113619.2.290.3.3767434740.226.1600859119.501';
const defaultSegment0Name = 'Threshold';
const defaultSegment1Name = 'Big Sphere';
test.beforeEach(async ({ page, leftPanelPageObject, DOMOverlayPageObject }) => {
const mode = 'segmentation';
await visitStudy(page, studyInstanceUID, mode, 2000);
await leftPanelPageObject.loadSeriesByModality('RTSTRUCT');
await waitForViewportsRendered(page);
await expect(DOMOverlayPageObject.viewport.segmentationHydration.locator).toBeVisible();
await DOMOverlayPageObject.viewport.segmentationHydration.yes.click();
await visitStudyAndHydrate({
page,
leftPanelPageObject,
DOMOverlayPageObject,
studyInstanceUID,
modality: 'RTSTRUCT',
});
});
test('should duplicate a contour segment and add a new row to the panel', async ({
@@ -79,10 +84,9 @@ test('should render the duplicated contour on the viewport', async ({
const panel = rightPanelPageObject.contourSegmentationPanel.panel;
// Hide everything, to be able to grab only the SVG path of the segment to duplicate
await rightPanelPageObject.contourSegmentationPanel.segmentsVisibilityToggle.click();
const segment0 = panel.nthSegment(0);
await segment0.toggleVisibility();
await segment0.click();
const segment0 = await contourShowOnlyNthSegment({
segmentationPanel: rightPanelPageObject.contourSegmentationPanel,
});
const sourceSvgPath = await getSvgAttribute({
viewportPageObject,
@@ -175,9 +179,9 @@ test('should navigate to the correct instance number when a duplicated contour s
).toHaveText('I:46 (46/47)');
//verify the svg paths are the same for the original and duplicated segments
await rightPanelPageObject.contourSegmentationPanel.segmentsVisibilityToggle.click();
await originalSegment.toggleVisibility();
await originalSegment.click();
await contourShowOnlyNthSegment({
segmentationPanel: rightPanelPageObject.contourSegmentationPanel,
});
const originalSegmentSvgPath = await getSvgAttribute({
viewportPageObject,
svgInnerElement: 'path',