test(e2e): update Playwright screenshots and add better tests and assertions for area calculations (#6022)
* Add (better) assertions for area calculation fixes. * Add SVG and measurement side panel area for freehand ROI test. * Add Playwright viewport screenshot scope migration guide. * Update cornerstonjs dependencies to 4.22.8. Ensure all versions of @babel/preset-env are 7.29.5. --------- Co-authored-by: Ghadeer Albattarni <165973963+GhadeerAlbattarni@users.noreply.github.com>
This commit is contained in:
1 parent
cb0cbe702c
commit
fe16e80cf3
174 files changed
+1071
-751
No files matched your search
+25
-2
@@ -1,4 +1,11 @@
|
||||
import { checkForScreenshot, screenShotPaths, test, visitStudy, expect } from './utils';
|
||||
import {
|
||||
checkForScreenshot,
|
||||
expect,
|
||||
getAnnotationStats,
|
||||
screenShotPaths,
|
||||
test,
|
||||
visitStudy,
|
||||
} from './utils';
|
||||
import { press } from './utils/keyboardUtils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -24,7 +31,23 @@ test('should display the livewire tool', async ({
|
||||
{ x: 383, y: 461 },
|
||||
]);
|
||||
await DOMOverlayPageObject.viewport.measurementTracking.confirm.click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.livewire.livewireDisplayedCorrectly);
|
||||
|
||||
await checkForScreenshot(
|
||||
page,
|
||||
viewportPageObject.grid,
|
||||
screenShotPaths.livewire.livewireDisplayedCorrectly
|
||||
);
|
||||
|
||||
const livewires = await getAnnotationStats(page, { toolName: 'LivewireContour' });
|
||||
expect(livewires.length).toBeGreaterThan(0);
|
||||
|
||||
const stats = livewires[0].firstTargetStats!;
|
||||
expect(stats.areaUnit).toBe('mm²');
|
||||
expect(Math.round(stats.area as number)).toBe(28906);
|
||||
|
||||
const lines = activeViewport.getSvgAnnotationStatTextLines(livewires[0].annotationUID);
|
||||
await expect(lines).toHaveCount(1);
|
||||
await expect(lines.nth(0)).toHaveText('Area: 28906 mm²');
|
||||
});
|
||||
|
||||
test('should restore viewport interactivity after deleting an in-progress Livewire annotation via context menu', async ({
|
||||
|
||||
Reference in new issue
Block a user