-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add more helpful debugging information to queries (#108)
* feat: add more helpful debugging information to queries * Add element selector information for debugging (outlines element when you click on command) (fixes #103) * Add @testing-library/dom errors (from `get*` queries) to failure messages - these are more helpful than the generic `find*('input') does not exist` messages (fixes #103) * Add retryability to `findBy*` when multiple elements are found (fixes #83) * Add option to disable logging of all commands * `query*` and `find*` have a consistent code path and error messaging (fixes #103) * Remove usage of Cypress commands in queries (fixes #103) * feat: add ability for queries to inherit previous subject * Fixes #109 without breaking change caused by #100 * feat: add parent/child log type detection * chore: implement feedback * docs: update readme to complete my thought process * slightly simplify config fn * Update README.md Co-authored-by: Kent C. Dodds <[email protected]> Closes #103, Closes #109, Closes #110
- Loading branch information
1 parent
e5cb2a5
commit 547389d
Showing
10 changed files
with
370 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rules": { | ||
"max-lines-per-function": "off", | ||
"jest/valid-expect-in-promise": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference types="cypress" /> | ||
describe('configuring fallback globally', () => { | ||
beforeEach(() => { | ||
cy.visit('cypress/fixtures/test-app/') | ||
cy.configureCypressTestingLibrary({ fallbackRetryWithoutPreviousSubject: false }) | ||
}) | ||
|
||
it('findByText with a previous subject', () => { | ||
cy.get('#nested') | ||
.findByText('Button Text 1') | ||
.should('not.exist') | ||
cy.get('#nested') | ||
.findByText('Button Text 2') | ||
.should('exist') | ||
}) | ||
}) | ||
|
||
/* global cy */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.