From 9be54f6164153a86577d18ddce130f2a993bb15b Mon Sep 17 00:00:00 2001 From: Mirna Silva Date: Tue, 7 Jan 2020 16:52:28 -0300 Subject: [PATCH] Improvements on VTK visual tests --- .../PercyCheckOHIFExtensionVTK.spec.js | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/platform/viewer/cypress/integration/visual-regression/PercyCheckOHIFExtensionVTK.spec.js b/platform/viewer/cypress/integration/visual-regression/PercyCheckOHIFExtensionVTK.spec.js index 7aacf5197..66512f7f4 100644 --- a/platform/viewer/cypress/integration/visual-regression/PercyCheckOHIFExtensionVTK.spec.js +++ b/platform/viewer/cypress/integration/visual-regression/PercyCheckOHIFExtensionVTK.spec.js @@ -1,28 +1,17 @@ describe('Visual Regression - OHIF VTK Extension', () => { before(() => { - cy.openStudy('Juno'); + cy.openStudy('Bellona'); cy.waitDicomImage(); - cy.expectMinimumThumbnails(7); - }); - - beforeEach(() => { - //TODO: Due to percy snapshot, the images inside the viewports are being resized - //and once the browser continues the test execution, the images are not centered in the viewport. - //To fix that, we need to reload the page before each test. - //https://github.com/OHIF/Viewers/issues/1168 - cy.reload(); + cy.expectMinimumThumbnails(5); //Waiting for the desired thumbnail content to be displayed cy.get('[data-cy="thumbnail-list"]').should($list => { - expect($list).to.contain('CT WB 5.0 B35f'); + expect($list).to.contain('Chest 1x10 Soft'); }); - // TODO: We shouldn't have to drag the thumbnail - // This is a known bug; 2D MPR button does not show until viewport - // has data from a drag-n-drop - // Drag and drop third thumbnail into first viewport + // Drag and drop thumbnail into viewport cy.get('[data-cy="thumbnail-list"]') - .contains('CT WB 5.0 B35f') + .contains('Chest 1x10 Soft') .drag('.viewport-drop-target'); //Select 2D MPR button @@ -30,8 +19,18 @@ describe('Visual Regression - OHIF VTK Extension', () => { //Wait Reformatting Images cy.waitVTKReformatting(); + }); + beforeEach(() => { cy.initVTKToolsAliases(); + cy.wait(100); //Wait toolbar to finish loading + }); + + afterEach(() => { + //Select Exit 2D MPR button + cy.get('[data-cy="exit 2d mpr"]').click(); + //Select 2D MPR button + cy.get('[data-cy="2d mpr"]').click(); }); it('checks if VTK buttons are displayed on the toolbar', () => {