ohif-viewer/tests/Worklist.spec.ts
Igor Octaviano 9ca02b4071
fix: Remove dead code and fix rectangle roi rehydration (#5490)
* Remove dead code and fix rectangle roi rehydration

* Revert bun.lock

* Remove hardcoded modality

* Add e2e tests

* Update screewnshots

* Adjustments to tests

* disabvle test for now

* Add test again

* Use ohif data soure

* Revert changes

* Test

* Update testdata to include point

* Improve tests

* Update screenshot

---------

Co-authored-by: Andrey Fedorov <andrey.fedorov@gmail.com>
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2025-11-19 20:04:23 -05:00

45 lines
1.5 KiB
TypeScript

import { test } from 'playwright-test-coverage';
import { checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
await page.goto(`/?datasources=ohif`);
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
});
test('should render scroll bars with the correct look-and-feel', async ({ page }) => {
const studyRowHeader = await page.getByTestId(
'1.3.6.1.4.1.14519.5.2.1.5099.8010.217836670708542506360829799868'
);
await studyRowHeader.scrollIntoViewIfNeeded();
await page.waitForTimeout(3000);
await studyRowHeader.click();
const expandedStudyRow = await page.getByTestId(
'studyRow-1.3.6.1.4.1.14519.5.2.1.5099.8010.217836670708542506360829799868'
);
// Wait for the expanded row to be visible and rendered
await expandedStudyRow.waitFor({ state: 'visible', timeout: 10000 });
await expandedStudyRow.scrollIntoViewIfNeeded();
// Wait for content to load and stabilize, including any lazy-loaded items
await page.waitForTimeout(2000);
// Wait for network to be idle to ensure all content is loaded
await page.waitForLoadState('networkidle');
// Additional wait to ensure scrollbar rendering is stable
await page.waitForTimeout(1000);
await checkForScreenshot({
page,
locator: expandedStudyRow,
normalizedClip: { x: 0.97, y: 0.35, width: 0.03, height: 0.65 },
screenshotPath: screenShotPaths.workList.scrollBarRenderedProperly,
});
});