-
Notifications
You must be signed in to change notification settings - Fork 288
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
feat: adding a new matcher for shadow DOM toMatch #463
Conversation
Since I'm unsure whether it's best to create a separate matcher for this or to augment |
It looks like it would be better to add an option to Also make sure to update |
fair point @UziTech, let me update the PR. |
26b96e4
to
936f327
Compare
const textContent = traverseShadowRoots | ||
? getShadowTextContent(handle) | ||
: handle.textContent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get textContent
from either getShadowTextContent
or node's textContent
based on traverseShadowRoots
option.
} | ||
}) | ||
}) | ||
describe.each(['Page', 'Frame', 'ShadowPage', 'ShadowFrame'])( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same test cases, just adding page types.
const options = ['ShadowPage', 'ShadowFrame'].includes(pageType) | ||
? { traverseShadowRoots: true } | ||
: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run toMatch
with option if in shadow DOM page type
} | ||
}) | ||
|
||
describe('ElementHandle', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved ElementHandle
into the page type block. Was there a reason it was not tested for frames?
936f327
to
396a7bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💯
tyvm for the review @UziTech! 🙏 is there anything else I need to do to get the PR ready for merge? |
Nope. I will release this tonight. Thanks! |
Sorry for the delay. Finally got around to releasing 6.1.0 with this change 🎉 |
thanks for all your help on this @UziTech!! 🙏 |
Summary
text-content-shadow-dom
, adding a newtoMatch
-like matcher that traverses shadow DOMshadowroot
must be set toopen
to allow traversalTest plan
toMatchInShadow.test.js
that executes the same test cases astoMatch