Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v9: Fixing flaky cypress test "Macro in Grid" #11485

Merged
merged 9 commits into from
Oct 26, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,11 @@ context('Content', () => {
// Click macro
cy.get(':nth-child(4) > .umb-card-grid-item > :nth-child(1)').click();
// Select the macro
cy.get('.umb-card-grid-item').contains(macroName).should('be.visible');
cy.wait(500);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No magic numbers please :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have suggestions how to avoid the wait? We tried a couple of things, and i looks like cypress can click the item before a click handler is attached.

cy.get('.umb-card-grid-item').contains(macroName).click();
p-m-j marked this conversation as resolved.
Show resolved Hide resolved
Zeegaan marked this conversation as resolved.
Show resolved Hide resolved


// Save and publish
cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click();
cy.umbracoSuccessNotification().should('be.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ import {
//Check if tab is there, else if it wasnt created, this test would always pass
cy.get('[title="aTab 1"]').should('be.visible');
//Delete a tab
cy.get('.btn-reset > [icon="icon-trash"]').click();
cy.get('.btn-reset > [icon="icon-trash"]').first().click();
cy.get('.umb-button > .btn').last().click();
cy.umbracoButtonByLabelKey('buttons_save').click();
//Assert
Expand Down