feat: add more e2e tests for MPR and add test mode and extension (#3180)

* tests: add various e2e tests for MPR and measurements

wip

add cypress config

feat: add mode and extension for testing

add hp applied through search params

add MPR tests

apply review comments

add more e2e tests

update yarn lock

* fix unit tests failing
This commit is contained in:
Alireza authored and GitHub committed 2023-02-17 15:04:07 -05:00
1 parent ae4183852f
commit 926290f69e
83 files changed
+6286 -6860

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@
"lodash": "^4.17.21"
},
"dependencies": {
"@babel/runtime": "7.17.9",
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "0.3.0",
"@cornerstonejs/core": "0.30.1",
"@cornerstonejs/streaming-image-volume-loader": "^0.11.2",
+8 -2
View File
@@ -77,7 +77,10 @@ export default async function init({
window.services = servicesManager.services;
if (!window.crossOriginIsolated) {
if (
appConfig.showWarningMessageForCrossOrigin &&
!window.crossOriginIsolated
) {
uiNotificationService.show({
title: 'Cross Origin Isolation',
message:
@@ -86,7 +89,10 @@ export default async function init({
});
}
if (cornerstone.getShouldUseCPURendering()) {
if (
appConfig.showCPUFallbackMessage &&
cornerstone.getShouldUseCPURendering()
) {
_showCPURenderingModal(uiModalService, hangingProtocolService);
}
@@ -59,6 +59,7 @@ function callInputDialog(
autoFocus
className="mt-2 bg-black border-primary-main"
type="text"
id="annotation"
containerClassName="mr-2"
value={value.label}
onChange={event => {
@@ -58,26 +58,20 @@ export default function toggleMPRHangingProtocol({
const viewportDisplaySetInstanceUIDs =
viewports[activeViewportIndex].displaySetInstanceUIDs;
const errorCallback = error => {
// Unable to create MPR, so be sure to return to the cached/original protocol.
hangingProtocolService.setProtocol(
cachedState.protocol.id,
viewportMatchDetails,
restoreErrorCallback
);
// What is the current active protocol and stage number to restore later
const { protocol, stage } = hangingProtocolService.getActiveProtocol();
const restoreErrorCallback = error => {
console.error(error);
uiNotificationService.show({
title: 'Multiplanar reconstruction (MPR) ',
message:
'Cannot create MPR for this DisplaySet since it is not reconstructable.',
'Something went wrong while trying to restore the previous layout.',
type: 'info',
duration: 3000,
});
};
// What is the current active protocol and stage number to restore later
const { protocol, stage } = hangingProtocolService.getActiveProtocol();
if (toggledState) {
resetCachedState();
@@ -109,6 +103,23 @@ export default function toggleMPRHangingProtocol({
getToolGroup
);
const errorCallback = error => {
// Unable to create MPR, so be sure to return to the cached/original protocol.
hangingProtocolService.setProtocol(
cachedState.protocol.id,
viewportMatchDetails,
restoreErrorCallback
);
uiNotificationService.show({
title: 'Multiplanar reconstruction (MPR) ',
message:
'Cannot create MPR for this DisplaySet since it is not reconstructable.',
type: 'info',
duration: 3000,
});
};
hangingProtocolService.setProtocol(
MPR_TOOLGROUP_ID,
matchDetails,
@@ -117,16 +128,6 @@ export default function toggleMPRHangingProtocol({
return;
}
const restoreErrorCallback = error => {
uiNotificationService.show({
title: 'Multiplanar reconstruction (MPR) ',
message:
'Something went wrong while trying to restore the previous layout.',
type: 'info',
duration: 3000,
});
};
_disableCrosshairs([MPR_TOOLGROUP_ID], getToolGroup);
const { layoutType, properties } = cachedState.viewportStructure;