- {toolbarButtons.map((toolDef, index) => {
+ {toolbarButtons?.map((toolDef, index) => {
if (!toolDef) {
return null;
}
diff --git a/platform/ui/src/contextProviders/Toolbox/toolboxReducer.ts b/platform/ui/src/contextProviders/Toolbox/toolboxReducer.ts
deleted file mode 100644
index c97df9938..000000000
--- a/platform/ui/src/contextProviders/Toolbox/toolboxReducer.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-export function toolboxReducer(state, action) {
- let newState = { ...state };
-
- const { payload } = action;
-
- switch (action.type) {
- case 'SET_ACTIVE_TOOL':
- newState = {
- ...state,
- activeTool: payload.activeTool,
- };
- break;
- case 'UPDATE_TOOL_OPTION':
- newState = {
- ...state,
- toolOptions: {
- ...state.toolOptions,
- [payload.toolName]: state.toolOptions[payload.toolName].map(option =>
- option.id === payload.optionName ? { ...option, value: payload.value } : option
- ),
- },
- };
- break;
- case 'INITIALIZE_TOOL_OPTIONS':
- // eslint-disable-next-line no-case-declarations
- const newToolOptions = Object.keys(payload?.toolOptions || {}).reduce((acc, toolId) => {
- const tool = payload.toolOptions[toolId];
- if (state.toolOptions[toolId]) {
- // Preserve existing options, potentially merging with new ones if necessary
- acc[toolId] = state.toolOptions[toolId].map(existingOption => {
- const initialOption = tool.find(option => option.id === existingOption.id);
- return initialOption
- ? { ...initialOption, value: existingOption.value }
- : existingOption;
- });
- } else {
- acc[toolId] = tool;
- }
- return acc;
- }, {});
-
- newState = {
- ...state,
- toolOptions: newToolOptions,
- };
- break;
- default:
- break;
- }
-
- return newState;
-}
diff --git a/playwright.config.ts b/playwright.config.ts
index 4f1bca940..e9cd32dfc 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -38,7 +38,7 @@ export default defineConfig({
//},
],
webServer: {
- command: 'yarn test:e2e:serve',
+ command: 'cross-env APP_CONFIG=config/e2e.js yarn start',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 360_000,
diff --git a/tests/3DFourUp.spec.ts b/tests/3DFourUp.spec.ts
index f54e8c2fc..4b4cadc8f 100644
--- a/tests/3DFourUp.spec.ts
+++ b/tests/3DFourUp.spec.ts
@@ -9,7 +9,7 @@ import {
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/3DMain.spec.ts b/tests/3DMain.spec.ts
index 84164e93a..3c75ef755 100644
--- a/tests/3DMain.spec.ts
+++ b/tests/3DMain.spec.ts
@@ -9,7 +9,7 @@ import {
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/3DOnly.spec.ts b/tests/3DOnly.spec.ts
index 0f2905834..c940f4f02 100644
--- a/tests/3DOnly.spec.ts
+++ b/tests/3DOnly.spec.ts
@@ -9,7 +9,7 @@ import {
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/3DPrimary.spec.ts b/tests/3DPrimary.spec.ts
index 4b9bb335b..ec184587c 100644
--- a/tests/3DPrimary.spec.ts
+++ b/tests/3DPrimary.spec.ts
@@ -9,7 +9,7 @@ import {
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Angle.spec.ts b/tests/Angle.spec.ts
index 88ef1c459..a948b963b 100644
--- a/tests/Angle.spec.ts
+++ b/tests/Angle.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/AxialPrimary.spec.ts b/tests/AxialPrimary.spec.ts
index 8826ed031..ff2b7ec28 100644
--- a/tests/AxialPrimary.spec.ts
+++ b/tests/AxialPrimary.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Bidirectional.spec.ts b/tests/Bidirectional.spec.ts
index 68268480a..4e2c3db09 100644
--- a/tests/Bidirectional.spec.ts
+++ b/tests/Bidirectional.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Circle.spec.ts b/tests/Circle.spec.ts
index c3505f5e0..bbca3111d 100644
--- a/tests/Circle.spec.ts
+++ b/tests/Circle.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/CobbAngle.spec.ts b/tests/CobbAngle.spec.ts
index d142535c2..a0085939e 100644
--- a/tests/CobbAngle.spec.ts
+++ b/tests/CobbAngle.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Crosshairs.spec.ts b/tests/Crosshairs.spec.ts
index 6a98a91bb..461b50756 100644
--- a/tests/Crosshairs.spec.ts
+++ b/tests/Crosshairs.spec.ts
@@ -40,7 +40,7 @@ const increaseSlabThickness = async (page: Page, id: string, lineNumber: number,
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
await initilizeMousePositionTracker(page);
});
diff --git a/tests/DicomTagBrowser.spec.ts b/tests/DicomTagBrowser.spec.ts
index 1e4136c42..337b0101a 100644
--- a/tests/DicomTagBrowser.spec.ts
+++ b/tests/DicomTagBrowser.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Ellipse.spec.ts b/tests/Ellipse.spec.ts
index 3dca6cdd3..2a376c81f 100644
--- a/tests/Ellipse.spec.ts
+++ b/tests/Ellipse.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/FlipHorizontal.spec.ts b/tests/FlipHorizontal.spec.ts
index 7477a050c..437a52229 100644
--- a/tests/FlipHorizontal.spec.ts
+++ b/tests/FlipHorizontal.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Invert.spec.ts b/tests/Invert.spec.ts
index bbff4657c..d0b9a269c 100644
--- a/tests/Invert.spec.ts
+++ b/tests/Invert.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Length.spec.ts b/tests/Length.spec.ts
index 8b6c51f30..719b2192d 100644
--- a/tests/Length.spec.ts
+++ b/tests/Length.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Livewire.spec.ts b/tests/Livewire.spec.ts
index dae68b449..4fa08a1f5 100644
--- a/tests/Livewire.spec.ts
+++ b/tests/Livewire.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/MPR.spec.ts b/tests/MPR.spec.ts
index 66c711ada..4f4326855 100644
--- a/tests/MPR.spec.ts
+++ b/tests/MPR.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils/index.j
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Probe.spec.ts b/tests/Probe.spec.ts
index 1a4fac22f..e6256b4c5 100644
--- a/tests/Probe.spec.ts
+++ b/tests/Probe.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/RTHydration.spec.ts b/tests/RTHydration.spec.ts
index b3638e28d..74e881f34 100644
--- a/tests/RTHydration.spec.ts
+++ b/tests/RTHydration.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.2.840.113619.2.290.3.3767434740.226.1600859119.501';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Rectangle.spec.ts b/tests/Rectangle.spec.ts
index 904e27a35..a4655f6e8 100644
--- a/tests/Rectangle.spec.ts
+++ b/tests/Rectangle.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Reset.spec.ts b/tests/Reset.spec.ts
index b4ca11963..0c6b6ae63 100644
--- a/tests/Reset.spec.ts
+++ b/tests/Reset.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/RotateRight.spec.ts b/tests/RotateRight.spec.ts
index 2f6971a23..9d06144e6 100644
--- a/tests/RotateRight.spec.ts
+++ b/tests/RotateRight.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/SEGHydration.spec.ts b/tests/SEGHydration.spec.ts
index 2077d99fc..b812290d2 100644
--- a/tests/SEGHydration.spec.ts
+++ b/tests/SEGHydration.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.256467663913010332776401703474716742458';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/SRHydration.spec.ts b/tests/SRHydration.spec.ts
index c47c696a2..76f532a1a 100644
--- a/tests/SRHydration.spec.ts
+++ b/tests/SRHydration.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.7695.4007.324475281161490036195179843543';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/Spline.spec.ts b/tests/Spline.spec.ts
index acd4adf6a..bf36ff29a 100644
--- a/tests/Spline.spec.ts
+++ b/tests/Spline.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElemen
test.beforeEach(async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
- const mode = 'Basic Viewer';
+ const mode = 'viewer';
await visitStudy(page, studyInstanceUID, mode, 2000);
});
diff --git a/tests/TMTVAlignment.spec.ts b/tests/TMTVAlignment.spec.ts
index 44ed0bd75..c97832bcc 100644
--- a/tests/TMTVAlignment.spec.ts
+++ b/tests/TMTVAlignment.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, scrollVolumeViewport } from './utils';
test.skip('PT should show slice closest to CT', async ({ page }) => {
const studyInstanceUID = '1.2.840.113619.2.290.3.3767434740.226.1600859119.501';
- const mode = 'Total Metabolic Tumor Volume';
+ const mode = 'tmtv';
await visitStudy(page, studyInstanceUID, mode);
const vp = page.getByTestId('viewport-pane');
diff --git a/tests/TMTVModalityUnit.spec.ts b/tests/TMTVModalityUnit.spec.ts
index ede9b518f..f0540900b 100644
--- a/tests/TMTVModalityUnit.spec.ts
+++ b/tests/TMTVModalityUnit.spec.ts
@@ -10,7 +10,7 @@ test.skip('pets where SUV cannot be calculated should show same unit in TMTV as
page,
}) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.7009.2403.871108593056125491804754960339';
- const mode = 'Total Metabolic Tumor Volume';
+ const mode = 'tmtv';
await visitStudy(page, studyInstanceUID, mode, 10000);
// Change to image where SUV cannot be calculated
diff --git a/tests/TMTVRecalculate.spec.ts b/tests/TMTVRecalculate.spec.ts
index 1601ba627..825f1c5bd 100644
--- a/tests/TMTVRecalculate.spec.ts
+++ b/tests/TMTVRecalculate.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, simulateClicksOnElement, getSUV, clearAllAnnotations } from
test.skip('should update SUV values correctly.', async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.7009.2403.871108593056125491804754960339';
- const mode = 'Total Metabolic Tumor Volume';
+ const mode = 'tmtv';
await visitStudy(page, studyInstanceUID, mode, 10000);
// Create ROI
diff --git a/tests/TMTVRendering.spec.ts b/tests/TMTVRendering.spec.ts
index 918787bfb..27eb74230 100644
--- a/tests/TMTVRendering.spec.ts
+++ b/tests/TMTVRendering.spec.ts
@@ -3,7 +3,7 @@ import { visitStudy, checkForScreenshot, screenShotPaths } from './utils/index.j
test.skip('should render TMTV correctly.', async ({ page }) => {
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.7009.2403.871108593056125491804754960339';
- const mode = 'Total Metabolic Tumor Volume';
+ const mode = 'tmtv';
await visitStudy(page, studyInstanceUID, mode, 10000);
await checkForScreenshot(page, page, screenShotPaths.tmtvRendering.tmtvDisplayedCorrectly, 100);
});
diff --git a/tests/utils/visitStudy.ts b/tests/utils/visitStudy.ts
index 25c9bd80d..628a9c4ad 100644
--- a/tests/utils/visitStudy.ts
+++ b/tests/utils/visitStudy.ts
@@ -15,9 +15,10 @@ export async function visitStudy(
delay: number = 0,
datasources = 'ohif'
) {
- await page.goto(`/?resultsPerPage=100&datasources=${datasources}`);
- await page.getByTestId(studyInstanceUID).click();
- await page.getByRole('button', { name: mode }).click();
+ // 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}`);
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(delay);