DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 673 forks source link

NetworkError: WorkerGlobalScope.importScripts: Failed to load worker script when opening page: twitch.tv #6693

Closed mccartyb1 closed 1 year ago

mccartyb1 commented 3 years ago

What is your Scenario?

I'd like to build some automation for twitch.tv, however there is an error when testcafe loads the page that blocks any subsequent automation.

What is the Current behavior?

When loading the page a JavaScript error occurs (more details in full report below): JavaScript error details: NetworkError: WorkerGlobalScope.importScripts: Failed to load worker script

If I try using --skip-js-errors, it does skip the error. However, most of the page does not load and is not functional.

What is the Expected behavior?

Page loads correctly and automation can act upon it.

What is your public website URL? (or attach your complete example)

https://www.twitch.tv/

What is your TestCafe test code?

import {Selector} from 'testcafe';

const loginButton = Selector("button").withAttribute("data-a-target", "login-button");

fixture("Crown Tests") .page("https://www.twitch.tv/");

test("Crown Test1", async t => { await t .expect(loginButton.exists).ok() });

Your complete configuration file

package.json


{ "dependencies": { "testcafe": "^1.17.1" } }

Your complete test report

Running tests in:

Screenshots

No response

Steps to Reproduce

  1. Run the provided script in testcafe (navigate to www.twitch.tv in testcafe)

TestCafe version

1.17.1

Node.js version

16.0.0

Command-line arguments

testcafe firefox test/basic_twitch_open.js

Browser name(s) and version(s)

Firefox 91.2.0, chrome 95.0.4638.69, Safari 15.1

Platform(s) and version(s)

windows 10, Mac OS v11.6

Other

AlexanderMoiseev commented 3 years ago

Hello,

Thank you for your input. We have reproduced the problem, please stay tuned.

mccartyb1 commented 2 years ago

Hello. Just checking in to see if there has been any update on this. Thanks!

github-actions[bot] commented 2 years ago

No updates yet. Once we get any results, we will post them in this thread.

miherlosev commented 1 year ago

Hi @mccartyb1,

TestCafe runs tests using the URL-rewritten proxy. This approach is good. However, there is a way to improve the stability and speed of test execution - the native browser automation API. We have a test execution mode uses native browser automation - we call it the Proxyless mode. In Proxyless mode, a few issues are already fixed. By the way, this issue was also fixed in Proxyless mode. This option is available in all interfaces:

// Command-line
testcafe chrome tests --experimental-proxyless

// Programmatic
const testcafe = await createTestCafe({ experimentalProxyless: true });

// Configuration file
{
   "experimentalProxyless": "true"
}   

Setup the testcafe@2.1.1-alpha.3 version and try running your tests in Proxyless mode. I look forward to your results. Note that at present it is an experimental mode. Also, the Proxyless mode is implemented only in Google Chrome. It will not work correctly if you run tests in a non-Chrome browser or in a combination of other browsers.

miherlosev commented 1 year ago

Hi @mccartyb1,

This issue is not reproduced with combination of testcafe@3.0.1 and the Google Chrome browser. Feel free to reopen this issue if you encounter it in other browsers.