Merge pull request #1382 from OHIF/mirna/test/visual-tests

Percy fix for CI failure
This commit is contained in:
Mirna Silva 2020-01-17 19:43:19 -03:00 committed by GitHub
commit 4c9a977920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -6,7 +6,8 @@ describe('OHIF Save Measurements', function() {
beforeEach(() => {
// Drags Study thumbnail into viewport
cy.get('[data-cy="thumbnail-list"]:nth-child(1)')
cy.get('[data-cy="thumbnail-list"]')
.contains('Rheuma')
.scrollIntoView()
.drag('.viewport-drop-target');
@ -56,7 +57,9 @@ describe('OHIF Save Measurements', function() {
cy.get('.sb-success').should('be.visible');
// Reload the page
cy.reload();
cy.reload()
.wait(1000) //Wait page to load
.expectMinimumThumbnails(2); //wait all thumbnails to load
//Verify that recently added measurement was retrieved
cy.get('@measurementsBtn').click();
@ -105,8 +108,7 @@ describe('OHIF Save Measurements', function() {
cy.get('.sb-error')
.should('be.visible')
.and('contains.text', 'Error while saving the measurements');
// Close message overlay
cy.get('.sb-closeIcon').click();
// Close Measurements panel
cy.get('@measurementsBtn').click();
});
@ -135,7 +137,9 @@ describe('OHIF Save Measurements', function() {
.and('contains.text', 'Measurements were saved with success');
// Reload the page
cy.reload();
cy.reload()
.wait(1000) //Wait page to load
.expectMinimumThumbnails(2); //wait all thumbnails to load
//Verify that measurement for unsupported tool was not saved
cy.get('@measurementsBtn').click();

View File

@ -23,10 +23,12 @@ describe('Visual Regression - OHIF VTK Extension', () => {
beforeEach(() => {
cy.initVTKToolsAliases();
cy.wait(100); //Wait toolbar to finish loading
cy.wait(1000); //Wait toolbar to finish loading
});
afterEach(() => {
cy.wait(5000); //wait screen loads back after screenshot
//Select Exit 2D MPR button
cy.get('[data-cy="exit 2d mpr"]').should($btn => {
expect($btn).to.be.visible;

View File

@ -168,7 +168,7 @@ Cypress.Commands.add(
);
Cypress.Commands.add('expectMinimumThumbnails', (seriesToWait = 1) => {
cy.get('[data-cy=thumbnail-list]', { timeout: 10000 }).should($itemList => {
cy.get('[data-cy=thumbnail-list]', { timeout: 20000 }).should($itemList => {
expect($itemList.length >= seriesToWait).to.be.true;
});
});