testing-library / webdriverio-testing-library

🕷️ Simple and complete WebdriverIO DOM testing utilities that encourage good testing practices.
16 stars 14 forks source link

Fix issues related to using lib with selenium, react and shadow doms #38

Closed segovia closed 1 year ago

olivierwilkinson commented 2 years ago

Looks like there is a problem with chrome, but it's likely to be an issue with the action as all the Firefox tests passed so my worry about the element refetching isn't a problem. When I get some time I'll fix chrome and add some tests for react and shadow dom and then let's get this going :)

olivierwilkinson commented 1 year ago

Heya, I've added tests for different services including Puppeteer and added some test cases for production React apps, the PR is here. It's already merged into main so I think you need to update your fork and then the actions should work correctly.

The two tests for production React are skipped currently, I think we should get them passing in this PR :)

olivierwilkinson commented 1 year ago

I didn't realise you had given me write permissions on your fork, thank you! I've rebased onto this repo's main branch to get the latest changes / test updates and added a commit with my suggestions. Once the tests pass I'll merge :)

olivierwilkinson commented 1 year ago

Thanks again @segovia! Very happy that this is fixed. 🥳

I'll bump the version of dom-testing-library soon so that the increased support for shadow dom you wanted is included also.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.0.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

segovia commented 1 year ago

@olivierwilkinson Thanks for getting it merged! Keeping SimmerJS seemed to work OK with my set up, however there is still the issue of selecting elements within a shadow dom by role and name that have an aria-label. This is fixed by updating "@testing-library/dom" to "^8.17.1". I made a separate PR for that, as requested. https://github.com/testing-library/webdriverio-testing-library/pull/45

olivierwilkinson commented 1 year ago

I made a separate PR for that, as requested. https://github.com/testing-library/webdriverio-testing-library/pull/45

Thank you for doing that! I'll get on merging that later today 😁