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

chore: remove numTestsKeptInMemory from cypress config because default behaviour is better #602

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

HendrikThePendric
Copy link
Contributor

@HendrikThePendric HendrikThePendric commented Oct 17, 2024

No JIRA issue available,

Having numTestsKeptInMemory set to a low number can make local debugging using cy:opendifficult. Normally you can hover over steps to see the state of the DOM in each one. However, when the number of tests in the current test file exceed the value of numTestsKeptInMemory, you well start seeing message saying The snapshot is missing. Displaying current state of the DOM for the first tests in the file.

After inspecting the Cypress docs, it turns out that the default behaviour is actually what we want:

The number of tests for which snapshots and command data are kept in memory. numTestsKeptInMemory is set to 50 by default during cypress open and set to 0 by default during cypress run. Reduce this number if you are experiencing high memory consumption in your browser during a test run.

This way we should not encounter out-of-memory errors on CI (which uses cypress run), and we should be able to visually debug tests locally using cypress open.

Also see this Slack thread

@HendrikThePendric HendrikThePendric requested a review from a team as a code owner October 17, 2024 09:45
@dhis2-bot
Copy link
Contributor

🚀 Deployed on https://pr-602.line-listing.netlify.dhis2.org

@HendrikThePendric HendrikThePendric merged commit b95284e into master Oct 17, 2024
33 checks passed
@HendrikThePendric HendrikThePendric deleted the chore/improve-cy-open-debugging branch October 17, 2024 10:09
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