diff --git a/source/_data/plugins.yml b/source/_data/plugins.yml index a4cd147c8a..8ca4cc2b49 100644 --- a/source/_data/plugins.yml +++ b/source/_data/plugins.yml @@ -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 diff --git a/source/api/commands/within.md b/source/api/commands/within.md index 12b6c1f06f..3c890293bc 100644 --- a/source/api/commands/within.md +++ b/source/api/commands/within.md @@ -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('john.doe@email.com') @@ -68,6 +71,32 @@ cy.get('form').within(($form) => { }) ``` +## Tables + +### Find row with specific cell and confirm other cells in the row + +```html + + + + + + + + +
My first clientMy first project0Active
+``` + +```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 %}