mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
* 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 commitb401c32a61, reversing changes made toab14758d31. * 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>
This commit is contained in:
Vendored
+32
@@ -3593,6 +3593,22 @@ declare namespace Cypress {
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'contain', value: string): Chainable<Subject>
|
||||
/**
|
||||
* Assert that at least one element of the selection is focused.
|
||||
* @example
|
||||
* cy.get('#result').should('have.focus')
|
||||
* cy.get('#result').should('be.focused')
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'have.focus'): Chainable<Subject>
|
||||
/**
|
||||
* Assert that at least one element of the selection is focused.
|
||||
* @example
|
||||
* cy.get('#result').should('be.focused')
|
||||
* cy.get('#result').should('have.focus')
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'be.focused'): Chainable<Subject>
|
||||
/**
|
||||
* Assert that the selection is not empty. Note that this overrides the built-in chai assertion. If the object asserted against is not a jQuery object, the original implementation will be called.
|
||||
* @example
|
||||
@@ -3749,6 +3765,22 @@ declare namespace Cypress {
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'not.be.visible'): Chainable<Subject>
|
||||
/**
|
||||
* Assert that no element of the selection is focused.
|
||||
* @example
|
||||
* cy.get('#result').should('not.have.focus')
|
||||
* cy.get('#result').should('not.be.focused')
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'not.have.focus'): Chainable<Subject>
|
||||
/**
|
||||
* Assert that no element of the selection is focused.
|
||||
* @example
|
||||
* cy.get('#result').should('not.be.focused')
|
||||
* cy.get('#result').should('not.have.focus')
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'not.be.focused'): Chainable<Subject>
|
||||
/**
|
||||
* Assert that the selection does not contain the given text, using `:contains()`. If the object asserted against is not a jQuery object, or if `contain` is not called as a function, the original implementation will be called.
|
||||
* @example
|
||||
|
||||
@@ -329,6 +329,12 @@ cy.get('#result').should('be.selected')
|
||||
|
||||
cy.get('#result').should('be.visible')
|
||||
|
||||
cy.get('#result').should('be.focused')
|
||||
cy.get('#result').should('not.be.focused')
|
||||
|
||||
cy.get('#result').should('have.focus')
|
||||
cy.get('#result').should('not.have.focus')
|
||||
|
||||
cy.get('#result').should('be.contain', 'text')
|
||||
|
||||
cy.get('#result').should('have.attr', 'role')
|
||||
|
||||
Reference in New Issue
Block a user