Constructor Worker requires 'new' in firefox
See original GitHub issueWhat 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:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@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:master
branch (7d14498):I cannot reproduce this issue with testcafe@1.9.4. So, I’ll close it.
npm run tests
results:UPDATE Firefox 83 / macOS 10.15 / TestCafe v1.10.0-rc.4: