-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
add "be.focused" and "have.focus" to assertions #3219
Conversation
If this fixes the negated assertion bug from a long time ago that would be huge! |
The desktop-gui tests are legit failing though: https://circleci.com/gh/cypress-io/cypress/54253 |
got it, tests were doing |
Good. Let's not forget to revert cypress-io/cypress-documentation#1289 when this get merged. |
🥇 great catch @dwelle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the focus
assertions and extract out the not.xyz
as a separate PR for 4.0 breaking changes.
* add "be.focused" to chai_jquery * add comment explaining the mess * add type definitions * refactor assertion to use jquery assertion * remove trailing whitespace * add test for multiple elements, update typedefs * fix failing tests: not.be.visible -> not.exist * allow should(not.be.visible) for failed selectors * remove unrelated visibility changes * extract only focus assertion * Revert "Merge remote-tracking branch 'origin/develop' into issue-97-focus-assertion" This reverts commit b401c32, reversing changes made to ab14758. * force jquery to use custom focus pseudo selector * only force custom matchers for focus selectors * rewrote matchesSelector wrap code * add lodash * Merge in origin/develop * changes on 3.3.0 Co-authored-by: Brian Mann <brian.mann86@gmail.com>
fix #97 add focus assertion
I wanted this to help me write some tests, so here it is
with this PR, the following are valid assertions:
fix for Implicit should 'exist' assertion is not being applied on cy.get() when other assertion. #205 assertion negation bugfix specs that use shouldnot.be.visible
include error message about changingnot.visible
tonot.exist
not.be.visible
to pass on non-existent selectors as beforedocs cypress-io/cypress-documentation#1362
remove docs that sayshould('not.have.element')
will pass with no DOM node