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

perf: improve performance when finding unique selectors for Test Replay #28536

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

mschile
Copy link
Contributor

@mschile mschile commented Dec 15, 2023

Additional details

When finding unique selectors for snapshots in Test Replay, we currently use @cypress/unique-selector. However, this package tries to generate a more human-readable and reduced selector than what is needed for Test Replay and subsequently can cause performance issues. I am updating the snapshots to use the @medv/finder packages which has options to vastly improve performance. Observed finding unique selectors in some scenarios go from ~350ms to ~0.5ms.

Steps to test

How has the user experience changed?

Command log snapshots will be more performant.

PR Tasks

Copy link

cypress bot commented Dec 15, 2023

15 flaky tests on run #52859 ↗︎

0 6145 103 0 Flakiness 15

Details:

Merge branch 'develop' into mschile/protocol/finder
Project: cypress Commit: 8fcd25467f
Status: Passed Duration: 14:51 💡
Started: Dec 15, 2023 9:43 PM Ended: Dec 15, 2023 9:58 PM
Flakiness  commands/querying/querying.cy.js • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > throws when alias property isnt a digit or `all` Test Replay
Flakiness  e2e/origin/navigation.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
delayed navigation > errors > redirects to an unexpected cross-origin and calls another command in the cy.origin command Test Replay
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron

View Output

Test Artifacts
... > correctly returns currentRetry Test Replay
... > correctly returns currentRetry Test Replay
... > correctly returns currentRetry Test Replay
Flakiness  runs.cy.ts • 2 flaky tests • app-e2e

View Output

Test Artifacts
App: Runs > Runs - Create Project > when a project is created, injects new projectId into the config file, and sends expected UTM params Test Replay Screenshots
App: Runs > Runs - Cannot Find Project > opens Connect Project modal after clicking Reconnect Project button Test Replay Screenshots
Flakiness  cypress-in-cypress.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
Cypress in Cypress > restarts browser if there is a before:browser:launch task and there is a change on the config Test Replay Screenshots

The first 5 flaky specs are shown, see all 9 specs in Cypress Cloud.

Review all test suite changes for PR #28536 ↗︎

@mschile mschile merged commit fa971f1 into develop Dec 15, 2023
82 of 84 checks passed
@mschile mschile deleted the mschile/protocol/finder branch December 15, 2023 22:31
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 26, 2023

Released in 13.6.2.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.6.2, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants