TestCafe v1.15.0 Released

This version introduces the following new capabilities:

  • A method that dispatches DOM events
  • Support for requestHook header modification
  • Optional parameters for quarantine mode configuration

Enhancements

Dispatch DOM events

t.dispatchEvent(target, eventName[, options])

The t.dispatchEvent method lets you interact with the page in ways that TestCafe does not support out of the box. To implement an unsupported user action, break it down into discrete DOM events, and use the t.dispatchEvent method to fire them.

The following example fires a touchstart action on an element with the ‘button’ id:

await t.dispatchEvent('#button', 'touchstart',  { eventConstructor: 'TouchEvent' });

Read the Custom Actions Guide for more information on DOM events and event constructors.

Quarantine mode customization

New settings are available in quarantine mode. As you know, this mode repeats failing tests to help users get conclusive test results in sub-optimal conditions. The definition of conclusive, however, varies from person to person. The new version adds two variables - successThreshold and attemptLimit - that allow you specify when TestCafe must stop.

The attemptLimit variable determines the maximum possible number of test attempts. The successThreshold variable determines the number of successful attempts necessary for the test to pass.

testcafe chrome ./tests/ -q attemptLimit=5, successThreshold=2

Password obfuscation

TestCafe reporters no longer receive the contents of password input fields, unless you explicitly specify otherwise. This improves security for users that store their test results online.

Support for non-HTML documents

TestCafe now has the capability to proxy non-HTML documents such as XML and text files. Tests no longer hang upon redirection to a non-HTML address.

Bug Fixes