-
Notifications
You must be signed in to change notification settings - Fork 468
Description
Describe the feature you'd like:
I absolutely love the API provided by DOM Testing Library, we use React Testing Library at work and it has improved our tests so much. For our E2E testing we use WebdriverIO. I was looking for ways to use the DOM Testing Library API in our E2E tests and found Nightwatch Testing Library, Puppeteer Testing Library and TestCafe Testing Library.
It would be great to see a version of DOM Testing Library that works with WebdriverIO.
Suggested implementation:
Because I was interested I decided to implement something myself 😄. I have an initial version based heavily off of Nightwatch Testing Library. I tried to keep the API and tests as similar as possible. Here is the repo, I've added some more information in the readme: https://github.com/olivierwilkinson/webdriverio-testing-library.
Describe alternatives you've considered:
My original thought was to use Puppeteer Testing Library with WebdriverIOs underlying puppeteer instance but there are some limitations:
- Puppeteer is not always available
Puppeteer is used when the tests are run locally and there is no browser driver detected at localhost:4444
. This means the Puppeteer instance isn't available in some setups (including mine).
- Unable to use WebdriverIO specific APIs
APIs like Element.waitForDisplayed
are no longer available since the queries return Puppeteer ElementHandles.
Teachability, Documentation, Adoption, Migration Strategy:
If this is something Testing Library would like to maintain I would happily transfer ownership of the repo. I made sure to keep the same packages, setup and workflows from Nightwatch Testing Library so hopefully that wouldn't be a hassle. I'm also very happy to maintain and publish the package if this isn't something Testing Library wants to pursue, in which case I would appreciate some direction in terms of attribution as I don't want to step on anybody's toes.
Thanks in advance for any help/feedback you can give me here!