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

Conversation

Zeegaan
Copy link
Member

@Zeegaan Zeegaan commented Oct 25, 2021

Notes

  • Added a should be visible & wait to ensure click event has bound before clicking macro

How to test

  • Run a fresh install of umbraco
  • Nagivate to Umbraco.Tests.AcceptanceTests
  • run npm install & npm run test
  • All tests should pass

@Zeegaan Zeegaan requested a review from bergmania October 25, 2021 12:17
@@ -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.

@Zeegaan Zeegaan requested a review from p-m-j October 26, 2021 11:06
@p-m-j
Copy link
Contributor

p-m-j commented Oct 26, 2021

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.

@p-m-j p-m-j merged commit 34be464 into v9/dev Oct 26, 2021
@p-m-j p-m-j deleted the v9/bugfix/fix_flaky_cypress_test branch October 26, 2021 13:01
nul800sebastiaan pushed a commit that referenced this pull request Nov 3, 2021
* 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
nul800sebastiaan pushed a commit that referenced this pull request Nov 3, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants