tests: Test cases implemented: Cornerstone tools Clear and Eraser; Measurement panel Relabel and Description (#1014)
* Fix for test scripts that were failing in CI
* Test cases for tools: Length and Angle
* Test cases implemented: Scroll series, Levels, Pan, Reset, Zoom
* Added test cases for tools: Cine, More, Layout, Invert, Rotate, FlipH, FlipV
* Fixes made according to comments on PR review
* Fixes for failing scenarios: Layout and Cine
* Test cases implemented: Cornerstone tools Clear and Eraser; Measurement panel Relabel and Description
* Fix for CI failure
2019-10-10 21:46:41 +02:00
|
|
|
//Creating aliases for Cornerstone tools buttons
|
|
|
|
|
export function initCornerstoneToolsAliases() {
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="StackScroll"]').as('stackScrollBtn');
|
|
|
|
|
cy.get('[data-cy="Zoom"]').as('zoomBtn');
|
2022-07-27 18:39:04 +02:00
|
|
|
cy.get('[data-cy="WindowLevel-split-button-primary"]').as('wwwcBtnPrimary');
|
2023-09-01 22:19:39 +02:00
|
|
|
cy.get('[data-cy="WindowLevel-split-button-secondary"]').as('wwwcBtnSecondary');
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="Pan"]').as('panBtn');
|
2023-09-01 22:19:39 +02:00
|
|
|
cy.get('[data-cy="MeasurementTools-split-button-primary"]').as('measurementToolsBtnPrimary');
|
|
|
|
|
cy.get('[data-cy="MeasurementTools-split-button-secondary"]').as('measurementToolsBtnSecondary');
|
2022-07-27 18:39:04 +02:00
|
|
|
// cy.get('[data-cy="Angle"]').as('angleBtn');
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="MoreTools-split-button-primary"]').as('moreBtnPrimary');
|
|
|
|
|
cy.get('[data-cy="MoreTools-split-button-secondary"]').as('moreBtnSecondary');
|
|
|
|
|
cy.get('[data-cy="Layout"]').as('layoutBtn');
|
2022-07-27 18:39:04 +02:00
|
|
|
cy.get('.cornerstone-viewport-element').as('viewport');
|
tests: Test cases implemented: Cornerstone tools Clear and Eraser; Measurement panel Relabel and Description (#1014)
* Fix for test scripts that were failing in CI
* Test cases for tools: Length and Angle
* Test cases implemented: Scroll series, Levels, Pan, Reset, Zoom
* Added test cases for tools: Cine, More, Layout, Invert, Rotate, FlipH, FlipV
* Fixes made according to comments on PR review
* Fixes for failing scenarios: Layout and Cine
* Test cases implemented: Cornerstone tools Clear and Eraser; Measurement panel Relabel and Description
* Fix for CI failure
2019-10-10 21:46:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Creating aliases for Common page elements
|
2024-07-05 19:08:48 +02:00
|
|
|
export function initCommonElementsAliases(skipMarkers) {
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="trackedMeasurements-btn"]').as('measurementsBtn');
|
2022-07-27 18:39:04 +02:00
|
|
|
cy.get('.cornerstone-viewport-element').as('viewport');
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="seriesList-btn"]').as('seriesBtn');
|
2022-11-16 20:19:52 +01:00
|
|
|
cy.get('[data-cy="side-panel-header-right"]').as('RightCollapseBtn');
|
|
|
|
|
cy.get('[data-cy="side-panel-header-left"]').as('LeftCollapseBtn');
|
|
|
|
|
|
|
|
|
|
// click on the measurements button
|
|
|
|
|
cy.get('[data-cy="trackedMeasurements-btn"]').click();
|
2021-03-01 16:52:54 +01:00
|
|
|
|
|
|
|
|
// TODO: Panels are not in DOM when closed, move this somewhere else
|
|
|
|
|
cy.get('[data-cy="trackedMeasurements-panel"]').as('measurementsPanel');
|
2024-11-12 19:14:47 +01:00
|
|
|
cy.get('[data-cy="panelSegmentation-btn"]').as('segmentationPanel');
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="studyBrowser-panel"]').as('seriesPanel');
|
|
|
|
|
cy.get('[data-cy="viewport-overlay-top-right"]').as('viewportInfoTopRight');
|
|
|
|
|
cy.get('[data-cy="viewport-overlay-top-left"]').as('viewportInfoTopLeft');
|
2023-09-01 22:19:39 +02:00
|
|
|
cy.get('[data-cy="viewport-overlay-bottom-right"]').as('viewportInfoBottomRight');
|
|
|
|
|
cy.get('[data-cy="viewport-overlay-bottom-left"]').as('viewportInfoBottomLeft');
|
2021-03-01 16:52:54 +01:00
|
|
|
|
2024-07-05 19:08:48 +02:00
|
|
|
console.debug('🚀 ~ skipMarkers:', skipMarkers);
|
|
|
|
|
if (skipMarkers) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
cy.get('.left-mid.orientation-marker')?.as('viewportInfoMidLeft');
|
|
|
|
|
cy.get('.top-mid.orientation-marker')?.as('viewportInfoMidTop');
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log('Error: ', error);
|
|
|
|
|
}
|
tests: Test cases implemented: Cornerstone tools Clear and Eraser; Measurement panel Relabel and Description (#1014)
* Fix for test scripts that were failing in CI
* Test cases for tools: Length and Angle
* Test cases implemented: Scroll series, Levels, Pan, Reset, Zoom
* Added test cases for tools: Cine, More, Layout, Invert, Rotate, FlipH, FlipV
* Fixes made according to comments on PR review
* Fixes for failing scenarios: Layout and Cine
* Test cases implemented: Cornerstone tools Clear and Eraser; Measurement panel Relabel and Description
* Fix for CI failure
2019-10-10 21:46:41 +02:00
|
|
|
}
|
2019-10-16 17:39:41 +02:00
|
|
|
|
|
|
|
|
//Creating aliases for Routes
|
|
|
|
|
export function initRouteAliases() {
|
2023-09-01 22:19:39 +02:00
|
|
|
cy.intercept('GET', '**/series**', { statusCode: 200, body: [] }).as('getStudySeries');
|
2023-02-17 21:04:07 +01:00
|
|
|
|
|
|
|
|
// Todo: for some reason cypress does not redirect to the correct url
|
|
|
|
|
// so we intercept the request and redirect it to the correct url
|
|
|
|
|
cy.intercept('/studies?limit*', req => {
|
|
|
|
|
const url = req.url.replace(/\/studies\?/, '/studies/?limit');
|
|
|
|
|
req.url = url;
|
|
|
|
|
});
|
2019-10-16 17:39:41 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-06 05:46:38 +01:00
|
|
|
//Creating aliases for Study List page elements on Desktop experience
|
|
|
|
|
export function initStudyListAliasesOnDesktop() {
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('[data-cy="num-studies"]').as('numStudies');
|
|
|
|
|
cy.get('[data-cy="input-patientName"]').as('PatientName');
|
|
|
|
|
cy.get('[data-cy="input-mrn"]').as('MRN');
|
|
|
|
|
cy.get('[data-cy="input-accession"]').as('AccessionNumber');
|
|
|
|
|
cy.get('[data-cy="input-description"]').as('StudyDescription');
|
|
|
|
|
cy.get('[data-cy="study-list-results"]').as('searchResult');
|
|
|
|
|
cy.get('[data-cy="study-list-results"] > tr').as('searchResult2');
|
2019-11-06 05:46:38 +01:00
|
|
|
|
2021-03-01 16:52:54 +01:00
|
|
|
// We can't use data attributes (e.g. data--cy) for these since
|
2023-09-12 13:40:38 +02:00
|
|
|
// they are using third party libraries (i.e. react-dates, react-select)
|
2024-05-27 20:30:25 +02:00
|
|
|
cy.get('[data-cy="input-date-range-start"').as('studyListStartDate');
|
|
|
|
|
cy.get('[data-cy="input-date-range-end"').as('studyListEndDate');
|
2021-03-01 16:52:54 +01:00
|
|
|
cy.get('#input-modalities').as('modalities');
|
2019-11-06 05:46:38 +01:00
|
|
|
}
|
2019-11-20 20:15:10 +01:00
|
|
|
|
|
|
|
|
//Creating aliases for User Preferences modal
|
|
|
|
|
export function initPreferencesModalAliases() {
|
|
|
|
|
cy.get('.OHIFModal').as('preferencesModal');
|
2019-12-20 20:07:00 +01:00
|
|
|
cy.get('[data-cy="hotkeys"]').as('userPreferencesHotkeysTab');
|
|
|
|
|
cy.get('[data-cy="general"]').as('userPreferencesGeneralTab');
|
2020-03-26 02:46:28 +01:00
|
|
|
cy.get('[data-cy="window-level"]').as('userPreferencesWindowLevelTab');
|
2020-02-12 21:35:04 +01:00
|
|
|
initPreferencesModalFooterBtnAliases();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Creating aliases for User Preferences modal
|
|
|
|
|
export function initPreferencesModalFooterBtnAliases() {
|
|
|
|
|
cy.get('.active [data-cy="reset-default-btn"]').as('restoreBtn');
|
|
|
|
|
cy.get('.active [data-cy="cancel-btn"]').as('cancelBtn');
|
|
|
|
|
cy.get('.active [data-cy="save-btn"]').as('saveBtn');
|
2019-11-20 20:15:10 +01:00
|
|
|
}
|