All Versions
Latest Version
Avg Release Cycle
4 days
Latest Release
19 days ago

Changelog History
Page 1

  • v1.7.0

    November 21, 2019

    v1.7.0 (2019-11-21)

    ✨ Enhancements

    🍱 βš™οΈ Identify the Browser and Platform in Test Code (#481)

    βœ… TestCafe now allows you to obtain information about the current user agent. These data identify the operating system, platform type, browser, engine, etc.

    πŸ“š Use the t.browser property to access user agent data.

    import { Selector } from 'testcafe'; fixture `My fixture` .page ``;test('My test', async t =\> { if ( !== 'Chrome') await t.expect(Selector('div').withText('Browser not supported').visible).ok(); });

    πŸ“š The t.browser object exposes the following properties:

    Property Type Description Example
    πŸ“š alias String The browser alias string specified when tests were launched.
    πŸ“š name String The browser name.
    πŸ“š version String The browser version.
    πŸ“š platform String The platform type.
    πŸ“š headless Boolean true if the browser runs in headless mode.
    πŸ“š os Object The name and version of the operating system.
    πŸ“š engine Object The name and version of the browser engine.
    πŸ“š userAgent String The user agent string.
    πŸ“š prettyUserAgent String Formatted string with the browser's and operating system's name and version.

    πŸ“š The following example shows how to create a beforeEach hook that runs for specific browser engines.

    import { Selector } from 'testcafe'; fixture `My fixture` .page `` .beforeEach(async t =\> { if ( === 'Blink') return; // ... });

    πŸ“š You can also use t.browser to generate the screenshot path based on the browser name. This prevents screenshots taken with t.takeElementScreenshot in different browsers from being overwritten.

    import { Selector } from 'testcafe'; fixture `My fixture` .page ``;test('My test', async t =\> { const loginButton = Selector('div').withText('Login'); await t.takeElementScreenshot(loginButton, `auth/${}/login-button.png`); });

    πŸ“š For more information and examples, see Identify the Browser and Platform.

    πŸ› Bug Fixes

    • πŸ›  Fixed an error on pages that submit forms immediately after loading (#4360 by @bill-looby-i)
    • βœ… TestCafe now scrolls to elements located inside Shadow DOM roots (#4222)
    • πŸ›  Fixed an error that occurred when TypeScripts tests that use Node.js globals were run with TestCafe installed globally (#4437)
    • πŸ›  Fixed the TypeScript definition for the Selector.withAttribute method's return type (#4448)
    • πŸ›  Fixed an issue when custom browser providers could not take screenshots (#4477)
    • πŸ‘Œ Support pages that use advanced ES6 module export (testcafe-hammerhead/#2137)
    • πŸ›  Fixed compatibility issues with Salesforce Lightning Web Components (testcafe-hammerhead/#2152)
  • v1.7.0-rc.1

    November 20, 2019
  • v1.6.2-rc.1

    November 20, 2019

    What’s Changed

  • v1.6.1

    October 29, 2019

    v1.6.1 (2019-10-29)

    πŸ› Bug Fixes

    • πŸ›  Fixed a conflict with Jest type definitions that caused a TypeScript error (#4405)
    • βœ… TestCafe no longer deletes screenshots with no page content detected (#3552)
    • πŸ›  Fixed a bug when TestCafe did not use the default path to the test files (#4331)
    • πŸ›  Fixed a bug when the FFmpeg library could not be detected in the PATH locations (PR #4377)
    • βž• Added a TypeScript definition for runner.tsConfigPath (PR #4403)
  • v1.6.1-alpha.3

    October 31, 2019

    What’s Changed

  • v1.6.1-alpha.2

    October 28, 2019
  • v1.6.1-alpha.1

    October 28, 2019
  • v1.6.0

    October 16, 2019

    v1.6.0 (2019-10-16)

    🍎 🌟 Support for macOS 10.15 Catalina

    ⚑️ This version provides compatibility with macOS 10.15. Update TestCafe to v1.6.0 if you run macOS Catalina.

    ✨ Enhancements

    🍱 βš™οΈ Full-Page Screenshots (#1520)

    βœ… TestCafe can now take screenshots that show the full page, including content that is not visible due to overflow.

    πŸ”§ Enable the fullPage option in CLI, API or configuration file to capture the full page on all screenshots. You can also pass this option to t.takeScreenshot to capture a single full-page screenshot.

    πŸ’» Command line interface

    πŸ“š Enable the fullPage parameter of the -s (--screenshots) flag:

    testcafe chrome test.js -s fullPage=true


    πŸ“š Pass the fullPage option to runner.screenshots:

    runner.screenshots({ fullPage: true});

    πŸ”§ Configuration file

    πŸ“š Set the screenshots.fullPage property:

    { "screenshots": { "fullPage": true } }

    βœ… Test code

    πŸ“š Pass the fullPage option to the t.takeScreenshot action:

    t.takeScreenshot({ fullPage: true});

    🍱 βš™οΈ Compound Screenshot Options

    ⚑️ The command line interface and configuration file schema have been updated to provide a more concise way to specify the screenshot options.

    TestCafe v1.6.0 also supports the existing options to maintain backward compatibility. However, these options are now marked obsolete in the documentation. In the future updates, we will deprecate them and emit warnings.

    πŸ’» Command line interface

    πŸ“š Screenshot options in CLI are now consolidated under the -s (--screenshots) flag in an option=value string:

    testcafe chrome test.js -s takeOnFails=true,pathPattern=${DATE}\_${TIME}/${FILE\_INDEX}.png
    Old Usage New Usage
    -s artifacts/screenshots -s path=artifacts/screenshots
    -S, --screenshots-on-fails -s takeOnFails=true
    -p ${DATE}_${TIME}/${FILE_INDEX}.png -s pathPattern=${DATE}_${TIME}/${FILE_INDEX}.png

    πŸ”§ Configuration file

    πŸ“š Configuration file properties that specify screenshot options are now combined in the screenshots object:

    { "screenshots": { "path": "artifacts/screenshots", "takeOnFails": true, "pathPattern": "${DATE}\_${TIME}/${FILE\_INDEX}.png" } }
    Old Property New Property
    screenshotPath screenshots.path
    takeScreenshotsOnFails screenshots.takeOnFails
    screenshotPathPattern screenshots.pathPattern

    🍱 βš™οΈ Default Screenshot Directory

    βœ… TestCafe now saves the screenshots to ./screenshots if the base directory is not specified.

    πŸ“š The --screenshots CLI flag, the runner.screenshots method or the screenshotPath configuration option are not required to take screenshots. For instance, you can run TestCafe with no additional parameters and use the t.takeScreenshot action in test code:

    testcafe chrome test.js

    βœ… test.js

    fixture `My fixture` .page ``;test('Take a screenshot', async t =\> { await t.takeScreenshot(); });

    πŸ“š The path argument in runner.screenshots is now optional.

    runner.screenshots({ takeOnFails: true});

    🍱 βš™οΈ New Option to Disable Screenshots

    πŸ“š We have added an option that allows you to disable taking screenshots. If this option is specified, TestCafe does not take screenshots when a test fails and when the t.takeScreenshot or t.takeElementScreenshot action is executed.

    πŸ”§ You can disable screenshots with a command line, API or configuration file option:

    πŸ“š the --disable-screenshots command line flag

    testcafe chrome my-tests --disable-screenshots

    πŸ“š the disableScreenshots option in the method{ disableScreenshots: true });

    πŸ“š the disableScreenshots configuration file property

    { "disableScreenshots": true}

    πŸ› Bug Fixes

    • πŸ›  Fixed an error thrown when you pass the -b command line flag (#4294)
    • βœ… TestCafe no longer hangs when Firefox downloads a file (#2741)
    • βœ… You can now start tests from TypeScript code executed with ts-node (#4276)
    • πŸ›  Fixed TypeScript definitions for client script injection API (PR #4272)
    • πŸ›  Fixed TypeScript definitions for disablePageCaching (PR #4274)
    • πŸ›  Fixed a bug when anchor links did not navigate to their target destinations (testcafe-hammerhead/#2080)
  • v1.6.0-rc.1

    October 15, 2019
  • v1.6.0-alpha.1

    October 14, 2019