Skip to content

Support for shadow dom locators and unit tests - #282

Merged
Swatkins18 merged 3 commits into
q2ebanking:mainfrom
saurav-sandhuQ2:shadow-dom-support
Apr 24, 2026
Merged

Support for shadow dom locators and unit tests#282
Swatkins18 merged 3 commits into
q2ebanking:mainfrom
saurav-sandhuQ2:shadow-dom-support

Conversation

@saurav-sandhuQ2

@saurav-sandhuQ2 saurav-sandhuQ2 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds first-class Shadow DOM locator support to Boa.Constrictor.Selenium by introducing ShadowLocator, a new IWebLocator implementation for elements rendered inside an open shadow root.

It also adds unit coverage for:

  • shadow locator resolution
  • constructor validation
  • equality and hash behavior
  • compatibility with existing Screenplay interaction equality semantics

Testing

image

Tested all the Unit Tests after this change and added 14 ShadowLocatorTest and they are also passing
image

Checklist

  • I agree to follow Boa Constrictor's Code of Conduct.
  • I read Boa Constrictor's Contributing Code guide.
  • I successfully built the .NET solution with no errors or new warnings.
  • I successfully ran both the unit tests and the example tests.
  • I updated the appropriate changelogs with concise descriptions of these changes.
  • I added documentation for these changes (if appropriate).

@pl-shernandez

Copy link
Copy Markdown
Contributor

@q2ebanking/boaconstrictorcodereviewers This has been used internally and works very well so feel it should be promoted to the larger project

Swatkins18
Swatkins18 previously approved these changes Apr 23, 2026

@Swatkins18 Swatkins18 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall, looks good. One small thing, but I won't hold up the review for it.

Comment thread Boa.Constrictor.Selenium/Elements/ShadowLocator.cs Outdated
@saurav-sandhuQ2

Copy link
Copy Markdown
Contributor Author
image

Updated test run after latest commit

@Swatkins18 Swatkins18 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for your contribution! 🕶️

@Swatkins18
Swatkins18 merged commit 7e434d4 into q2ebanking:main Apr 24, 2026
3 checks passed
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.

3 participants