19093: Improve cypress test reliability
[arvados-workbench2.git] / cypress / integration / collection.spec.js
index 384b789f4ee7760e8ce38b8423e24a35e5d48fe8..28454a9093b3e87499b8daf652ecafb01df4fdaa 100644 (file)
@@ -278,6 +278,13 @@ describe('Collection panel tests', function () {
                             .and(`${isWritable ? '' : 'not.'}contain`, 'Rename')
                             .and(`${isWritable ? '' : 'not.'}contain`, 'Remove');
                         cy.get('body').click(); // Collapse the menu
+                        // File/dir item 'more options' button
+                        cy.get('[data-cy=file-item-options-btn')
+                            .first()
+                            .click()
+                        cy.get('[data-cy=context-menu]')
+                            .should(`${isWritable ? '' : 'not.'}contain`, 'Remove');
+                        cy.get('body').click(); // Collapse the menu
                         // Hamburger 'more options' menu button
                         cy.get('[data-cy=collection-files-panel-options-btn]')
                             .click()
@@ -367,7 +374,7 @@ describe('Collection panel tests', function () {
                 cy.goToPath(`/collections/${this.testCollection.uuid}`);
 
                 ['subdir', 'G%C3%BCnter\'s%20file', 'table%&?*2'].forEach((subdir) => {
-                    cy.get('[data-cy=collection-files-panel]')
+                    cy.waitForDom().get('[data-cy=collection-files-panel]')
                         .contains('bar').rightclick();
                     cy.get('[data-cy=context-menu]')
                         .contains('Rename')
@@ -635,7 +642,7 @@ describe('Collection panel tests', function () {
                     .contains(projName).and('contain', testProject.uuid);
                 // Double check that the collection is in the project
                 cy.goToPath(`/projects/${testProject.uuid}`);
-                cy.get('[data-cy=project-panel]').should('contain', collName);
+                cy.waitForDom().get('[data-cy=project-panel]').should('contain', collName);
             });
     });