TestCafe v1.11.0 Released

This version brings the release of multiple browser windows mode, options to configure request timeouts and many bugfixes.

Enhancements

Multiple Browser Windows is Live (#912)

Testing in multiple browser windows is now stable.

To take full advantage of testing in multiple windows with TestCafe, read Multiple Browser Windows.

⚙ Set Request Timeouts (PR #5692)

TestCafe now enables you to set request timeouts. If TestCafe receives no response within the specified period, it throws an error.

CLI

testcafe chrome my-tests --ajax-request-timeout 40000 --page-request-timeout 8000

Configuration file

{
    "pageRequestTimeout": 8000,
    "ajaxRequestTimeout": 40000
}

JavaScript API

These options are available in the runner.run Method.

const createTestCafe = require('testcafe');
const testcafe = await createTestCafe('localhost', 1337, 1338);
try {
    const runner = testcafe.createRunner();
    const failed = await runner.run({
        pageRequestTimeout: 8000,
        ajaxRequestTimeout: 40000
    });
    console.log('Tests failed: ' + failed);
}
finally {
    await testcafe.close();
}

⚙ Set Browser Initialization Timeout (PR #5720)

This release introduces an option to control browser initialization timeout. This timeout controls the time browsers have to connect to TestCafe before an error is thrown. You can control this timeout in one of the following ways:

testcafe chrome my-tests --browser-init-timeout 180000
{
    "browserInitTimeout": 180000
}
runner.run({ "browserInitTimeout": 180000 })

This setting sets an equal timeout for local and remote browsers.

Improved Unable To Establish Browser Connection Error Message (PR #5720)

TestCafe raises this error when at least one local or remote browser was not able to connect. The error message now includes the number of browsers that have not established a connection.

TestCafe raises a warning if low system performance is causing the connectivity issue.

⚙ An Option to Retry Requests for the Test Page (PR #5738)

If a tested webpage was not served after the first request, TestCafe can now retry the request.

You can enable this functionality with a command line, API, or configuration file option:

  • the --retry-test-pages command line argument

    testcafe chrome test.js --retry-test-pages
    
  • the createTestCafe option

    const createTestCafe = require('testcafe');
    
    const testcafe = await createTestCafe('localhost', 1337, 1338, retryTestPages)
    
  • the retryTestPages configuration file property

    {
        "retryTestPages": true
    }
    

Bug Fixes

Vulnerability Fix (PR #5843, PR testcafe-hammerhead#2531)

We have fixed a vulnerability found in the debug module we use for debugging. The vulnerability was a ReDos Vulnerability Regression that affected all TestCafe users. TestCafe now uses debug@4.3.1, where the issue is fixed.