diff --git a/platform/viewer/cypress/integration/pwa/OHIFSaveMeasurements.spec.js b/platform/viewer/cypress/integration/pwa/OHIFSaveMeasurements.spec.js index 6afac3e9f..50a21b6b9 100644 --- a/platform/viewer/cypress/integration/pwa/OHIFSaveMeasurements.spec.js +++ b/platform/viewer/cypress/integration/pwa/OHIFSaveMeasurements.spec.js @@ -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(); diff --git a/platform/viewer/cypress/support/commands.js b/platform/viewer/cypress/support/commands.js index e97a749a8..5299fa964 100644 --- a/platform/viewer/cypress/support/commands.js +++ b/platform/viewer/cypress/support/commands.js @@ -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; }); });