Testcafe Versions Save

A Node.js tool to automate end-to-end web testing.

v3.6.0

1 week ago

TestCafe v3.6.0 Released

The TestCafe v3.6.0 update includes two minor changes and a number of bug fixes.

New method: t.getCurrentCDPSession

The t.getCurrentCDPSession method allows native automation users to examine and control the CDP connection between TestCafe and the browser.

Use the method to obtain the Chrome DevTools Protocol object for the current session. The CDP object exposes properties and methods that pertain to the CDP connection between TestCafe and the active browser window.

fixture `Get current CDP session`
    .page('https://devexpress.github.io/testcafe/example');

test(`Get current CDP session`, async t => {
    const mainWindowId = await t.testRun.activeWindowId;

    let clientCDP = await t.getCurrentCDPSession();

    await t.expect(clientCDP.webSocketUrl).contains(mainWindowId);
}

Headless browser connection

TestCafe v3.6.0 takes advantage of the recent Chromium headless mode upgrade. The new headless mode offers better reliability and higher emulation accuracy.

The headless mode upgrade may cause unexpected changes to your tests' behavior. Take note of the following changes:

  • Headless Chromium now automatically upgrades insecure HTTP requests to HTTPS.
  • Headless Chromium does not always honor the --window-size flag. This behavior is a known Chromium bug.

Bug Fixes

  1. [Native automation] TestCafe does not execute the maximizeWindow() method in beforeEach hooks (#8117)
  2. If TestCafe launch options include --esm, the framework crashes on launch in environments with Node.JS v20 and up (#8132)
  3. The Linux-based Docker image of TestCafe cannot run tests in headless Chromium (#8145)
  4. TestCafe incorrectly crops Safari screenshots (#8154)

v3.6.0-rc.1

1 week ago

What's Changed

New Contributors

Full Changelog: https://github.com/DevExpress/testcafe/compare/v3.5.0...v3.6.0-rc.1

v3.5.0

4 months ago

v3.5.0 (2023-12-28)

TestCafe v3.5.0 includes multiple enhancements and bug fixes. Pass Selector queries to the Visual Selector Debugger, explore new ways to specify screenshot path patterns, and use a new experimental flag to run multi-window tests with native automation!

meta-readmore

Pass Selector queries to the Visual Selector Debugger

When you pass a Selector query to the t.debug() method, TestCafe uses the query to populate the input field of the Visual Selector Debugger. The debugger highlights page elements that match the query.

t.debug(Selector('#header'));

Use a custom path pattern for screenshots of failed tests

The pathPatternOnFails screenshot option allows TestCafe users to define a separate set of naming rules for screenshots taken on test failure. You can store these screenshots in a different folder, or add a common, recognizable element to their filenames. You can use this option on its own, or in conjunction with the pathPattern property.

{
    "screenshots": {
        "pathPatternOnFails": "${DATE}_${TIME}/failedTests/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png"
    }
}

Specify a path pattern for individual screenshots

Use the pathPattern option of the t.takeScreenshot action to specify a custom naming pattern for an individual screenshot:

t.takeScreenshot({
    pathPattern: "${DATE}_${TIME}/checkout-screenshot.png",
    fullPage: true
})

(Experimental) Run multi-window tests with native automation

TestCafe v2.5.0 was the first version of TestCafe to include native automation --- the capability to automate Chromium-based browsers with the native Chrome Debugging Protocol. This approach offers greater test stability and speed, but has a fair share of limitations. One of them is its incompatibility with multi-window tests.

TestCafe v3.5.0 offers an experimental solution for this issue --- the --experimental-multiple-windows CLI flag. If you enable this flag, you can run multi-window tests with the native automation engine.

The --experimental-multiple-windows mode does not support tests that include the following:

  • Pop-up windows that launch file downloads.
  • Browser window resizing.
  • Screenshots.
  • Video recording.

Please do not use the --experimental-multiple-windows flag in production or for business-critical tasks.

Bug Fixes

  • TypeScript compilation fails if project dependencies include '@babel/plugin-transorm-runtime' v7.23.3 or greater (#8091).
  • If you enable concurrent test execution, TestCafe launches tests before the conclusion of the fixture.before hook (#6999).
  • The Fixture.disableConcurrency method does not disable concurrent test execution (8087).
  • TestCafe ignores the fullPage option when it takes screenshots on test failure (#7761).
  • [Native Automation] TestCafe cannot populate file input fields with the required attribute (#8079).
  • [Native Automation] TestCafe fails to execute tests that use service workers (#8005, #8054).
  • When an action target is obscured by a sticky element, TestCafe incorrectly calculates the scroll distance necessary to interact with the target. (#7377).
  • Incorrect processing of front-end scripts causes automation errors (#7713, #8067, testcafe-hammerhead#2969).
  • TestCafe incorrectly processes failing network requests when it runs on Node.js v16 and greater (#7097).
  • TestCafe incorrectly handles native dialogs in Mozilla Firefox (#6815).

v3.5.0-rc.1

4 months ago

What’s Changed

  • release: v3.5.0-rc.1 (#8107) @Bayheck
  • feat: added pathPattern parameter to takeScreenshot method (#8093) @Bayheck
  • add missing multiple-windows-na task (#8105) @AlexKamaev
  • feat: debug with selector option added (#8066) @Bayheck
  • feat: Added path-pattern-on-fails for screenshots (closes #7014) (#8055) @PavelMor25
  • feat: experimental multiple windows in native automation (#8080) @AlexKamaev
  • build: Set @babel/plugin-transform-runtime to a 7.23.3 version (#8103) @PavelMor25
  • fix: In concurrent test run fixed awaiting of fixture before hook (#8097) @Bayheck
  • build(deps): bump @adobe/css-tools from 4.3.1 to 4.3.2 (#8096) @dependabot
  • build: fix desktop client test (#8100) @PavelMor25
  • fix: upload files with required inputs in native automation (#8092) @Bayheck
  • fix: disableConcurrency with quarantine mode (closes #8087) (#8088) @PavelMor25
  • fix: takeOnFails screenshot with fullPage option fixed (#8077) @Bayheck
  • fix service-worker in native automation (#8084) @AlexKamaev
  • Build: added test for Sockets hanging with node > 15.4 (#8078) @PavelMor25
  • Picker font color fix (#8071) @Bayheck
  • fixing incorrect scroll to element obscured by sticky element (#8047) @PavelMor25

v3.4.0

5 months ago

TestCafe v3.4.0 Released

TestCafe v3.4.0 introduces relative Role URLs, the ability to disable concurrency on a per-fixture basis, as well as other improvements and bug fixes.

Enhancements

Relative Role URLs

Earlier versions of TestCafe did not support relative URLs for Role log-in pages. In TestCafe v3.4.0 and higher, if you set the baseUrl configuration file parameter or the --base-url CLI option, you can set a relative URL for a Role log-in page:

import { Role } from 'testcafe';

const userOne = Role('./login', async t => {
    /* log-in actions go here */
});

Disable concurrency on a per-fixture basis

Concurrent test execution is not suitable for tests that can only run in a certain order. To ignore the global concurrency setting for a particular fixture, use the disableConcurrency fixture method.

fixture`Fixture.disablePageCaching`
    .page`https://devexpress.github.io/testcafe/example/`
    .disableConcurrency;

Development Mode Enhancements

When you debug code inside a browser, the browser can appear unresponsive. Earlier versions of TestCafe automatically relaunched unresponsive browsers, including browsers that were used for debugging.

TestCafe v3.4.0 does not relaunch unresponsive browsers if you enter development mode.

Debug Panel Enhancements

The debug panel includes a new "Hide Picker" button. Click this button to disable the Selector Debugger and hide the Selector input field.

hide-selector-picker

Bug Fixes

  • TestCafe incorrectly logs requests during concurrent test execution (#7977)
  • TestCafe does not load images with non-lowercase srcset attribute declarations (testcafe-hammerhead#2958)
  • TestCafe raises an unexpected client-side error when the application opens an ngx-formly form (#7758)
  • TestCafe cannot interact with page items at the edge of the viewport when the browser emulates a mobile device (#8057)

v3.4.0-rc.3

5 months ago

What’s Changed

  • release: v3.4.0-rc.3 (#8073) @PavelMor25
  • refactor: refactor disableConcurrency from function to getter (#8068) @PavelMor25
  • fix: Hide Picker button fixed for Mac (#8070) @aleks-pro

v3.4.0-rc.2

6 months ago

What’s Changed

  • release: v3.4.0-rc.2 (#8065) @PavelMor25

v3.4.0-rc.1

6 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/DevExpress/testcafe/compare/v3.3.0...v3.4.0-rc.1

v3.3.0

8 months ago

v3.3.0 (2023-08-29)

TestCafe v3.3.0 includes important bug fixes and quality of life improvements.

Bug Fixes

  • TestCafe terminates the test run when it attempts to parse an empty JSON file (#7935).
  • Firefox throws an unexpected error when TestCafe attempts to close the browser window (#7285).
  • [Native Automation] TestCafe ignores the --disable-multiple-windows option when you interact with a link that points to "target=_blank", or open a new window with the window.open method (#7916).
  • [Native Automation] TestCafe ignores the clientScripts directive when you mock HTTP requests (#7914).
  • [Native Automation] TestCafe hangs when it runs tests in the headless version of Google Chrome (#7898).
  • [Native Automation] TestCafe doesn't throw an error when the user attempts to enable the userProfile option (#7925).

v3.3.0-rc.2

8 months ago

What’s Changed

  • fix error message for :userProfile (#7972) @AlexKamaev