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
- Performance enhancement: Babel compilation.
- Performance enhancement: obtaining element attributes.
- A website parsing error causes test failure.
- Possible redirects to the ‘idle’ page in between codeless tests’ fixtures.
- Users cannot interact with iframes that have the
srcdoc
attribute. - XML file downloads trigger unexpected dialog boxes in Firefox.
- Links with empty
download
attributes cause TestCafe to hang. - TestCafe sometimes directs window location queries to non-window objects.
- TestCafe reports incorrect line numbers.
- TestCafe stops recording test videos after you skip a fixture.
- TestCafe doesn’t intercept WorkerGlobalScope.importScripts() arguments
- TestCafe doesn’t intercept Navigator.prototype requests
- TestCafe incorrectly processes some for-of statements.
- TestCafe incorrectly processes some eventListeners in multi-window mode.
- TestCafe incorrectly processes the <base> HTML tag
- TestCafe incorrectly processes elements with negative tabIndex values.