-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add instrument-cra plugin link * add another cy.within example * Fix typo * lowercase 'TR' Co-authored-by: Jennifer Shehane <[email protected]>
- Loading branch information
1 parent
e910dbf
commit 5cad54b
Showing
2 changed files
with
34 additions
and
0 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 |
---|---|---|
|
@@ -60,6 +60,9 @@ Option | Default | Description | |
|
||
```javascript | ||
cy.get('form').within(($form) => { | ||
// you have access to the found form via | ||
// the jQuery object $form if you need it | ||
|
||
// cy.get() will only search for elements within form, | ||
// not within the entire document | ||
cy.get('input[name="email"]').type('[email protected]') | ||
|
@@ -68,6 +71,32 @@ cy.get('form').within(($form) => { | |
}) | ||
``` | ||
|
||
## Tables | ||
|
||
### Find row with specific cell and confirm other cells in the row | ||
|
||
```html | ||
<table> | ||
<tr> | ||
<td>My first client</td> | ||
<td>My first project</td> | ||
<td>0</td> | ||
<td>Active</td> | ||
<td><button>Edit</button></td> | ||
</tr> | ||
</table> | ||
``` | ||
|
||
```javascript | ||
cy.contains('My first client').parent('tr').within(() => { | ||
// all searches are automatically rooted to the found tr element | ||
cy.get('td').eq(1).contains('My first project') | ||
cy.get('td').eq(2).contains('0') | ||
cy.get('td').eq(3).contains('Active') | ||
cy.get('td').eq(4).contains('button', 'Edit').click() | ||
}) | ||
``` | ||
|
||
# Rules | ||
|
||
## Requirements {% helper_icon requirements %} | ||
|