Skip to content

Add ShadowRoot support (GetShadowRoot and find from shadow)#302

Merged
jonhoo merged 3 commits into
jonhoo:mainfrom
redforks:main
Feb 28, 2026
Merged

Add ShadowRoot support (GetShadowRoot and find from shadow)#302
jonhoo merged 3 commits into
jonhoo:mainfrom
redforks:main

Conversation

@redforks
Copy link
Copy Markdown
Contributor

Implement W3C WebDriver ShadowRoot support.

This adds:

  • Add method Element::shadow_root()
  • ShadowRoot struct
  • ShadowRoot::{find, find_all}() methods

This enables locating elements inside open Shadow DOM trees,
allowing Fantoccini to interact with modern Web Components
(e.g. Shoelace, Lit, Vaadin).

I need to e2e test a web app uses shoelace web component, and this patch works

Copy link
Copy Markdown
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No notes, thank you!

@jonhoo
Copy link
Copy Markdown
Owner

jonhoo commented Feb 28, 2026

Ah, I would prefer if you could add a test for this functionality please. But will land without one for now.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 10.14493% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.71%. Comparing base (77f03d4) to head (b1c4259).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/elements.rs 0.00% 59 Missing ⚠️
src/session.rs 70.00% 3 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/session.rs 82.53% <70.00%> (-1.35%) ⬇️
src/elements.rs 49.85% <0.00%> (-9.88%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonhoo jonhoo merged commit 66fa1df into jonhoo:main Feb 28, 2026
17 of 20 checks passed
@jonhoo
Copy link
Copy Markdown
Owner

jonhoo commented Feb 28, 2026

Released in 0.22.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants