From: Stephen Smith Date: Mon, 12 Dec 2022 22:12:45 +0000 (-0500) Subject: 19783: Tweak cypress test to avoid cypress bug X-Git-Tag: 2.5.0~14^2~3 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/3faec930d569af9bfceef94b2fe2c52a4aa2d904 19783: Tweak cypress test to avoid cypress bug Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index 74506aea..4a8751ef 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -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(); diff --git a/cypress/integration/create-workflow.spec.js b/cypress/integration/create-workflow.spec.js index 8df8389f..ca56e404 100644 --- a/cypress/integration/create-workflow.spec.js +++ b/cypress/integration/create-workflow.spec.js @@ -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(); diff --git a/cypress/integration/favorites.spec.js b/cypress/integration/favorites.spec.js index 7fd09124..db9a0d5f 100644 --- a/cypress/integration/favorites.spec.js +++ b/cypress/integration/favorites.spec.js @@ -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]')