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

testcafe

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.5

Enhancements

⚙️ Page Caching Can be Disabled (#3780)

TestCafe may be unable to log in to the tested website correctly if the webserver uses caching for authentication pages or pages to which users are redirected after login. See the User Roles topic for details.

If tests fail unexpectedly after authentication, disable page caching in TestCafe.

Use the fixture.disablePageCaching and test.disablePageCaching methods to disable caching during a particular fixture or test.

fixture
    .disablePageCaching `My fixture`
    .page `https://example.com`;
test
    .disablePageCaching
    ('My test', async t => { /* ... */ });

To disable page caching during the entire test run, use either of the following options:

  • the –disable-page-caching command line flag
    testcafe chrome my-tests --disable-page-caching
  • the disablePageCaching option in the runner.run method
    runner.run({ disablePageCaching: true });
  • the disablePageCaching configuration file property
    {
        "disablePageCaching": true
    }

If tests run correctly without page caching, we recommend that you adjust the server settings to disable caching for authentication pages and pages to which the server redirects from them.

Bug Fixes

  • Fixed an error that occured when a selector matched an <svg> element (#3684)
  • Fixed an issue when the reporter configuration file option was not applied (#4234)
  • Fixed a warning message about invalid tsconfig.json file (#4154)
  • LiveRunner.stop() now closes the browsers (#4107)
  • Quarantined tests now re-run correctly in live mode (#4093)
  • Fixed a bug when client scripts were not injected in live mode when it re-executed tests (#4183)
  • form.elements.length now returns the correct value for forms with file inputs (testcafe-hammerhead/#2034)
  • Fixed a bug when images were not displayed in inputs with the image type (testcafe-hammerhead/#2116)
  • Fixed an AngularJS compatibility issue that caused a TypeError (testcafe-hammerhead/#2099)
  • TestCafe now works correctly with servers that use JSZip to unpack uploaded files (testcafe-hammerhead/#2115)

Download