-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No magic numbers please :)
There was a problem hiding this comment.
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.
tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts
Outdated
Show resolved
Hide resolved
tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts
Outdated
Show resolved
Hide resolved
tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts
Outdated
Show resolved
Hide resolved
For future readers, the issue was the click hit the component umb-icon which was getting rebound to render an svg (and so detatched, click rejected by cypress) , moving the click target to bottom (or anywhere other than dead center) bypasses the issue. |
* fixed flaky macro test and updated cypress version * fixed flaky macro test and updated cypress version * Update package.json * Fixed failing tabs test * Amend magic numbers with actual wait * Update tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts * Updated UI to click on button instead of icon * Make macro test click bottom to ensure we're not clicking on icon Co-authored-by: Nikolaj Geisle <[email protected]> (cherry picked from commit 34be464) # Conflicts: # tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Tabs/tabs.ts
* fixed flaky macro test and updated cypress version * fixed flaky macro test and updated cypress version * Update package.json * Fixed failing tabs test * Amend magic numbers with actual wait * Update tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts * Updated UI to click on button instead of icon * Make macro test click bottom to ensure we're not clicking on icon Co-authored-by: Nikolaj Geisle <[email protected]> (cherry picked from commit 34be464) # Conflicts: # tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Tabs/tabs.ts
Notes
How to test
npm install
&npm run test