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 tot.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 methodrunner.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)
- ๐ Fixed an error thrown when you pass the