Releases: DevExpress/testcafe
v2.6.0
TestCafe v2.6.0 Released
TestCafe v2.6.0 introduces two enhancements: a new hook that allows users to modify reporter output, and support for JavaScript configuration files with the .cjs extension.
meta-readmore
New reporter hook
The onBeforeWrite hook allows you to modify the output of a reporter.
If you want your test reports to include custom content, you can create a custom reporter from scratch. However, this approach takes time and effort. Use the onBeforeWrite hook if you want to make minor changes to the output of an existing reporter.
Define an onBeforeWrite hook in a JavaScript configuration file. The following hook adds the duration in milliseconds to every test entry in the report:
//.testcaferc.js or .testcaferc.cjs
function onBeforeWriteHook(writeInfo) { // This function will fire every time the reporter calls the "write" method.
if (writeInfo.initiator === 'reportTestDone') { // The "initiator" property contains the name of the reporter event that triggered the hook.
const {
name,
testRunInfo,
meta
} = writeInfo.data || {}; // If you attached this hook to a compatible reporter (such as "spec" or "list"), the hook can process data related to the event.
const testDuration = testRunInfo.durationMs; // Save the duration of the test.
writeInfo.formattedText = writeInfo.formattedText + ' (' + testDuration + 'ms)'; // Add test duration to the reporter output.
};
}
module.exports = { // Attach the hook
hooks: {
reporter: {
onBeforeWrite: {
'spec': onBeforeWriteHook, // This hook will fire when you use the default "spec" reporter.
},
},
},
};CJS support
If you run TestCafe v2.6.0 and higher, you can now use a configuration file with the .cjs file extension. TestCafe detects the .testcaferc.cjs file on startup, alongside its .js and .json counterparts.
TestCafe configuration files only support CommonJS syntax. Meanwhile, modern JavaScript tools often default to ESM syntax. If a JavaScript project is of type module, Node.js expects the project's .js files to contain ESM syntax.
Use the .cjs configuration file extension to let Node.js know that the file contains CommonJS syntax.
Many thanks to the TestCafe contributor Damien Guérin (@gigaga) for the implementation of this capability.
Bug fixes
- If you call the
t.skipJsErrorsmethod without arguments, TestCafe passes afalsevalue to the method. This behavior is inconsistent with similar methods of a greater scope ---test.skipJsErrorsandfixture.skipJsErrors(#7648). - Users cannot disable the "quarantine mode" or "skipJsErrors" settings from the command line (#7077).
- TestCafe incorrectly processes exceptions of types other than
Error(#7627). - TestCafe does not consistently execute the
t.pressKeyaction in Mozilla Firefox. Attempts to press the "backspace" key and the "tab" key, among others, may fail. (#7623) - When TestCafe runs in Native Automation mode, it incorrectly executes some instances of the
t.requestmethod. (#7609) - The TestCafe proxy incorrectly processes private class properties in client-side scripts, which leads to page load failure (#7632, PR by @sorin-davidoi).
v2.6.0-rc.1
What’s Changed
- release: publish 2.6.0-rc.1 (#7679) @Aleksey28
- update minimal and list reporters version (#7673) @Artem-Babich
- Add possibility to load config file from cjs file (#7614) @gigaga
- feat: introduce onBeforeWrite reporter hook (#7584) @Artem-Babich
- native automation: do not inject resources if the target is not html page (#7663) @AlexKamaev
- fix: skipJsErrors action without arguments doesn't skip errors(closes #7648) (#7650) @Artem-Babich
- test: Fix for electron or studio tests with native automation mode (#7669) @Dmitry-Ostashev
- fix: quarantine and skipJsErrors CLI option value cannot be set to false(closes #7077) (#7666) @Artem-Babich
- native automation: support redirects for custom request hooks (#7658) @AlexKamaev
- fix: adjust typing of
SkipJsErrorsCallback(#7655) @lg-kialo - FIPS compliance (#5864) (#7654) @dhgsg
- run nativeAutomation by default: preparation 1 (#7651) @miherlosev
- fix docker server tests (#7659) @miherlosev
- Fix the 'test-functional-local-safari' task (#7615) @miherlosev
- update hammerhead (#7643) @miherlosev
- native automation: postData processing in hooks (#7635) @AlexKamaev
v2.5.1-rc.1
What’s Changed
- update hammerhead (#7643) @miherlosev
- native automation: postData processing in hooks (#7635) @AlexKamaev
- bump version 2.5.1-rc.1 (#7641) @AlexKamaev
- fix: request action returns bad request if request method is specified in lowercase in native automation(closes #7609) (#7633) @Artem-Babich
- fix: firefox keypress event doesn't work with backspace, tab, etc, if preventDefault called (#7623) @Artem-Babich
- A note about Native Automation Mode added into the bug report template (#7630) @aleks-pro
- build: increase timeout for debug tests (#7628) @Aleksey28
- native automation: disable multiple windows if native automation is enabled (#7618) @AlexKamaev
- proxyless: ignore the
pasteoption of TypeAutomation (#7617) @AlexKamaev - build: updated server tests and refactored other tests (#7624) @Aleksey28
- try to show cursor in proxyless mode (#7610) @AlexKamaev
- fix: update spec-reporter dependency (#7620) @Artem-Babich
- Node version update (#7621) @titerman
- fix file upload problem in the proxyless mode (#7607) @AlexKamaev
- nativeAutomation: rename task (#7619) @Artem-Babich
- nativeAutomation: Rename proxyless internal (#7613) @Artem-Babich
- fix: use calculated osInfo in userAgent (#7600) @Artem-Babich
v2.5.0
TestCafe v2.5.0 Released
TestCafe v2.5.0 introduces three major enhancements:
- The new
t.reportmethod passes custom data to the test reporter. - The new
--native-automationflag enables TestCafe to automate all Chromium-based browsers with the native CDP protocol. - The new
--esmflag allows users to import ESM modules in test files.
meta-readmore
t.report
Include the t.report() method in your test to pass custom data to the reporter.
Specify arguments of any type (string, array, Object, etc). Separate arguments with a comma:
await
t.report(
'text',
{'key': 'value'},
['arrayItem1', 'arrayItem2']
);The default spec reporter displays custom data after test completion, once for each browser that runs the test.

CDP Automation: Now Stable
TestCafe v2.2.0 introduced an experimental proxyless mode that automated Google Chrome with the native CDP protocol.
For the v2.5.0 release, the TestCafe team addressed most issues that our users discovered when the capability was "experimental", and gave it a new name --- Native Automation mode.
Unlike its predecessor, the Native Automation mode supports all Chromium-based browsers, including Microsoft Edge. Enable the nativeAutomation option in the command line interface, the configuration file, or the runner.run() function to try this capability.
Important
TestCafe v2.5.0 removed theexperimentalProxylessoption from the createTestCafe function. Use the runner.run() function to enable Native Automation mode from the TestCafe Test Runner API.
ESM Module Support: Now Stable
TestCafe v2.5.0 drops the experimental prefix from the --esm CLI flag. Enable the --esm flag to import modules that do not support CommonJS.
testcafe chrome test.js --esmv2.5.0-rc.3
What's Changed
- nativeAutomation: fix typings by @Artem-Babich in #7612
Full Changelog: v2.5.0-rc.2...v2.5.0-rc.3
v2.5.0-rc.2
release: publish 2.5.0-rc.2
v2.5.0-rc.1
What’s Changed
- feat: add possibility to pass additional data to the reporter plugin (closes #3584) (#7562) @Artem-Babich
- Set hostname to 'locahost' if the proxyless mode is enabled to prevent block-mixed-content error (closes #7595) (#7596) @AlexKamaev
- fix lodash type errors (#7594) @Artem-Babich
- feat: moved esm mode from experimental (#7574) @Aleksey28
- proxyless: make the 'experimental' option regular (#7583) @miherlosev
- test for
do not modify authorization header in proxyless modePR in hh (#7587) @AlexKamaev - remove some skipped test in the proxyless mode, add comments (#7586) @AlexKamaev
- actualize proxyless tests (#7580) @AlexKamaev
- proxyless: move the 'experimentalProxyless' option from factory function to the runner. (#7565) @miherlosev
- actualize skipped tests in proxyless (#7578) @AlexKamaev
- correct
whichproperty emulation for cdp events (fix hover for DevExtreme) (#7564) @AlexKamaev - proxyless: refactoring 2 (#7563) @miherlosev
- proxyless: refactoring (#7560) @miherlosev
- fix scroll position for cdp events (#7559) @AlexKamaev
- proxyless: mouse move automation (#7554) @AlexKamaev
- skip disablePageCaching tests in proxyless until multiple windows support (#7545) @Artem-Babich
- fix request API protocol in proxyless (#7556) @Artem-Babich
- refactor: optimized workflow actions (#7552) @Aleksey28
v2.4.0
v2.4.0 (2023-03-06)
TestCafe v2.4.0 introduces the Visual Selector Debugger. You can now create and debug Selector queries in the browser window.
Visual Selector Debugger
TestCafe v2.4.0 displays the Visual Selector Debugger panel when you activate Debug Mode. Use the panel to debug Selector queries from your test, or generate new Selector queries.
If a Selector query causes your test to fail, add the t.debug() command after the last successful action, and launch the test.
When the test reaches the breakpoint, the window that runs the test displays the Selector Debugger panel. Copy the failing Selector query from test code to the Selector Debugger input field.
- TestCafe highlights page elements that match the Selector query.
- If no elements match the Selector query, the panel displays the No Matching Elements warning.
- If your Selector query contians a syntax error, the panel displays the Invalid Selector warning.
To interactively generate a Selector query, click the Pick button, and select the target element on the page.
For more information on the panel, its capabilities, and limitations, read the Visual Selector Debugger Guide.
Bug Fixes
- TestCafe cannot execute the t.request action in proxyless mode (#7523).
v2.4.0-rc.1
What’s Changed
- [README] Remove the 2022 Feedback Survey banner (#7466) @titerman
- skip request timeout tests in proxyless until native timeout support is implemented (#7543) @Artem-Babich
- proxyless: correctly handle page with invalid certificate (#7542) @miherlosev
- README edits (#7541) @titerman
- proxyless: speed up 'pressKey' action (#7540) @miherlosev
- feat: Detect if TestCafe is being run on virtual machine (#7539) @Dmitry-Ostashev
- fix: live mode and support live mode with proxyless (#7528) @Artem-Babich
- proxyless: speed up 'typeText' action (#7536) @miherlosev
- fix: vulnerabilities in Jekyll dependencies (#7537) @kirovboris
- fix: add headed task to tasks queue (#7538) @Artem-Babich
- add a separate headed browsers task for tests that cannot be run in headless mode (#7530) @Artem-Babich
- fix: job reporting tests in proxyless (#7534) @Artem-Babich
- proxyless: implement 'typeText' action (#7525) @miherlosev
- Update LICENSE (#7527) @helen-dikareva
- proxyless: implement 'keyPress' action (#7499) @miherlosev
- fix(Selector Inspector): selectors parsing in experimental debug mode (#7517) @felis2803
- fix: raise reporter reportTaskDone event if browser has been disconnected (#7518) @Artem-Babich
- fix: support API testing in proxyless mode and attach cookies to the request with hammerhead (#7504) @Artem-Babich
- proxyless: fix browser reconnect tests (#7512) @AlexKamaev
- fix(Selector Inspector): selector is parsed correctly in life mode (#7516) @felis2803
- fix set caret position for the proxyless click command (#7505) @AlexKamaev
- feat: selector inspector panel (closes #7375) (#7372) @felis2803
- fix navigate to
about:blank/file://page in the CDP mode (#7498) @AlexKamaev - test: turned of tests for internet explorer (#7508) @Aleksey28
v2.3.1
v2.3.1 (2023-02-09)
TestCafe v2.3.1 introduces a number of bug fixes.
Bug Fixes
- Client-side code with optional chaining may trigger a TestCafe error (#7387).
- TestCafe cannot interact with images from the Shadow DOM (#7454).
- TestCafe v2.3.0 fails to launch when the
test.metamethod precedes test code (#7482). - When TestCafe launches a headless instance of Google Chrome in proxyless mode, it cannot interact with elements that are overlapped by the status bar (#7483).

