Tags: testing-library/webdriverio-testing-library
Tags
build: fix selenium in github actions Selenium is sometimes failing to come up when running `test:selenium-standalone` in GitHub actions. Firefox flags were incorrect, should be -headless rather than --headless. Prevent installing drivers since that has already been done in the prepare script. To prevent the tests to fail reduce the max number of capabilities to 2 when running on CI, this means only two browsers will be running at a time. The setupBrowser test 'it still works after session reload' is now flaky. It seems to be related to a hanging session reload, possibly reducing the number of available instances in capabilities has alleviated it however. Quarantine the test so that we can build and release while looking into it further.
feat: support chaining queries As of WebdriverIO v7.19.0 it is possible to chain custom queries as long as they end in `$`. See the release notes for v7.19.0 here: https://github.com/webdriverio/webdriverio/blob/v7.19.0/CHANGELOG.md Add chainable queries to the `Browser` and `Element` as commands of the form `{queryName}$`, for example the chainable version of `getByText` is `getByText$`. Infer the types for `ChainablePromiseElement` and `ChainablePromiseArray` from the `Browser` and `Element` types, that way we don't need to lock in a specific version of WebdriverIO's types. To add the types of the chainable commands to the global WebdriverIO types users now need to add `WebdriverIOQueriesChainable` to the global `Browser`, `Element` and `ChainablePromiseElement` interfaces. This should not break existing behaviour or types, and the chainable custom commands should behave the same as the existing commands if the WebdriverIO version is less than v7.19.0. Typescript users need to use at least v4.1 as the types now make use of template literal strings to modify the query name to include `$` at the end. Bump development version of WebdriverIO packages to at least v7.19.0 and add tests for chaining queries.
fix: null queries with prod React and Puppeteer (#38) When returning queried elements directly from executeAsync Puppeteer will fail and return null if the element contains circular references. Elements in production React apps contain circular references due to React Fiber. Puppeteer is the default driver used by wdio when no services are defined. Instead of returning elements directly when Simmer fails add a data attribute with an id to use as a selector. Simmer should remain the primary method of generating selectors as it is more tolerant to scenarios where the element is regenerated, such as when React finds a key change. Co-authored-by: olivierwilkinson <olivier.wilkinson@gmail.com>
fix: injecting DTL when amd define exists https://www.ebay.com has a global define function with define.amd as an empty object. This causes the UMD distribution of Dom Testing Library to use the define function to expose it's methods. Since we assume the methods are available on the TestingLibraryDom object this breaks the library. Modify the UMD distribution so it creates the TestingLibraryDom even when a define function exists.
PreviousNext