Skip to content
Merged
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
15 changes: 13 additions & 2 deletions docs/api/commands/shadow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Traverse into the shadow DOM of an element.
## Syntax

```javascript
.shadow(selector)
.shadow(selector, options)
.shadow()
.shadow(options)
```

### Usage
Expand All @@ -34,6 +34,17 @@ cy.exec('npm start').shadow() // Errors, 'exec' does not yield DOM element
cy.get('.not-a-shadow-host').shadow() // Errors, subject must host a shadow root
```

### Arguments

<Icon name="angle-right" /> **options _(Object)_**

Pass in an options object to change the default behavior of `.shadow()`.

| Option | Default | Description |
| --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.get()` to resolve before [timing out](#Timeouts) |

<HeaderYields />

- `.shadow()` yields the new DOM element(s) it found.
Expand Down