diff --git a/docs/api/commands/shadow.mdx b/docs/api/commands/shadow.mdx index 3790cc7893..8f668a3197 100644 --- a/docs/api/commands/shadow.mdx +++ b/docs/api/commands/shadow.mdx @@ -14,8 +14,8 @@ Traverse into the shadow DOM of an element. ## Syntax ```javascript -.shadow(selector) -.shadow(selector, options) +.shadow() +.shadow(options) ``` ### Usage @@ -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 + + **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) | + - `.shadow()` yields the new DOM element(s) it found.