Testcafe-hammerhead: Test Fails due to JavaScript error (works with --skip-js-errors)

Created on 29 Aug 2019  路  1Comment  路  Source: DevExpress/testcafe-hammerhead

What is your Test Scenario?

Just simple hover action, beginner with TestCafe

What is the Current behavior?

Test Fails (however in my opinion it shall be reported as Error instead of Fail ... unless this case really relates a launched page and is in fact a test failure

What is the Expected behavior?

Work as when --skip-js-errors is launched? Unless I am too rookie to know what am I talking about :-)

What is聽your web application and聽your TestCafe聽test code?

Your website URL (or attach your complete example):


Test Code:

 import { Selector } from 'testcafe';

fixture`Getting Started`
    .page`https://poczta.interia.pl/`;

const cos = Selector('.standard-interia-logo');

test.skip('My first test', async t => {
    await t
        .setTestSpeed(0.1)
        .typeText('input.gLFyf.gsfi', 'John Smith')
        .pressKey('enter')
        .expect(Selector('html').textContent).contains('John Smith')
});

test('My second test', async t => {
    await t
        .hover(cos)
        .wait(50000)
});


Your complete test report:

Getting Started
 - My first test
 脳 My second test

   1) A JavaScript error occurred on "https://poczta.interia.pl/".
      Repeat test actions in the browser and check the console for errors.
      If you see this error, it means that the tested website caused it. You can fix it or disable tracking JavaScript
      errors in TestCafe. To do the latter, enable the "--skip-js-errors" option.
      If this error does not occur, please write a new issue at:
      "https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".

      JavaScript error details:
      h.indexOf is not a function:
      value@https://iwa2.iplsc.com/main.iwa.js:2:94620
      value/<@https://iwa2.iplsc.com/main.iwa.js:2:91166
      value@https://iwa2.iplsc.com/main.iwa.js:2:91123
      e@https://iwa2.iplsc.com/main.iwa.js:2:89833
      e@https://iwa2.iplsc.com/main.iwa.js:2:86436
      e@https://iwa2.iplsc.com/main.iwa.js:2:24501
      e@https://iwa2.iplsc.com/main.iwa.js:2:81423
      e@https://iwa2.iplsc.com/main.iwa.js:2:78199
      @https://iwa2.iplsc.com/main.iwa.js:2:59596
      i@https://iwa2.iplsc.com/main.iwa.js:2:398
      @https://iwa2.iplsc.com/main.iwa.js:2:52061
      i@https://iwa2.iplsc.com/main.iwa.js:2:398
      @https://iwa2.iplsc.com/main.iwa.js:2:2164
      @https://iwa2.iplsc.com/main.iwa.js:2:2174

      Browser: Firefox 68.0.0 / Windows 10.0.0

         13 |        .expect(Selector('html').textContent).contains('John Smith')
         14 |});
         15 |
         16 |test('My second test', async t => {
         17 |    await t
       > 18 |        .hover(cos)
         19 |        .wait(50000)
         20 |});

         at hover (C:\testcafe\test.js:18:10)
         at test (C:\testcafe\test.js:16:1)
         at <anonymous> (C:\testcafe\node_modules\testcafe\src\api\wrap-test-function.js:17:28)
         at TestRun._executeTestFn (C:\testcafe\node_modules\testcafe\src\test-run\index.js:288:19)
         at TestRun.start (C:\testcafe\node_modules\testcafe\src\test-run\index.js:337:24)



 1/1 failed (6s)
 1 skipped

Steps to Reproduce:

  1. Open page
  2. Hover mouse on Interia logo

Your Environment details:

  • testcafe version: 1.4.2
  • node.js version: v10.16.0
  • command-line arguments: testcafe chrome test.js
    ** the same with firefox
  • browser name and version: Chrome 76.0.3809 / Windows 10.0.0
  • platform and version: Windows 10
client level 2 client side processing bug

Most helpful comment

Hi @Pieras2

however in my opinion it shall be reported as Error instead of Fail ... unless this case really relates a launched page and is in fact a test failure

If JavaScript errors are not caught, this can lead to web application problems, which are difficult to find. That is why it's necessary to immediately pay attention to such JavaScript errors. It allows web site developers to quickly learn about problems and fix them.

I found a TestCafe problem on the web site from your example. This bug is related to our internal web proxy, so I will transfer this issue to its repository.

For team:
The problem caused by EventEmitter returned as localStorage property value. The site code expects only strings.
We need to hide from enumeration the all internal properties of StorageWrapper

>All comments

Hi @Pieras2

however in my opinion it shall be reported as Error instead of Fail ... unless this case really relates a launched page and is in fact a test failure

If JavaScript errors are not caught, this can lead to web application problems, which are difficult to find. That is why it's necessary to immediately pay attention to such JavaScript errors. It allows web site developers to quickly learn about problems and fix them.

I found a TestCafe problem on the web site from your example. This bug is related to our internal web proxy, so I will transfer this issue to its repository.

For team:
The problem caused by EventEmitter returned as localStorage property value. The site code expects only strings.
We need to hide from enumeration the all internal properties of StorageWrapper

Was this page helpful?
0 / 5 - 0 ratings