19783: Tweak cypress test to avoid cypress bug
authorStephen Smith <stephen@curii.com>
Mon, 12 Dec 2022 22:12:45 +0000 (17:12 -0500)
committerStephen Smith <stephen@curii.com>
Mon, 12 Dec 2022 22:12:45 +0000 (17:12 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

cypress/integration/collection.spec.js
cypress/integration/create-workflow.spec.js
cypress/integration/favorites.spec.js

index 74506aea21b67533e8318bbae402be3b0497a9ee..4a8751efb3a9d86689cdfbf7034ecc983d4cb333 100644 (file)
@@ -628,9 +628,10 @@ describe('Collection panel tests', function () {
                 cy.get('[data-cy=form-dialog]')
                     .should('contain', 'Move to')
                     .within(() => {
+                        // must use .then to avoid selecting instead of expanding https://github.com/cypress-io/cypress/issues/5529
                         cy.get('[data-cy=projects-tree-home-tree-picker]')
                             .find('i')
-                            .click();
+                            .then(el => el.click());
                         cy.get('[data-cy=projects-tree-home-tree-picker]')
                             .contains(projName)
                             .click();
index 8df8389ffd1a6fbc4683a1fc2405b1d146713ce6..ca56e404ad61c60400a1cebb8e8dcf32e7c81f6c 100644 (file)
@@ -82,7 +82,7 @@ describe('Multi-file deletion tests', function () {
                 });
 
             cy.get('[data-cy=choose-a-file-dialog]').as('chooseFileDialog');
-            cy.get('@chooseFileDialog').contains('Projects').closest('ul').find('i').click();
+            cy.get('@chooseFileDialog').contains('Home Projects').closest('ul').find('i').click();
 
             cy.get('@project1').then((project1) => {
                 cy.get('@chooseFileDialog').find(`[data-id=${project1.uuid}]`).find('i').click();
@@ -158,11 +158,10 @@ describe('Multi-file deletion tests', function () {
                         cy.get('label').contains('foo').parent('div').find('input').click();
                         cy.get('div[role=dialog]')
                             .within(() => {
-                                cy.get('p').contains('Projects').closest('div[role=button]')
-                                    .within(() => {
-                                        cy.get('svg[role=presentation]')
-                                            .click({ multiple: true });
-                                    });
+                                // must use .then to avoid selecting instead of expanding https://github.com/cypress-io/cypress/issues/5529
+                                cy.get('p').contains('Home Projects').closest('ul')
+                                    .find('i')
+                                    .then(el => el.click());
 
                                 cy.get(`[data-id=${testCollection.uuid}]`)
                                     .find('i').click();
@@ -177,11 +176,10 @@ describe('Multi-file deletion tests', function () {
                         cy.get('label').contains('bar').parent('div').find('input').click();
                         cy.get('div[role=dialog]')
                             .within(() => {
-                                cy.get('p').contains('Projects').closest('div[role=button]')
-                                    .within(() => {
-                                        cy.get('svg[role=presentation]')
-                                            .click({ multiple: true });
-                                    });
+                                // must use .then to avoid selecting instead of expanding https://github.com/cypress-io/cypress/issues/5529
+                                cy.get('p').contains('Home Projects').closest('ul')
+                                    .find('i')
+                                    .then(el => el.click());
 
                                 cy.get(`[data-id=${testCollection.uuid}]`)
                                     .find('input[type=checkbox]').click();
index 7fd091245f770015a7c86c12ae938d0ace54db86..db9a0d5f394072736dbff8c1af730182eacc6ee4 100644 (file)
@@ -119,7 +119,10 @@ describe('Favorites tests', function () {
                 });
 
                 cy.get('[data-cy=form-dialog]').within(function () {
-                    cy.get('[data-cy=projects-tree-favourites-tree-picker]').find('i').click();
+                    // must use .then to avoid selecting instead of expanding https://github.com/cypress-io/cypress/issues/5529
+                    cy.get('[data-cy=projects-tree-favourites-tree-picker]')
+                        .find('i')
+                        .then(el => el.click());
                     cy.contains(myProject1.name);
                     cy.contains(mySharedWritableProject.name);
                     cy.get('[data-cy=projects-tree-favourites-tree-picker]')