Testcafe: Script error causes tests to fail

Created on 30 Jan 2017  路  8Comments  路  Source: DevExpress/testcafe

Sometimes tests exit early with logging like this:

   1) Error on page "http://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-016-2850-8":

      Script error.

Which doesn't really say what the problem is. I imagine this is due to a client side JS error with the
web page? The problems I see here are:

  • Testcafe tests should not fail due to a client side JS error
  • 'script error' is not very useful. It would be good to see the actual error which was thrown

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

Tests exit with Script error.

What is the expected behavior?

Tests do not exit

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

Tested page URL: //bmcgenomics.biomedcentral.com/articles/10.1186/s12864-016-2850-8

Specify your

  • operating system: OS X
  • testcafe version: 0.12.1
  • node.js version: 7
Auto-locked hammerhead bug

All 8 comments

Hi,

I've reproduced the issue and I'm working on it.

Testcafe tests should not fail due to a client side JS error

You can do it optionally with the skip-js-errors option

After some investigation we've found that the issue relates to our proxy module and we've created an issue there: https://github.com/DevExpress/testcafe-hammerhead/issues/1026

Quick response! Thanks a lot. In the mean time, skip-js-errors is great.

We've fixed the issue. It will be available in the next release.
Also we've published a daily build version with the fix (v0.13.0-alpha2). You can install it via

npm install testcafe@alpha

Hmm, I'm running into this issue today. My tests work as expected in the chrome browser, but it fails with:

Uncaught Error: Script error for "services/services"
http://requirejs.org/docs/errors.html#scripterror

I'm going to use the skipJsErrors argument for the API approach, but wanted to point this out for version 0.21.1

^ I didn't mean to unassign someone. Not sure how that happened.

I found the issue using t.debug(). It was a problem with a library my site was loading.

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

Related issues

Lukas-Kullmann picture Lukas-Kullmann  路  3Comments

hinok picture hinok  路  3Comments

chebum picture chebum  路  3Comments

madroneropaulo picture madroneropaulo  路  3Comments

AndreyBelym picture AndreyBelym  路  3Comments