2025-04-16 15:56:52 -04:00
|
|
|
import { Page } from 'playwright-test-coverage';
|
2024-05-21 14:48:35 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Visit the study
|
|
|
|
|
* @param page - The page to interact with
|
|
|
|
|
* @param title - The study instance UID of the study to visit
|
|
|
|
|
* @param mode - The mode to visit the study in
|
2024-06-05 13:09:53 -04:00
|
|
|
* @param delay - The delay to wait after visiting the study
|
2024-07-09 11:13:07 -04:00
|
|
|
* @param datasources - the data source to load the study from
|
2024-05-21 14:48:35 -04:00
|
|
|
*/
|
2024-06-05 13:09:53 -04:00
|
|
|
export async function visitStudy(
|
|
|
|
|
page: Page,
|
|
|
|
|
studyInstanceUID: string,
|
|
|
|
|
mode: string,
|
2024-07-09 11:13:07 -04:00
|
|
|
delay: number = 0,
|
|
|
|
|
datasources = 'ohif'
|
2024-06-05 13:09:53 -04:00
|
|
|
) {
|
2025-01-29 13:36:52 -05:00
|
|
|
// await page.goto(`/?resultsPerPage=100&datasources=${datasources}`);
|
|
|
|
|
// await page.getByTestId(studyInstanceUID).click();
|
|
|
|
|
// await page.getByRole('button', { name: mode }).click();
|
|
|
|
|
await page.goto(`/${mode}/${datasources}?StudyInstanceUIDs=${studyInstanceUID}`);
|
2024-05-21 14:48:35 -04:00
|
|
|
await page.waitForLoadState('domcontentloaded');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
2024-06-05 13:09:53 -04:00
|
|
|
await page.waitForTimeout(delay);
|
2024-05-21 14:48:35 -04:00
|
|
|
}
|