I’m trying to get at the exact difference in getBy*()
vs queryBy*()
vs findBy*()
in WebdriverIO Testing Library.
I’m asking because the docs describe all of them as async (“All queries are async…”), and thus I wonder how that changes the behavior particularly of getBy*()
and queryBy*()
, which are normally synchronous. For example, do they wait for some time for elements to appear or resolve immediately?
For example, if I call:
const myElement = await browser.getByText('Lorem ipsum');
what exactly is different than when calling:
const myElement2 = await browser.findByText('Dolor sit');
I’ve read:
- https://testing-library.com/docs/queries/about
- https://testing-library.com/docs/webdriverio-testing-library/intro/
- What’s the difference between getByText vs findByText vs queryByText in testing-library?