TestCafe v0.17.0 Release Notes
-
โจ Enhancements
โ :gear: Testing Electron applications (testcafe-browser-provider-electron)
โ We have created a browser provider that allows you to test Electron applications with TestCafe.
๐ To do this, install the browser provider plugin from npm:
npm install testcafe-browser-provider-electron
๐ง Create a
.testcafe-electron-rc
file that contains the Electron plugin's configurations. The only required setting here ismainWindowUrl
. It is a URL (or path) to the main window page that relates to the application's directory.{ "mainWindowUrl": "./index.html" }
Place this file in the application root directory.
Next, install the Electron module.
npm install electron@latest
โ You can now run tests. Specify the
electron
browser name and the application path โ when the test launches.testcafe "electron:/home/user/electron-app" "path/to/test/file.js"
testCafe .createRunner() .src('path/to/test/file.js') .browsers('electron:/home/user/electron-app') .run();
๐ Nota that you can also test the Electron app's executable files. See the plugin readme to learn more about the Electron browser provider.
โ :gear: Concurrent test execution (#1165)
โ We have added concurrent test launch. This makes a test batch complete faster.
โ TestCafe launches one instance of each specified browser by default. Tests are run one by one in each of them.
Enable concurrency and TestCafe launches multiple instances of each browser. It distributes the test batch among them. The tests are run in parallel.
๐ป To enable concurrency, add
-c
in the command line or use therunner.concurrency()
API method. ๐ป Specify the number of instances for each browser.testcafe -c 3 chrome tests/test.js
var testRunPromise = runner .src('tests/test.js') .browsers('chrome') .concurrency(3) .run();
๐ See Concurrent Test Execution for more details.
โ :gear: Further improvements in automatic waiting mechanism (#1521)
We have enhanced the waiting mechanism behavior in certain scenarios which required
wait
actions.โ :gear: User roles preserve the local storage (#1454)
โ TestCafe now saves the local storage state when switching between roles. You get the same local storage content you left when you switch back.
โ This is useful for testing websites that perform authentication via local storage instead of cookies.
๐ Bug Fixes
- โ
Selector's
withAttribute
method supports searching by strict match (#1548) - โ
Description for the
path
parameter of thet.takeScreenshot
action has been corrected (#1515) - โ Local storage is now cleaned appropriately after the test run.(#1546)
- ๐
TestCafe now checks element visibility with a timeout when the target element's
style.top
is negative (#1185) - โ Fetching an absolute CORS URL now works correctly. (#1629)
- โ Add partial support for proxying live node collections (the
GetElementsByTagName
method) (#1442) - ๐ TypeScript performance has been enhanced. (#1591)
- โ The right port is now applied to a cross-domain iframe location after redirect. (testcafe-hammerhead/#1191)
- โ All internal properties are marked as non-enumerable. (testcafe-hammerhead/#1182)
- ๐ Support proxying pages with defined referrer policy. (testcafe-hammerhead/#1195)
- โ WebWorker content is now correctly proxied in FireFox 54. (testcafe-hammerhead/#1216)
- โ
Code instrumentation for the
document.activeElement
property works properly if it isnull
. (testcafe-hammerhead/#1226) - โ
length
,item
andnamedItem
are no longer own properties ofLiveNodeListWrapper
. (testcafe-hammerhead/#1222) - โ
The
scope
option in theserviceWorker.register
function is processed correctly. (testcafe-hammerhead/#1233) - โ Promises from a fetch request are now processed correctly. (testcafe-hammerhead/#1234)
- ๐ Fix transpiling for the
for..of
loop to support browsers withoutwindow.Iterator
. (testcafe-hammerhead/#1231)
- โ
Selector's