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

test: Stabilize cypress component tests #1785

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

gkarat
Copy link
Contributor

@gkarat gkarat commented Mar 7, 2023

This PR

  1. rewrites some flaky tests that assert network requests and their search parameters (e.g. filter, sorting, etc.). The problem is that cypress doesn't wait or flush all the requests between its and thus some tests can assert on wrongly intercepted requests. It must be resolved now by cy.waiting for all requests that we set up interceptors for.
    1. Example: the inventory groups table makes the initial request for all data via GET /groups. If in the tests we change the pagination and then cy.wait for the new paginated request, then it can happen that the first requests hasn't been finished yet and cy.wait will catch the very first request instead of the request made after changing pagination (the one we need to check).
  2. makes cypress run component tests in chrome browser instead of electron. Before we had a problem that CI would fail with Could not process 'reset:browser:tabs:for:next:test'. No automation clients connected. error. Cypress 10 component test crash after 100~ tests cypress-io/cypress#22208 suggests to force running in chrome.

How to test

CI must pass.

This rewrites some of the tests and makes sure there are no dangling
requests in the browser (testing environment) before the next test is
executed. Also, it makes all the component tests run in chrome due to
the often errors in CI when using electron (by default).
@gkarat gkarat added the bug Something isn't working label Mar 7, 2023
@gkarat gkarat requested a review from a team as a code owner March 7, 2023 09:52
@gkarat gkarat self-assigned this Mar 7, 2023
@Fewwy
Copy link
Contributor

Fewwy commented Mar 7, 2023

@gkarat Tested it locally, tests are passing. LGTM

@gkarat gkarat merged commit fabb5c6 into RedHatInsights:master Mar 7, 2023
@gkarat gkarat deleted the stabilize-cypress-tests branch March 7, 2023 10:25
@gkarat
Copy link
Contributor Author

gkarat commented Mar 7, 2023

🎉 This PR is included in version 1.7.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@gkarat gkarat added the released label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants