Improvements on VTK visual tests

This commit is contained in:
Mirna Silva 2020-01-07 16:52:28 -03:00
parent 341cc5a4eb
commit 9be54f6164

View File

@ -1,28 +1,17 @@
describe('Visual Regression - OHIF VTK Extension', () => { describe('Visual Regression - OHIF VTK Extension', () => {
before(() => { before(() => {
cy.openStudy('Juno'); cy.openStudy('Bellona');
cy.waitDicomImage(); cy.waitDicomImage();
cy.expectMinimumThumbnails(7); cy.expectMinimumThumbnails(5);
});
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();
//Waiting for the desired thumbnail content to be displayed //Waiting for the desired thumbnail content to be displayed
cy.get('[data-cy="thumbnail-list"]').should($list => { 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 // Drag and drop thumbnail into viewport
// 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
cy.get('[data-cy="thumbnail-list"]') cy.get('[data-cy="thumbnail-list"]')
.contains('CT WB 5.0 B35f') .contains('Chest 1x10 Soft')
.drag('.viewport-drop-target'); .drag('.viewport-drop-target');
//Select 2D MPR button //Select 2D MPR button
@ -30,8 +19,18 @@ describe('Visual Regression - OHIF VTK Extension', () => {
//Wait Reformatting Images //Wait Reformatting Images
cy.waitVTKReformatting(); cy.waitVTKReformatting();
});
beforeEach(() => {
cy.initVTKToolsAliases(); 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', () => { it('checks if VTK buttons are displayed on the toolbar', () => {