Changelog
v2.3.0 (2023-01-30)
TestCafe v2.3.0 introduces create-testcafe
--- an interactive tool that allows you to initialize a new TestCafe project in seconds. The update also includes experimental ECMAScript module support and a number of bug fixes.
IMPORTANT: TestCafe v2.3.0 ends support for Node.js 14 due to a known vulnerability in the
babel-plugin-module-resolver
module.Install an up-to-date version of the Node.js runtime to use TestCafe v2.3.0 and up.
The official maintenance period for Node.js 14 elapses on April 1st, 2023.
Use the create-testcafe tool to initialize a new TestCafe project, or add TestCafe to an existing Node.js application.
Execute the following command to launch create-testcafe
:
npx create-testcafe
The create-testcafe
tool allows you to perform the following actions with a single command:
Read the TestCafe Setup Wizard guide for more information on the create-testcafe tool.
IMPORTANT: ESM module suppport works with Node.js 16 and up.
TestCafe has always used CommonJS syntax for module imports:
const { x } = require('y');
An increasing number of Node.JS packages abandon CommonJS in favour of ECMAScript module syntax:
import {x} from 'y'
Enable the --experimental-esm
CLI flag to import modules that do not support CommonJS. Note: tests with ECMASCript module syntax are subject to additional requirements.
testcafe chrome test.js --experimental-esm
To run tests with ECMAScript import
statements, make sure that your project meets at least one of the following requirements:
type
key in your project's package.json file is module
..mjs
extension._blank
target (#6926).dns.setDefaultResultOrder
method in older Node.js environments (#7447).babel-plugin-module-resolver
package (#7456).Changelog
v2.2.0 (2022-12-29)
TestCafe v2.2.0 introduces user-defined custom actions and an important experimental capability. Google Chrome users can now enable "proxyless mode" to speed up their test suite.
TestCafe users can now define custom test actions. Place the definition function in a JavaScript configuration file:
module.exports = {
customActions: {
async makeCoffee (args) {
await this.click(args);
},
}
};
Include custom methods in your tests alongside other TestController methods.
Add the customActions
prefix when you call the action:
test('Test with a custom action', async t => {
await t.click()
.customActions.makeCoffee()
.click();
})
TestCafe runs an under-the-hood reverse proxy to automate tests across different browsers. But this technique complicates the framework. Native automation protocols offer superior automation speeds and greater stability. That's why the TestCafe team decided to gradually phase the reverse proxy out in favor of native support for these automation protocols.
TestCafe v2.2.0 includes an experimental option that disables the proxy for Google Chrome.
testcafe chrome tests --experimental-proxyless
You can enable this option in the command line interface, the Test Runner API, and the configuration file. Read the Proxyless mode guide for more information.
uuid
dependency (testcafe-reporter-dashboard#111)localhost
URL on Node.js v17 and up (#7396)importScript
function (#7378)Request
header when an iframe
points the user to a new URL (#7376, PR testcafe-hammerhead#2813 by @naggingant)<select>
element with the multiple
attribute (PR testcafe-hammerhead#2815)Changelog
v2.1.0 (2022-11-10)
visibility: collapse
attribute.Element.insertAdjacentText
method (#7352).