ohif-viewer/platform/viewer/cypress/integration/common/OHIFStudyViewer.spec.js
Rodrigo Antinarelli 95e5e11d09 test: E2E Tests - Thumbnail loading (#1017)
* fix: E2E Tests - Thumbnail loading

* rename data-cy attr
2019-10-09 12:57:24 -04:00

49 lines
1.5 KiB
JavaScript

describe('OHIF Study Viewer Page', () => {
before(() => {
cy.openStudy('MISTER^MR');
cy.waitDicomImage();
});
it('checks if series thumbnails are being displayed', () => {
cy.get('[data-cy="thumbnail-list"]')
.its('length')
.should('be.gt', 1);
});
it('drags and drop a series thumbnail into viewport', () => {
cy.get('[data-cy="thumbnail-list"]:nth-child(2)') //element to be dragged
.drag('.cornerstone-canvas'); //dropzone element
const overlaySeriesInformation =
'div.ViewportOverlay > div.bottom-left.overlay-element > div';
const expectedText =
'Ser: 2Img: 1 1/13512 x 512Loc: -17.60 mm Thick: 3.00 mm';
cy.get(overlaySeriesInformation).should('have.text', expectedText);
});
it('checks if Series left panel can be hidden/displayed', () => {
const seriesButton =
'.pull-left > .RoundedButtonGroup > .roundedButtonWrapper > .roundedButton';
const leftPanel = 'section.sidepanel.from-left';
cy.get(seriesButton).click();
cy.get(leftPanel).should('not.be.enabled');
cy.get(seriesButton).click();
cy.get(leftPanel).should('be.visible');
});
it('checks if Measurements right panel can be hidden/displayed', () => {
const measurementsButton =
'.pull-right > .RoundedButtonGroup > .roundedButtonWrapper > .roundedButton';
const rightPanel = 'section.sidepanel.from-right';
cy.get(measurementsButton).click();
cy.get(rightPanel).should('be.visible');
cy.get(measurementsButton).click();
cy.get(rightPanel).should('not.be.enabled');
});
});