Skip to content

test(angular): remove routing waits in tests #28532

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

Merged
merged 1 commit into from
Nov 14, 2023
Merged

test(angular): remove routing waits in tests #28532

merged 1 commit into from
Nov 14, 2023

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Nov 14, 2023

Issue number: N/A


What is the current behavior?

Our Angular E2E tests are brittle because they rely on arbitrary cy.wait calls to account for asynchronous routing. This leads to flaky tests on CI and seemingly random test failures when we make adjustments to the Ionic Anguar routing integration (see: #28188)

Additionally, our test execution for the navigation tests is quite slow because transitions are enabled. As a result, we need to wait hundreds of ms per test just for the transitions to finish.

What is the new behavior?

  • Updated the testStack command to use a new getStack Cypress query. These queries come with automatic retrying built-in. By leveraging this query in the testStack command, we can avoid the arbitrary waits.
  • Added ionic:_testing=true query strings to the navigation tests. This causes Ionic to disable any transitions so the tests execute faster.
  • Removed most of the arbitrary cy.wait calls. I kept the swipe to go back cy.wait -- I wasn't quite sure how to reduce flakiness on that one.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: angular @ionic/angular package label Nov 14, 2023
@liamdebeasi liamdebeasi marked this pull request as ready for review November 14, 2023 22:34
@liamdebeasi liamdebeasi requested a review from thetaPC as a code owner November 14, 2023 22:34
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

I think it's a good call leaving the wait for the swipe to go back.

@liamdebeasi liamdebeasi added this pull request to the merge queue Nov 14, 2023
Merged via the queue into main with commit 093c671 Nov 14, 2023
@liamdebeasi liamdebeasi deleted the test-ng branch November 14, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: angular @ionic/angular package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants