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 is mainWindowUrl. 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 -cin the command line or use the runner.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 the t.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 is null. (testcafe-hammerhead/#1226)
    • โœ… length, item and namedItem are no longer own properties of LiveNodeListWrapper. (testcafe-hammerhead/#1222)
    • โœ… The scope option in the serviceWorker.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 without window.Iterator. (testcafe-hammerhead/#1231)