Testcafe: 'TypeError: this.res.setHeader is not a function' error appears, when specified 'http://localhost:3000' page url (Firefox only)

Created on 18 May 2018  路  15Comments  路  Source: DevExpress/testcafe

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

FF window is opened, navigation on url is done, failing occurs on next line after navigation, testCafe stops execution.

screenshot at may 18 19-43-03

What is the expected behavior?

TestCafe should continue tests execution

How would you reproduce the current behavior (if this is a bug)?

  1. Install latest testCafe version.
  2. Install latest FF version.
  3. Trigger tests execution in FF.:
    testcafe.js firefox ./{somePathToTests} s -r spec,nunit:./${somePathToResults} -e --selector-timeout 2000

    Provide the test code and the tested page URL (if applicable)

Tested page URL:
http://localhost:3000

Test code:
screenshot at may 18 20-00-39

Specify your

  • operating system: Mac OS X 10.12.0
  • testcafe version: 0.20.0, 0.19.2
  • node.js version: v8.9.4
Auto-locked hammerhead bug

Most helpful comment

Hi @iegor-zabielin , I've just published [email protected] with the fix! Please, update your TestCafe installation, and feel free to reopen the issue if the problem isn't fixed in your environment.

All 15 comments

Hi @iegor-zabielin

Thank you for your report. Unfortunately, it's very difficult to reproduce the problem without a real page.
Could you please provide a page on which we can reproduce the problem?

@miherlosev : unfortunately, it is reproduced on default "https://localhost:3000/" url. we are developing ReactJS based web application and by default (after execution yarn start), application is available on "https://localhost:3000/", in this case it can be reproduced.

screenshot at may 21 12-42-49

one more thing, you should try to reproduce after fresh npm packages installation (local and global)

i assume, the reason is in PORT value. we tried to change url on some other, without port, and there was any problems. issue isn't reproduced after application deployment and real URL using.

@iegor-zabielin

I need an example which I can run on my computer. Without it I cannot find the reason of the problem.

I will close the issue because no activity has been encountered for a long time.
Feel free to reopen the issue if the problem persists and you can provide an example to reproduce it.

I had the same problem. We use expressJs for the test server. It has hotReload enabled and firefox is failing with exactly the same reason. The way I solved it was to disable the hotReload, then firefox works like a charm.

const app = express()
const server = app.listen(port)

if (!disableHotReload) {
  webpackHotClient(compiler, {
    server
  })
}

Hi @hex0cter

It's difficult to determine the cause of the problem by your description.
Please provide us with a simple example to reproduce the issue so that we will be able to fix this problem ASAP.

@miherlosev , here you go: https://github.com/hex0cter/testcafe-issue-2438! Let me know if you need any more information.

@hex0cter

Unfortunately, I cannot reproduce the issue (see video).
Which Firefox version do you use?

@miherlosev I believe I saw this issue on several recent Firefox versions, both at home and at work. The version I am using at work is 60.0.1. One thing I did notice from your video is the different OS. I am using MacOS both home and at work. @iegor-zabielin also mentioned he was using MacOS. Could this happen to Mac only?

(I seem to remember I saw it in docker as well, which is a Linux environment)

@hex0cter I've reproduced the problem with Firefox on MacOS 10.13. But I need an additional time to investigate the reason of the problem.

@miherlosev Great to know you are able to reproduce the issue! Thanks for your work!

@hex0cter , @miherlosev thanks for assistance!

Hi @iegor-zabielin , I've just published [email protected] with the fix! Please, update your TestCafe installation, and feel free to reopen the issue if the problem isn't fixed in your environment.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings