TestCafe v1.17.0 Released

TestCafe v1.17.0 includes two major new capabilities: support for global hooks and custom execution timeouts.

Enhancements

Global Test and Fixture Hooks

You can now specify global test and fixture hooks. TestCafe attaches these hooks to every test / fixture in the test suite.

module.exports = {
    hooks: {
        fixture: {
            before: async (ctx) => {
                // your code
            },
            after: async (ctx) => {
                // your code
            }
        },
        test: {
            before: async (t) => {
                // your code
            },
            after: async (t) => {
                // your code
            }
        }
    }
};

Execution Timeouts

You can now specify custom timeouts for tests and test runs. If the execution time of a test/test run exceeds the specified length of time, TestCafe terminates it. Specify these timeouts in the configuration file or from the command line.

Command line interface

testcafe chrome my-tests --test-execution-timeout 180000
testcafe chrome my-tests --run-execution-timeout 180000

Configuration file

{
    "runExecutionTimeout": 180000,
    "testExecutionTimeout": 180000
}

Bug Fixes

  • TestCafe fails to continue the test after the user downloads a file. (#6242).
  • The TestCafe proxy does not fire the “unpipe” event when necessary. This omission leads to the “This socket has been ended by the other party” error (#6558).
  • TestCafe incorrectly handles rewritten uninitialized iframes