testcafe: Firefox tests are terminated along with JavaScript "too much recursion" error occurrence

What is your Scenario?

I would like to run the test within our application on Firefox browser. Test is terminated along with error in console (see section “Current behavior” below). The similar issue was reported, but it was unfortunately closed: https://github.com/DevExpress/testcafe/issues/6578 for missing minimal working example. The size of our application is approximately 35Mb. I noticed the issue on v. 1.16.1. and 1.17.1. Everything works well on v. 1.15.0. There are no issues on Edge or Chrome at all.

What is the Current behavior?

Running test on Firefox browser leads to termination of the test. Error appears in console:

   1) A JavaScript error occurred on "http://localhost:8080/accordion-item".
      Repeat test actions in the browser and check the console for errors.
      To ignore client-side JavaScript errors, enable the "--skip-js-errors" CLI option, or set the "skipJsErrors" configuration file property to "true".
      If the website only throws this error when you test it with TestCafe, please create a new issue at:
      "https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".

      JavaScript error details:
      too much recursion
      e/</Sh</e.prototype._replaceUrlAttributes@http://172.28.3.110:50328/hammerhead.js:9:1687
      e/</Sh</e.prototype.process@http://172.28.3.110:50328/hammerhead.js:9:923
      e/</lf</t._processTextContent@http://172.28.3.110:50328/hammerhead.js:10:24481
      e/</lf</t.prototype._prepareNodesForInsertion@http://172.28.3.110:50328/hammerhead.js:10:18797
      e/</lf</t.prototype._addNodeCore@http://172.28.3.110:50328/hammerhead.js:10:18217
      appendChild@http://172.28.3.110:50328/hammerhead.js:10:20972
      S@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5926
      B@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:4716
      O@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:2613
      A.exports@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5197
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6483
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6409
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6362
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:950
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:959

Running the same test on Edge or Chrome browser does not cause any issues.

What is the Expected behavior?

Running test on Firefox should not lead to termination of the test.

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

n/a

What is your TestCafe test code?

fixture`Firefox test`
    .page(`http://localhost:8080/button`);
test.only('Should execute test on Firefox browser', async () => {
    await t.click(Selector('#basicButton'));
});

Your complete configuration file

No response

Your complete test report

$ testcafe firefox:headless **.e2e-spec.ts
 Running tests in:
 - Firefox 94.0 / Windows 10

 Firefox test
 × Should execute test on Firefox browser

   1) A JavaScript error occurred on "http://localhost:8080/button".
      Repeat test actions in the browser and check the console for errors.
      To ignore client-side JavaScript errors, enable the "--skip-js-errors" CLI option, or set the "skipJsErrors" configuration file property to "true".
      If the website only throws this error when you test it with TestCafe, please create a new issue at:
      "https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".

      JavaScript error details:
      too much recursion
      e/</Sh</e.prototype._replaceUrlAttributes@http://172.28.3.110:51660/hammerhead.js:9:1687
      e/</Sh</e.prototype.process@http://172.28.3.110:51660/hammerhead.js:9:923
      e/</lf</t._processTextContent@http://172.28.3.110:51660/hammerhead.js:10:24481
      e/</lf</t.prototype._prepareNodesForInsertion@http://172.28.3.110:51660/hammerhead.js:10:18797
      e/</lf</t.prototype._addNodeCore@http://172.28.3.110:51660/hammerhead.js:10:18217
      appendChild@http://172.28.3.110:51660/hammerhead.js:10:20972
      S@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5926
      B@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:4716
      O@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:2613
      A.exports@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5197
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6483
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6409
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6362
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:950
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:959

      Browser: Firefox 94.0 / Windows 10

         328 |});
         329 |
         330 |fixture`Firefox test`
         331 |    .page(`http://localhost:8080/button`);
         332 |test.only('Should execute test on Firefox browser', async () => {
       > 333 |    await t.click(Selector('#basicButton'));
         334 |});
         335 |
         336 |
         337 |
         338 |

Screenshots

No response

Steps to Reproduce

  1. Build any application of minimal size 35Mb.
  2. Run any test on Firefox.
  3. See that test is terminated and that error appears in console.

TestCafe version

1.16.1, 1.17.1

Node.js version

14.16.1

Command-line arguments

testcafe firefox:headless **.e2e-spec.ts

Browser name(s) and version(s)

Firefox 94.0.2

Platform(s) and version(s)

Windows 10

Other

JavaScript error can be ignored by “-e” command. In such case test runs, but it’s not a solution. Behavior is not dependent on headless mode, issue is reproducible in headed mode too. Our assumption is that issue is related to the size of application, we tried to run tests on publicly accessible pages, but issue did not occur. Closed issue https://github.com/DevExpress/testcafe/issues/6578 also points to #1481 and DevExpress/testcafe-hammerhead#1716.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (1 by maintainers)

Most upvoted comments

Hello @vizdatom ,

Thank you for the example. I reproduced the issue. We will investigate it and update this thread once we have any results.

@PierreRott

Hello,

Thank you. We will update this thread once we have any results.

For the team: It looks like the test application overrides the String.replace and Array.indexOf methods we use in our style processor (StyleProcessor._replaceUrlAttributes). This leads to this error. We need to replace the methods with native ones.