TestCafe v0.16.0 Release Notes

  • โœ… TypeScript support, seamless testing in headless Chrome and device emulator, and numerous bug fixes.

    โœจ Enhancements

    โœ… :gear: TypeScript support (#408)

    ๐Ÿš€ In this release, we have added the capability to write tests in TypeScript. By using TypeScript to write your TestCafe tests, you get the advantages of strongly-typed languages such as: rich coding assistance, painless scalability, check-as-you-type code verification, and much more.

    ๐Ÿ“ฆ TestCafe bundles TypeScript declaration file with the npm package, so you have no need to install any additional packages.

    Just create a .ts file with the

    <!-- Use js instead of ts for this code block for proper code highlighting -->

    import { Selector } from 'testcafe';
    

    โœ… and write your test.

    ๐Ÿ“š For details, see TypeScript Support

    โœ… :gear: Support running in Chrome in headless mode and in device emulator (#1417)

    โœ… Now TestCafe allows you to run your tests in Google Chrome in headless and device emulation modes.

    โšก๏ธ Headless mode allows you to run tests in Chrome without any visible UI shell. To run tests in headless mode, use the :headless postfix:

    testcafe "chrome:headless" tests/sample-fixture.js
    

    ๐Ÿ“š Device emulation mode allows you to check how your tests works on mobile devices via Chrome's built-in device emulator. To run tests in device emulation mode, specify emulation: and device parameters:

    testcafe "chrome:emulation:device=iphone 6" tests/sample-fixture.js
    

    ๐Ÿ“š For details, see Using Chrome-specific Features.

    โœ… :gear: Support HTML5 Drag and Drop (#897)

    ๐Ÿš€ Starting with this release, TestCafe supports HTML5 drag and drop, so you can test elements with the draggable attribute.

    โœ… :gear: Fixed URL for opening remote browsers (#1476)

    ๐Ÿ“š We have simplified the format of links that TestCafe generates when you run tests on remote browsers.

    โœ… Now, you have no need to type a unique link for each test run, all the links became constant. So, it is easier now to run tests on a remote device repeatedly: you can run them by navigating a link from your browser history.

    ๐Ÿ› Bug Fixes

    • โœ… No TestCafe UI on screenshots created during testing (#1357)
    • ๐Ÿ‘€ mouseenter and mouseleave events are not triggered during cursor moving (#1426)
    • โœ… The runner's speed option affects the speed of doubleClick action (#1486)
    • โœ… Press action shortcuts work wrong if input's value ends with '.' or starts with '-.' (#1499)
    • โœ… A test report has too small line length on Travis (#1469)
    • โœ… Service messages with cookies do not have enough time to come to server before a new page is loaded (testcafe-hammerhead/#1086)
    • โœ… The window.history.replaceState function is overridden incorrectly (testcafe-hammerhead/#1146)
    • โœ… Hammerhead crashes if a script file contains a sourcemap comment (testcafe-hammerhead/#1052)
    • โœ… The proxy should override the DOMParser.parseFromString method (testcafe-hammerhead/#1133)
    • ๐Ÿ”€ The fetch method should emulate the native behaviour on merging headers (testcafe-hammerhead/#1116)
    • โœ… The EventSource requests are broken when used via proxy (testcafe-hammerhead/#1106)
    • โœ… The code processing may cause syntax errors in some cases because of wrong location property wrapping (testcafe-hammerhead/#1101)
    • โœ… When calling the fetch function without parameters, we should return its native result instead of window.Promise.reject (testcafe-hammerhead/#1099)
    • โœ… The querySelector function is overridden incorrectly (testcafe-hammerhead/#1131)