Merge pull request #1383 from mirnasilva/percy-ci-fix

Percy ci fix
This commit is contained in:
Mirna Silva 2020-01-17 19:14:16 -03:00 committed by GitHub
commit b5db09c25e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 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

@ -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;
});
});