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 run crashes and performance issues when plugin API is rendered during 'run mode' in CI #135

Open
jennifer-shehane opened this issue Oct 9, 2024 · 1 comment

Comments

@jennifer-shehane
Copy link

We identified an issue with a customer of ours where the performance of their test run is impacted when using the cypress-plugin-api plugin - specifically the browser renderer crashes. The performance issue is more pronounced when recording with Test Replay, since Cypress is capturing the entirety of the DOM from the cypress-plugin-api plugin that is rendered (like the entire response body within prism.js).

There is no value in rendering the entirety of the UI during run mode / during CI - as noted in this issue you opened previously. The user cannot interact with it during the run and they cannot interact with it when reviewing test Replay. This rendering DOES impact performance of the test run as the browser resources have to render.

I also wanted to link to this performance issue as we feel it's likely related.

Ask

It would be great if these hidden HTML elements were not rendered during run mode. You could also offer a flag to turn this off conditionally, as this rendering still impacts performance during open mode as well. Ideally, this UI would have some sort of virtual rendering where it renders on 'click' so that it does not impact performance of Cypress in any situation.

Let us know if you need any additional information and if any next steps are planned here. Thanks!

@danfooks
Copy link

danfooks commented Dec 16, 2024

I am running into the same issue, as well, and agree that we do not need to use the plugin for CI runs. While it would be a nice-to-have in order to view conflicting JSON data on test failures between the request and the response bodies, I have added the following code to my e2e.ts file in order to only use this plugin when we are running tests locally, rather than in CI as well:

if (Cypress.env('CYPRESS_API_PLUGIN_ENABLED') === 'TRUE') {
  require('cypress-plugin-api');
}

This is a band-aid fix until I am able to hear back from a dev, or until cypress-plugin-api consumes less memory in the GH Actions run.

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

No branches or pull requests

2 participants