question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constructor Worker requires 'new' in firefox

See original GitHub issue

What is your Test Scenario?

The main use of my app is to view different types of documents such as pdf, office files, images etc. It uses Web Worker to run some scripts that help processing the document so that it can be rendered/viewed.

What is the Current behavior?

When the app is running in the localhost, the Web Worker can be instantiated correctly so that the document can be processed and rendered. However if I’m using testcafe to test the app, the console will error Constructor Worker requires 'new'. After tracking the error down a bit, I think it is coming from window.ts:

if (constructorIsCalledWithoutNewKeyword(this, window.Worker))
    nativeMethods.Worker.apply(this, arguments);

What is the Expected behavior?

The Web Worker can be instantiated without any error.

What is your web application and your TestCafe test code?

Please clone the repo from: https://github.com/ZhijieZhang/testcafe_sample, run npm install and then npm start. You will see the web application opened in a new tab. You can check the TestCafe test code in test.js and start the test by npm run test.

Your Environment details:

testcafe version: 1.1.0 node.js version: 9.9.0 command-line arguments: npm run test browser name and version: Firefox 66.0 platform and version: macOs 10.13.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Farfurixcommented, May 31, 2019

@ZhijieZhang

There is another remaining issue related to this problematic scenario: https://github.com/DevExpress/testcafe-hammerhead/issues/1221#issuecomment-496446388. Once we address it, the original issue will be fixed completely.

Firefox results.

14.6.5 version: 1970-1

master branch (7d14498): 1970-2

0reactions
Farfurixcommented, Dec 1, 2020

I cannot reproduce this issue with testcafe@1.9.4. So, I’ll close it.

npm run tests results: Capture

UPDATE Firefox 83 / macOS 10.15 / TestCafe v1.10.0-rc.4: Capture

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service Worker API - MDN Web Docs
Note: On Firefox, for testing you can run service workers over HTTP (insecurely); simply check the Enable Service Workers over HTTP (when ...
Read more >
Using Service Workers - Web APIs | MDN
The primary use of activate is to clean up resources used in previous versions of the service worker. The new service worker can...
Read more >
Performance best practices for Firefox front-end engineers
You might want to consider using a Worker if you need to do some computation that can be ... which makes initial construction...
Read more >
Mozilla Careers — Feel good about your work again.
At Mozilla, you can pursue your future while working to protect the future of the internet for everyone, everywhere.
Read more >
Worker - Web APIs - MDN Web Docs
Chrome Edge Worker Full support. Chrome4. Toggle history Full support. Edge... Worker() constructor Full support. Chrome4. Toggle history Full support. Edge... Support for ECMAScript modules Full...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found