Skip to content

Speed up test warmup time when large imports are being used in tests; reduce the time for "Your Tests Are Starting..." #25533

@muratkeremozcan

Description

@muratkeremozcan

What would you like?

Can cypress have a mini internal build step for its support file and plugins (config) file. They don’t change often and Cypress could bundle and tree shake them and have one internal file to load until the next time the file changes.

While tuning up a front end app tests, I realized that large files (ex: a network helpers with many cy.intercepts) that import from other large files (ex: a test utils package that can generate many kinds of domain objects) that import from other large files (ex: faker with all locales vs faker with english only) significantly increase test warmup time (Your Tests Are Loading…). We are talking 5-10 seconds before a test starts.

This is a side issue, related to inefficient usage of Cypress test plugins, but together they are what slow down e2e test start up time by 10-20 seconds in our front-end apps.

Mind that if these large imports occur in files that run before any tests; commands.ts, e2e.ts, component.tsx, they will slow down each test.

Currently I have fine tuned the plugin imports, and I'm tackling the large files with inefficient imports

Even when we do our best though, and decrease the test warm up from 10-20 to 5-10, we will still hit a bottle neck at some point and can't optimize further.

Why is this needed?

Saving 5-10 seconds in each test from "Your Tests Are Starting..." would be a significant CI cost savings, and huge improvement for the developer experience in any test .

Other

Mind that that time does not count towards Cypress test duration, but it's real when you run a test locally, and it's real CI cost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingtype: featureNew feature that does not currently existtype: performance 🏃‍♀️Performance related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions