fix(CinePlayer): always show cine player for dynamic data (#4575)

Co-authored-by: Ibrahim <ibrahim.mdev@gmail.com>
This commit is contained in:
AlirezaandIbrahim authored and GitHub committed 2024-12-05 11:30:21 -05:00
1 parent 72a35ce905
commit b8e8bbe482
20 files changed
+122 -59

No files matched your search

+10 -2
View File
@@ -1,5 +1,11 @@
import { test } from '@playwright/test';
import { visitStudy, checkForScreenshot, screenShotPaths, reduce3DViewportSize } from './utils';
import {
visitStudy,
checkForScreenshot,
screenShotPaths,
reduce3DViewportSize,
attemptAction,
} from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
@@ -15,7 +21,9 @@ test.describe('3D four up Test', async () => {
.filter({ hasText: /^3D four up$/ })
.first()
.click();
await reduce3DViewportSize(page);
await attemptAction(() => reduce3DViewportSize(page), 10, 100);
await checkForScreenshot(
page,
page,
+8 -2
View File
@@ -1,5 +1,11 @@
import { test } from '@playwright/test';
import { visitStudy, checkForScreenshot, screenShotPaths, reduce3DViewportSize } from './utils';
import {
visitStudy,
checkForScreenshot,
screenShotPaths,
reduce3DViewportSize,
attemptAction,
} from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
@@ -15,7 +21,7 @@ test.describe('3D main Test', async () => {
.filter({ hasText: /^3D main$/ })
.first()
.click();
await reduce3DViewportSize(page);
await attemptAction(() => reduce3DViewportSize(page), 10, 100);
await checkForScreenshot(
page,
page,
+8 -2
View File
@@ -1,5 +1,11 @@
import { test } from '@playwright/test';
import { visitStudy, checkForScreenshot, screenShotPaths, reduce3DViewportSize } from './utils';
import {
visitStudy,
checkForScreenshot,
screenShotPaths,
reduce3DViewportSize,
attemptAction,
} from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
@@ -15,7 +21,7 @@ test.describe('3D only Test', async () => {
.filter({ hasText: /^3D only$/ })
.first()
.click();
await reduce3DViewportSize(page);
await attemptAction(() => reduce3DViewportSize(page), 10, 100);
await checkForScreenshot(
page,
page,
+8 -2
View File
@@ -1,5 +1,11 @@
import { test } from '@playwright/test';
import { visitStudy, checkForScreenshot, screenShotPaths, reduce3DViewportSize } from './utils';
import {
visitStudy,
checkForScreenshot,
screenShotPaths,
reduce3DViewportSize,
attemptAction,
} from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
@@ -16,7 +22,7 @@ test.describe('3D primary Test', async () => {
.first()
.click();
await reduce3DViewportSize(page);
await attemptAction(() => reduce3DViewportSize(page), 10, 100);
await checkForScreenshot(
page,
page,
+13 -7
View File
@@ -1,6 +1,11 @@
import { Page, test } from '@playwright/test';
import { visitStudy, checkForScreenshot, screenShotPaths, initilizeMousePositionTracker, getMousePosition } from './utils/index.js';
import {
visitStudy,
checkForScreenshot,
screenShotPaths,
initilizeMousePositionTracker,
getMousePosition,
} from './utils/index.js';
const rotateCrosshairs = async (page: Page, id: string, lineNumber: number) => {
const locator = await page.locator(id).locator('line').nth(lineNumber);
@@ -12,10 +17,10 @@ const rotateCrosshairs = async (page: Page, id: string, lineNumber: number) => {
const position = await getMousePosition(page);
await page.mouse.move(position.x, position.y + 100);
await page.mouse.up();
}
};
const increaseSlabThickness = async (page: Page, id: string, lineNumber: number, axis: string) => {
const locator = await page.locator(id).locator('line').nth(lineNumber)
const locator = await page.locator(id).locator('line').nth(lineNumber);
await locator.click({ force: true });
await locator.hover({ force: true });
const circleLocator = await page.locator(id).locator('rect').first();
@@ -31,7 +36,7 @@ const increaseSlabThickness = async (page: Page, id: string, lineNumber: number,
break;
}
await page.mouse.up();
}
};
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
@@ -73,7 +78,9 @@ test.describe('Crosshairs Test', async () => {
await checkForScreenshot(page, page, screenShotPaths.crosshairs.crosshairsSlabThickness);
});
test('should reset the crosshairs to the initial position when reset is clicked', async ({ page }) => {
test('should reset the crosshairs to the initial position when reset is clicked', async ({
page,
}) => {
await page.getByTestId('Layout').click();
await page.locator('div').filter({ hasText: /^MPR$/ }).first().click();
await page.getByTestId('Crosshairs').click();
@@ -100,5 +107,4 @@ test.describe('Crosshairs Test', async () => {
await checkForScreenshot(page, page, screenShotPaths.crosshairs.crosshairsNewDisplayset);
});
});
+21
View File
@@ -0,0 +1,21 @@
/**
*
* @param action The action function to attempt
* @param attempts The number of attempts to try the action
* @param delay delay between attempts
* @returns True if the action is successful, otherwise throws an error
*/
export const attemptAction = async (action: () => Promise<void>, attempts = 10, delay = 100) => {
for (let i = 1; i < attempts; i++) {
try {
await action();
return true;
} catch (error) {
if (i === attempts) {
throw new Error('Action failed.');
}
await new Promise(resolve => setTimeout(resolve, delay));
}
}
};
+2
View File
@@ -8,6 +8,7 @@ import { getSUV } from './getSUV';
import { getTMTVModalityUnit } from './getTMTVModalityUnit';
import { clearAllAnnotations } from './clearAllAnnotations';
import { scrollVolumeViewport } from './scrollVolumeViewport';
import { attemptAction } from './attemptAction';
export {
visitStudy,
@@ -21,4 +22,5 @@ export {
getTMTVModalityUnit,
clearAllAnnotations,
scrollVolumeViewport,
attemptAction,
};