mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-21 14:41:00 -06:00
Updated some incorrect chainers off of .contains()
This commit is contained in:
@@ -24,9 +24,9 @@ Click a DOM element. The DOM element must be in a "clickable" state prior to th
|
||||
**{% fa fa-check-circle green %} Valid Usage**
|
||||
|
||||
```javascript
|
||||
cy.get('button').click() // Clicks on button
|
||||
cy.focused().click() // Clicks on el with focus
|
||||
cy.contains('Welcome').first().click() // Clicks on first el containing 'Welcome'
|
||||
cy.get('button').click() // Clicks on button
|
||||
cy.focused().click() // Clicks on el with focus
|
||||
cy.contains('Welcome').click() // Clicks on first el containing 'Welcome'
|
||||
```
|
||||
|
||||
**{% fa fa-exclamation-triangle red %} Invalid Usage**
|
||||
|
||||
@@ -22,7 +22,7 @@ cy.contains(selector, content, options)
|
||||
|
||||
```javascript
|
||||
cy.get('.nav').contains('About') // Yields el in .nav containing 'About'
|
||||
cy.contains('Hello').first() // Yields first el in document containing 'Hello'
|
||||
cy.contains('Hello') // Yields first el in document containing 'Hello'
|
||||
```
|
||||
|
||||
**{% fa fa-exclamation-triangle red %} Invalid Usage**
|
||||
|
||||
@@ -48,7 +48,7 @@ Option | Default | Notes
|
||||
|
||||
## Timeout
|
||||
|
||||
`.first` will continue to look for the first element for the duration of the [`defaultCommandTimeout`](https://on.cypress.io/guides/configuration#timeouts)
|
||||
`.first()` will continue to look for the first element for the duration of the [`defaultCommandTimeout`](https://on.cypress.io/guides/configuration#timeouts)
|
||||
|
||||
# Examples
|
||||
|
||||
|
||||
Reference in New Issue
Block a user