TestCafe v1.16.0 Release Notes
Release Date: 2021-09-08 // over 2 years ago-
โจ Enhancements
๐ Support for JavaScript configuration files
๐ง You can now store TestCafe settings in a
js
file. Configuration properties in JavaScript files can reference JavaScript methods, functions and variables, which makes it easy to create dynamic configuration files.Just
export
the JSON name/value pairs in the file:module.exports = { skipJsErrors: true, hostname: "localhost", // other settings }
๐ Support for custom user variables in the configuration file
๐ง TestCafe v1.16.0 and later supports configuration files with variable declarations. Users can reference variables from a configuration file in the tests that utilize that configuration file. To enable access to configuration file variables, import the
userVariables
object from thetestcafe
module at the beginning of the test script.๐ This capability can come in handy if there's a single piece of data you want to use in multiple tests โ for example, the website's URL. That way, if your website moves to a new domain name, you don't have to change your tests one by one.
If you previously used environment variables to achieve the same goal, you might prefer the new method โ it significantly simplifies the setup process, and allows you to commit the data to a version control system.
Define your custom variables with the
userVariables
JSON object:{ "userVariables": { "url": "http://devexpress.github.io/testcafe/example", } }
โ Reference this variable in your test:
import { userVariables } from 'testcafe'; fixture `Test user variables` .page(userVariables.url); test('Type text', async t => { await t .typeText('#developer-name', 'John Smith') .click('#submit-button'); });
Other enhancements
- ๐ New option that disables thumbnail generation for test screenshots (PR by @taki-fw).
- ๐ New
embedding-utils
API method that retrieves information about skipped tests (PR by @flora8984461). - โ
The
Runner.filter
function supports asynchronous arguments (PR by @eignatyev). - โ
You can import the
test
andfixture
objects directly from thetestcafe
module (PR #6338).
๐ Bug Fixes
- โ TestCafe does not keep track of file changes in live mode (#6481).