microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.43k stars 3.63k forks source link

React selectors with React reconciler trees #13760

Closed js2702 closed 1 year ago

js2702 commented 2 years ago

Context:

Describe the bug

We are trying to use the react selectors on Playwright with a React Three Fiber application. Three Fiber uses the React reconciler API to mount the components even if they are foreign (Canvas). These components show up when using the React Dev tools so my guess is that there should be a way to make them appear with Playwright.

Here is one of the demos in the React Three Fiber site: https://codesandbox.io/s/oc9qh

Deployed site: https://oc9qh.csb.app/

Test

Selector that works: playwright.$$("_react=App")

Selector that doesn't work (a three fiber element): playwright.$$("_react=PhyPlane")

I looked into the source code and I found the reactSelectorEngine.ts file which is the one I guess handles the react trees in the app, but I'm not sure why they don't show up. I tried some changes but I don't have much experience with the fiber properties.

pavelfeldman commented 1 year ago

Why was this issue closed?

Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.

If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.