19093: Improve cypress test reliability
[arvados-workbench2.git] / cypress / integration / collection.spec.js
index 1329191dad906b825c13a271227fe8b6d12f4944..28454a9093b3e87499b8daf652ecafb01df4fdaa 100644 (file)
@@ -374,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')
@@ -425,6 +425,20 @@ describe('Collection panel tests', function () {
             });
     });
 
+    it('shows collection owner', () => {
+        cy.createCollection(adminUser.token, {
+            name: `Test collection ${Math.floor(Math.random() * 999999)}`,
+            owner_uuid: activeUser.user.uuid,
+            manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
+        })
+            .as('testCollection').then((testCollection) => {
+                cy.loginAs(activeUser);
+                cy.goToPath(`/collections/${testCollection.uuid}`);
+                cy.wait(5000);
+                cy.get('[data-cy=collection-info-panel]').contains(`Collection User`);
+            });
+    });
+
     it('tries to rename a file with illegal names', function () {
         // Creates the collection using the admin token so we can set up
         // a bogus manifest text without block signatures.
@@ -628,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);
             });
     });