eslint-plugin-cypress
Version:
An ESLint plugin for projects using Cypress
20 lines (13 loc) • 421 B
Markdown
# Disallow chain of `cy.get()` calls (`cypress/no-chained-get`)
<!-- end auto-generated rule header -->
This rule disallows the usage of chained `.get()` calls as `cy.get()` always starts its search from the cy.root element.
## Rule Details
Examples of **incorrect** code for this rule:
```js
cy.get('parent').get('child')
```
Examples of **correct** code for this rule:
```js
cy.get('parent')
.find('child')
```