testing-library / webdriverio-testing-library

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

The library throws error when executing tests on Internet Explorer #19

Closed suchitrak closed 2 years ago

suchitrak commented 3 years ago

When following line is executed on IE11, Below error is displayed. The below lines works perfectly on Chrome and Chromium Edge though. I am using webdriverio version V6.

When('I {word} the/a(n) {word} named/called/labelled/labeled {string}', (action, ariaRole, text) => {
    browser.findByRole(ariaRole, { name: text })[action]();
});

[0-1] 2021-06-14T18:23:16.301Z ERROR webdriver: Request failed with status 500 due to javascript error: Error executing JavaScript
olivierwilkinson commented 3 years ago

We currently use a target of es2019 which is too recent to support IE 11. When I get some more time I'll look into getting the target to ES5 which does support IE 11 but it's not a simple as just changing it in the tsconfig unfortunately.

I'll look into it after I've got Firefox working properly, but if you'd like to raise a PR it would be more than welcome!

dmccr commented 3 years ago

I'm seeing the same error on firefox (using latest version on browserstack) WARN webdriver: Request failed with status 500 due to TypeError: window.TestingLibraryDom is undefined

olivierwilkinson commented 3 years ago

I'm seeing the same error on firefox (using latest version on browserstack) WARN webdriver: Request failed with status 500 due to TypeError: window.TestingLibraryDom is undefined

Hi there @dmccr 👋 .

Oh bummer, I thought I had fixed that issue in v3.0.2! Would you mind confirming that you are on that version? Then I'll reopen this issue.

I made sure to start running our tests against the latest version of Firefox when I originally resolved that issue so if possible would you be able to let me know what device and version of Firefox Browserstack is using when it fails? The problem might be device / environment specific.

Thanks for letting us know btw 😄

dmccr commented 3 years ago

@olivierwilkinson Thanks for the quick response. Indeed I was using older version 2.1.1, and its working fine on 3.0.2. Should have checked that :( I'm a big fan of testing-library approach. Keep up the good work!

nickserv commented 2 years ago

This seems to have been fixed, and Internet Explorer's support is ending anyway.