Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the known issue section for cy.shadow() and cy.click() problem. #4256

Merged
merged 1 commit into from
Feb 4, 2022
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
10 changes: 10 additions & 0 deletions content/api/commands/shadow.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ can time out waiting for the element(s) to host a shadow
root.</li><li>`.shadow()` can time out waiting for assertions you've added to
pass.</li></List>

## Known Issue

When working with `cy.click()`, it sometimes won't click the right element in Chrome. It's happening because of [the ambiguity in spec](https://bugs.chromium.org/p/chromium/issues/detail?id=1188919&q=shadowRoot%20elementFromPoint&can=2).

In this case, pass `{ position: 'top' }` to `cy.click()` like below:

```js
cy.get('#element').shadow().find('[data-test-id="my-button"]').click({ position: 'top' })
```

## Command Log

**_Traverse into the shadow DOM of an element_**
Expand Down