Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/_data/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
link: https://github.com/cypress-io/code-coverage
keywords: [coverage]

- name: '@cypress/instrument-cra'
description: NPM module for create-react-app applications to instrument source code without ejecting react-scripts
link: https://github.com/cypress-io/instrument-cra
keywords: [coverage]

- name: 'npm-cy'
description: This GitHub Action for npm enables arbitrary actions with the npm command-line client, including testing with cypress.io and publishing to a registry.
link: https://github.com/bartlett705/npm-cy
Expand Down
29 changes: 29 additions & 0 deletions source/api/commands/within.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]')
Expand All @@ -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 %}
Expand Down