TestCafe v1.6.0 Release Notes

Release Date: 2019-10-16 // over 4 years ago
  • 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
    

    API

    ๐Ÿ“š 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 `https://example.com`;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 runner.run method

    runner.run({ 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)