Skip to content

Commit 94deb32

Browse files
docs: Update shadow query command to correct command signature (#6107)
* docs: Update shadow query command to correct command signature * add options that are supported * lint
1 parent 0fa144a commit 94deb32

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/api/commands/shadow.mdx

+13-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Traverse into the shadow DOM of an element.
1414
## Syntax
1515

1616
```javascript
17-
.shadow(selector)
18-
.shadow(selector, options)
17+
.shadow()
18+
.shadow(options)
1919
```
2020

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

37+
### Arguments
38+
39+
<Icon name="angle-right" /> **options _(Object)_**
40+
41+
Pass in an options object to change the default behavior of `.shadow()`.
42+
43+
| Option | Default | Description |
44+
| --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
45+
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
46+
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.get()` to resolve before [timing out](#Timeouts) |
47+
3748
<HeaderYields />
3849

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

0 commit comments

Comments
 (0)