19049: Add waitfordom to flaky collection test
[arvados-workbench2.git] / cypress / integration / collection.spec.js
index 79a66a4c337f9af7afc16e897f9f7f05ff3598d5..b62a34414fb58b57c4e6ac0d418f14dbce78553f 100644 (file)
@@ -251,9 +251,9 @@ describe('Collection panel tests', function () {
                             .should('contain', 'someKey: someValue')
                             .and('not.contain', 'anotherKey: anotherValue');
                         // Check that the file listing show both read & write operations
-                        cy.get('[data-cy=collection-files-panel]').within(() => {
-                            cy.wait(1000);
-                            cy.root().should('contain', fileName);
+                        cy.waitForDom().get('[data-cy=collection-files-panel]').within(() => {
+                            cy.get('[data-cy=collection-files-right-panel]', { timeout: 5000 })
+                                .should('contain', fileName);
                             if (isWritable) {
                                 cy.get('[data-cy=upload-button]')
                                     .should(`${isWritable ? '' : 'not.'}contain`, 'Upload data');
@@ -842,7 +842,7 @@ describe('Collection panel tests', function () {
 
                 cy.get('[data-cy=form-submit-btn]').click();
 
-                cy.get('.layout-pane-primary', { wait: 12000 }).contains('Projects').click();
+                cy.waitForDom().get('.layout-pane-primary', { timeout: 12000 }).contains('Projects').click();
 
                 cy.get('main').contains(`Files extracted from: ${this.collection.name}`).should('exist');
             });
@@ -976,7 +976,6 @@ describe('Collection panel tests', function () {
                             cy.get('[data-cy=form-submit-btn]').should('not.exist');
                             cy.get('[data-cy=collection-files-right-panel]')
                                  .contains('5mb_b.bin').should('exist');
-                            
                         });
                     });
                 });