ohif-viewer/platform/viewer/cypress/integration/pwa/OHIFExtensionHTML.spec.js
Rodrigo Antinarelli 5b334175c3 fix: Set SR viewport as active by interaction (#1118)
* fix: Set SR viewport as active by interaction

* quick fix

* (eslint) add "before" as global variables

* add data-cy

* add data-cy

* create E2E test

* (E2E) create custom command to set layout size

* remove .only e2e

* remove throttle for onScroll
2019-10-29 14:21:56 -04:00

45 lines
1.2 KiB
JavaScript

describe('OHIF HTML Extension', () => {
before(() => {
cy.openStudy('Dummy');
cy.expectMinimumThumbnails(5);
});
it('checks if series thumbnails are being displayed', () => {
cy.get('[data-cy="thumbnail-list"]')
.contains('SR')
.its('length')
.should('to.be.at.least', 1);
});
it('drags and drop a SR thumbnail into viewport', () => {
cy.get('[data-cy="thumbnail-list"]')
.contains('SR')
.first()
.drag('.viewport-drop-target');
cy.get(':nth-child(2) > h1').should(
'contain.text',
'Imaging Measurement Report'
);
});
it('checks if the HTML viewport has been set to active by interaction', () => {
cy.setLayout('3', '3');
// check if viewport has been set as active by CLICKING
cy.get('[data-cy=viewprt-grid] > :nth-child(4)')
.click()
.then($viewport => {
cy.wrap($viewport).should('have.class', 'active');
});
// check if viewport has been set as active by SCROLLING
cy.get('[data-cy=viewprt-grid] > :nth-child(7)').then($viewport => {
cy.wrap($viewport)
.find('[data-cy=dicom-html-viewport]')
.scrollTo('bottom');
cy.wrap($viewport).should('have.class', 'active');
});
});
});