TestCafe v0.16.0 Released

TypeScript support, seamless testing in headless Chrome and device emulator, and numerous bug fixes.

Enhancements

⚙ 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

import { Selector } from 'testcafe';

and write your test.

For details, see TypeScript Support

⚙ 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

Note that headless mode is available for Mac and Linux in Chrome 59. You need a Canary build to enable headless mode on Windows.

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.

⚙ 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.

⚙ 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)