Skip to content

Commit 368eaca

Browse files
committed
add best practices note re: shadow dom
1 parent 8f8b2fc commit 368eaca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/driver/src/dom/visibility/MIGRATION_GUIDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ cy.get('.clipping-container').should('be.visible')
209209

210210
**Solution**: Do not assert visibility on elements with `pointer-events:none`, as they cannot be interacted with.
211211

212+
### Issue 7: Shadow DOM incompatibilities
213+
214+
**Problem:**: Elements inside shadow DOMs may not be detected properly as visible or hidden.
215+
216+
**Solution:**: Test shadow dom components in isolation with component testing, and only test if the public interface of the shadow dom component is visible. You wouldn't assert on the visibility of the browser's default video play controls by querying its shadow dom: you would assert on the properties of the video element itself.
217+
212218
## Rollback Plan
213219

214220
If you encounter issues that can't be easily resolved:

0 commit comments

Comments
 (0)