mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-22 23:20:24 -05:00
add options argument to cy.contains TS definition (#4756)
This commit is contained in:
Vendored
+3
-1
@@ -573,8 +573,10 @@ declare namespace Cypress {
|
||||
* cy.contains(/^b\w+/)
|
||||
* // yields <ul>...</ul>
|
||||
* cy.contains('ul', 'apples')
|
||||
* // tries to find the given text for up to 1 second
|
||||
* cy.contains('my text to find', {timeout: 1000})
|
||||
*/
|
||||
contains(content: string | number | RegExp): Chainable<Subject>
|
||||
contains(content: string | number | RegExp, options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
|
||||
/**
|
||||
* Get the child DOM element that contains given text.
|
||||
*
|
||||
|
||||
@@ -191,7 +191,7 @@ cy.wrap([{ foo: 'bar' }, { foo: 'baz' }])
|
||||
})
|
||||
})
|
||||
|
||||
cy.get('something').should('have.length', 1)
|
||||
cy.get('something').should('have.length', 1)
|
||||
|
||||
cy.stub().withArgs('').log(false).as('foo')
|
||||
|
||||
@@ -297,3 +297,11 @@ namespace CypressTriggerTests {
|
||||
|
||||
const now = new Date(2019, 3, 2).getTime()
|
||||
cy.clock(now, ['Date'])
|
||||
|
||||
namespace CypressContainsTests {
|
||||
cy.contains('#app')
|
||||
cy.contains('my text to find')
|
||||
cy.contains('#app', 'my text to find')
|
||||
cy.contains('#app', 'my text to find', {log: false, timeout: 100})
|
||||
cy.contains('my text to find', {log: false, timeout: 100})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user