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