18661: Improves cypress test reliability avoiding possible race.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 3 Feb 2022 21:29:02 +0000 (18:29 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 3 Feb 2022 21:29:41 +0000 (18:29 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

cypress/integration/side-panel.spec.js

index f9d4dca34014554d954b1c5ddd788393ea65ce05..afe326e39a15166075bbf399a5578c16422b8b6b 100644 (file)
@@ -104,7 +104,7 @@ describe('Side panel tests', function() {
         cy.getAll('@mySharedWritableProject')
             .then(function ([mySharedWritableProject]) {
                 cy.loginAs(activeUser);
         cy.getAll('@mySharedWritableProject')
             .then(function ([mySharedWritableProject]) {
                 cy.loginAs(activeUser);
-                
+
                 cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
 
                 const newProjectName = `New project name ${mySharedWritableProject.name}`;
                 cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
 
                 const newProjectName = `New project name ${mySharedWritableProject.name}`;
@@ -125,19 +125,16 @@ describe('Side panel tests', function() {
             addToFavorites: false
         });
 
             addToFavorites: false
         });
 
-        cy.getAll('@writableProject')
-            .then(function ([writableProject]) {
-                cy.loginAs(activeUser);
-                
-                cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
-
-                cy.get('[data-cy=side-panel-tree]').contains(writableProject.name).should('exist');
-
-                cy.trashGroup(activeUser.token, writableProject.uuid);
-
+        cy.getAll('@writableProject').then(function ([writableProject]) {
+            cy.loginAs(activeUser);
+            cy.get('[data-cy=side-panel-tree]')
+                .contains('Projects').click();
+            cy.get('[data-cy=side-panel-tree]')
+                .contains(writableProject.name).should('exist');
+            cy.trashGroup(activeUser.token, writableProject.uuid).then(() => {
                 cy.contains('Refresh').click();
                 cy.contains('Refresh').click();
-
                 cy.contains(writableProject.name).should('not.exist');
             });
                 cy.contains(writableProject.name).should('not.exist');
             });
+        });
     });
 })
     });
 })