cypress
cypress copied to clipboard
fix: Add optional regex check for comma preceding 'but' in assertions for command formatting
Additional details
When an assertion did not contain a comma preceding a 'but', we were not formatting the message correctly. This makes the comma optional in the assertion regex.
it('runs', () => {
cy.get('div').should("have.length.greaterThan", 1)
})
Steps to test
Run test above within branch to see formatting is fixed.
I locally ran this repo against this branch to also ensure no catastrophic backtracking was introduced. https://github.com/tom-mi/cypress-visual-testing-error-demo
How has the user experience changed?
Before
After
PR Tasks
- [ ] Have tests been added/updated?
- [ ] Has a PR for user-facing changes been opened in
cypress-documentation
? - [ ] Have API changes been updated in the
type definitions
?
9 flaky tests on run #55486 ↗︎
![]() |
![]() |
![]() |
![]() |
![]() |
Details:
Merge branch 'develop' into opt-comma-check-command | |||
Project: cypress | Commit: c7fb7f3469 |
||
Status: Passed | Duration: 19:50 💡 | ||
Started: May 20, 2024 2:32 PM | Ended: May 20, 2024 2:52 PM |
runner/runner.experimentalRetries.mochaEvents.cy.ts • 1 flaky test • app-e2e
Test | Artifacts | |
---|---|---|
... > hook failures > fail in [before] |
Test Replay
Screenshots
|
e2e/origin/navigation.cy.ts • 1 flaky test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
delayed navigation > errors > redirects to an unexpected cross-origin and calls another command in the cy.origin command |
Test Replay
|
e2e/origin/commands/waiting.cy.ts • 1 flaky test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
... > throws when foo cannot resolve |
Test Replay
|
commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-chrome:beta
Test | Artifacts | |
---|---|---|
network stubbing > waiting and aliasing > yields the expected interception when two requests are raced |
Test Replay
|
commands/waiting.cy.js • 1 flaky test • 5x-driver-chrome:beta
Test | Artifacts | |
---|---|---|
... > waits for requestTimeout and responseTimeout override |
Test Replay
|
The first 5 flaky specs are shown, see all 8 specs in Cypress Cloud.
Review all test suite changes for PR #29517 ↗︎
Released in 13.10.0
.
This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v13.10.0, please open a new issue.