TestCafe v1.19 released, A Node.js tool to automate end-to-end web testing

TestCafe

A Node.js tool to automate end-to-end web testing. Write tests in JS or TypeScript, run them and view results

It is responsible for all phases: start the browser, run the test, collect test results and generate reports. TestCafe does not require a browser plugin, it is out of the box in all popular modern browsers.

testcafe

Features

  • Stable tests and no manual timeouts
    TestCafe automatically waits for page loads and XHRs before the test starts and after each action. It also features smart test actions and assertions that wait for page elements to appear. You can change the maximum wait time. If elements load faster, tests skip the timeout and continue.
  • Rapid test development tool
    Changes in test code immediately restart the test, and you see the results instantly.
    See how it works in the TestCafe Live repository.
  • Latest JS and TypeScript support
    TestCafe supports the latest JavaScript features, including ES2017 (for example, async/await). You can also use TypeScript if you prefer a strongly typed language.
  • Detects JS errors in your code
    TestCafe reports JS errors that it finds on the webpage. Tests automatically fail because of that. However, you can disable this.
  • Concurrent tests launch
    TestCafe can open multiple instances of the same browser to run parallel tests which decreases test execution time.
  • PageObject pattern support
    The TestCafe’s Test API includes a high-level selector library, assertions, etc. You can combine them to implement readable tests with the PageObject pattern.
    const macOSInput = Selector(.column).find(label).withText(MacOS).child(input);
  • Easy to include in a continuous integration system
    You can run TestCafe from a console, and its reports can be viewed in a CI system’s interface (TeamCity, Jenkins, Travis & etc.)

Changelog v1.19

New Capabilities

Cookie Management

Previous versions of TestCafe lacked dedicated cookie management methods. Users had to write custom client functions to add and remove cookies. This technique was complicated and, at times, limiting. Some cookie manipulation actions — such as HTTP-only cookie management — were very hard to integrate into the test suite.

The latest version of the framework includes a proper set of cookie management tools that can handle a wide variety of tasks. Learn more about the new methods in our documentation: deleteCookiesgetCookiessetCookies.

Global Test Hooks

Many TestCafe users employ test hooks — functions that run before and after tests and fixtures. In TestCafe v1.19.0 and higher, you can attach hooks to test runs, as well as apply test hooks to your entire suite. This capability requires the use of a JavaScript configuration file.

Learn more about hooks from our newly updated hook guide.

Global Request Hooks

Request hooks are functions that intercept HTTP requests and mock HTTP responses. Earlier versions of TestCafe let you attach request hooks to one test or fixture at a time. You can now define global request hooks and attach them to multiple tests or fixtures in your suite.

Read the Request Hooks guide to learn more.

Bug Fixes

  • TestCafe ignores CLI browser arguments when they conflict with the configuration file (#6618)
  • The outdated moment.js dependency contains a critical vulnerability (PR #6996 by @vergilfromadyen)
  • TestCafe proxy doesn’t always serve cookies with the secure attribute (testcafe-hammerhead/#2715)

Download