UNPKG

184 kBMarkdownView Raw
1# Changelog
2
3## v1.8.0 (2020-1-17)
4
5### :star2: Support for the New Microsoft Edge
6
7TestCafe v1.8.0 supports the new Microsoft Edge based on Chromium. The new Edge is available under the same [alias](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browsers/browser-support.html#locally-installed-browsers): `edge`.
8
9```sh
10testcafe edge test.js
11```
12
13```js
14await runner
15 .src('test.js')
16 .browsers('edge')
17 .run();
18```
19
20Supported Edge's features include [headless mode](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browsers/testing-in-headless-mode.html), [mobile device emulation](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browsers/using-chrome-device-emulation.html), and [video recording](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#record-videos).
21
22### Bug Fixes
23
24* Fixed an error thrown when the webpage creates a `Proxy` ([testcafe-hammerhead/#2206](https://github.com/DevExpress/testcafe-hammerhead/issues/2206)) by [@link89](https://github.com/link89)
25* Event handlers are no longer cleared after the `document.open` function call ([testcafe-hammerhead/#1881](https://github.com/DevExpress/testcafe-hammerhead/issues/1881))
26
27## v1.7.1 (2019-12-19)
28
29### Bug Fixes
30
31* Status bar has been redesigned to fit the debug panel into small screens and emulated mobile devices ([#2510](https://github.com/DevExpress/testcafe/issues/2510))
32* Added timestamp to requests logged with `RequestLogger` ([#3738](https://github.com/DevExpress/testcafe/issues/3738))
33* `t.typeText` now fires the `beforeInput` event ([#4486](https://github.com/DevExpress/testcafe/issues/4486))
34* The `t.hover` action can now be detected with the jQuery `:hover` pseudoselector ([#4493](https://github.com/DevExpress/testcafe/issues/4493))
35* `Object.assign` now merges `Symbol` properties on tested pages correctly ([testcafe-hammerhead/#2189](https://github.com/DevExpress/testcafe-hammerhead/issues/2189))
36
37## v1.7.0 (2019-11-21)
38
39### Enhancements
40
41#### :gear: Identify the Browser and Platform in Test Code ([#481](https://github.com/DevExpress/testcafe/issues/481))
42
43TestCafe now allows you to obtain information about the current user agent. These data identify the operating system, platform type, browser, engine, etc.
44
45Use the [t.browser](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html) property to access user agent data.
46
47```js
48import { Selector } from 'testcafe';
49
50fixture `My fixture`
51 .page `https://example.com`;
52
53test('My test', async t => {
54 if (t.browser.name !== 'Chrome')
55 await t.expect(Selector('div').withText('Browser not supported').visible).ok();
56});
57```
58
59The [t.browser](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html) object exposes the following properties:
60
61Property | Type | Description | Example
62-------- | ---- | ------------- | -------
63[alias](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#alias) | String | The browser alias string specified when tests were launched. | `firefox:headless`
64[name](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#name) | String | The browser name. | `Chrome`
65[version](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#version) | String | The browser version. | `77.0.3865.120`
66[platform](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#platform) | String | The platform type. | `desktop`
67[headless](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#headless) | Boolean | `true` if the browser runs in headless mode. | `false`
68[os](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#os) | Object | The name and version of the operating system. | `{ name: 'macOS', version: '10.15.1' }`
69[engine](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#engine) | Object | The name and version of the browser engine. | `{ name: 'Gecko', version: '20100101' }`
70[userAgent](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#useragent) | String | The user agent string. | `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3865.120 Safari/537.36`
71[prettyUserAgent](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#prettyuseragent) | String | Formatted string with the browser's and operating system's name and version. | `Chrome 77.0.3865.75 / macOS 10.14.0`
72
73The following example shows how to create a [beforeEach](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#test-hooks) hook that runs for specific [browser engines](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#engine).
74
75```js
76import { Selector } from 'testcafe';
77
78fixture `My fixture`
79 .page `https://example.com`
80 .beforeEach(async t => {
81 if (t.browser.engine.name === 'Blink')
82 return;
83 // ...
84 });
85```
86
87You can also use [t.browser](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html) to generate the screenshot path based on the [browser name](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html#name). This prevents screenshots taken with [t.takeElementScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-a-page-element) in different browsers from being overwritten.
88
89```js
90import { Selector } from 'testcafe';
91
92fixture `My fixture`
93 .page `https://example.com`;
94
95test('My test', async t => {
96 const loginButton = Selector('div').withText('Login');
97
98 await t.takeElementScreenshot(loginButton, `auth/${t.browser.name}/login-button.png`);
99});
100```
101
102For more information and examples, see [Identify the Browser and Platform](https://devexpress.github.io/testcafe/documentation/test-api/identify-the-browser-and-platform.html).
103
104### Bug Fixes
105
106* Fixed an error on pages that submit forms immediately after loading ([#4360](https://github.com/DevExpress/testcafe/issues/4360) by [@bill-looby-i](https://github.com/bill-looby-i))
107* TestCafe now scrolls to elements located inside Shadow DOM roots ([#4222](https://github.com/DevExpress/testcafe/issues/4222))
108* Fixed an error that occurred when TypeScripts tests that use Node.js globals were run with TestCafe installed globally ([#4437](https://github.com/DevExpress/testcafe/issues/4437))
109* Fixed the TypeScript definition for the `Selector.withAttribute` method's return type ([#4448](https://github.com/DevExpress/testcafe/issues/4448))
110* Fixed an issue when custom browser providers could not take screenshots ([#4477](https://github.com/DevExpress/testcafe/issues/4477))
111* Support pages that use advanced ES6 module export ([testcafe-hammerhead/#2137](https://github.com/DevExpress/testcafe-hammerhead/issues/2137))
112* Fixed compatibility issues with Salesforce Lightning Web Components ([testcafe-hammerhead/#2152](https://github.com/DevExpress/testcafe-hammerhead/issues/2152))
113
114## v1.6.1 (2019-10-29)
115
116### Bug Fixes
117
118* Fixed a conflict with Jest type definitions that caused a TypeScript error ([#4405](https://github.com/DevExpress/testcafe/issues/4405))
119* TestCafe no longer deletes screenshots with no page content detected ([#3552](https://github.com/DevExpress/testcafe/issues/3552))
120* Fixed a bug when TestCafe did not use the default path to the test files ([#4331](https://github.com/DevExpress/testcafe/issues/4331))
121* Fixed a bug when the FFmpeg library could not be detected in the `PATH` locations ([PR #4377](https://github.com/DevExpress/testcafe/pull/4377))
122* Added a TypeScript definition for `runner.tsConfigPath` ([PR #4403](https://github.com/DevExpress/testcafe/pull/4403))
123
124## v1.6.0 (2019-10-16)
125
126### :star2: Support for macOS 10.15 Catalina
127
128This version provides compatibility with macOS 10.15. Update TestCafe to v1.6.0 if you run macOS Catalina.
129
130### Enhancements
131
132#### :gear: Full-Page Screenshots ([#1520](https://github.com/DevExpress/testcafe/issues/1520))
133
134TestCafe can now take screenshots that show the full page, including content that is not visible due to overflow.
135
136Enable the `fullPage` option in CLI, API or configuration file to capture the full page on all screenshots. You can also pass this option to `t.takeScreenshot` to capture a single full-page screenshot.
137
138*Command line interface*
139
140Enable the [fullPage](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#fullpage) parameter of the [-s (--screenshots)](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-s---screenshots-optionvalueoption2value2) flag:
141
142```sh
143testcafe chrome test.js -s fullPage=true
144```
145
146*API*
147
148Pass the `fullPage` option to [runner.screenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#screenshots):
149
150```js
151runner.screenshots({
152 fullPage: true
153});
154```
155
156*Configuration file*
157
158Set the [screenshots.fullPage](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#screenshotsfullpage) property:
159
160```json
161{
162 "screenshots": {
163 "fullPage": true
164 }
165}
166```
167
168*Test code*
169
170Pass the `fullPage` option to the [t.takeScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-the-entire-page) action:
171
172```js
173t.takeScreenshot({
174 fullPage: true
175});
176```
177
178#### :gear: Compound Screenshot Options
179
180The command line interface and configuration file schema have been updated to provide a more concise way to specify the screenshot options.
181
182> TestCafe v1.6.0 also supports the existing options to maintain backward compatibility. However, these options are now marked *obsolete* in the documentation. In the future updates, we will deprecate them and emit warnings.
183
184*Command line interface*
185
186Screenshot options in CLI are now consolidated under the [-s (--screenshots)](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-s---screenshots-optionvalueoption2value2) flag in an `option=value` string:
187
188```sh
189testcafe chrome test.js -s takeOnFails=true,pathPattern=${DATE}_${TIME}/${FILE_INDEX}.png
190```
191
192Old Usage | New Usage
193---------------------------------------------- | -----------
194`-s artifacts/screenshots` | `-s path=artifacts/screenshots`
195`-S`, `--screenshots-on-fails` | `-s takeOnFails=true`
196`-p ${DATE}_${TIME}/${FILE_INDEX}.png` | `-s pathPattern=${DATE}_${TIME}/${FILE_INDEX}.png`
197
198*Configuration file*
199
200Configuration file properties that specify screenshot options are now combined in the [screenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#screenshots) object:
201
202```json
203{
204 "screenshots": {
205 "path": "artifacts/screenshots",
206 "takeOnFails": true,
207 "pathPattern": "${DATE}_${TIME}/${FILE_INDEX}.png"
208 }
209}
210```
211
212Old Property | New Property
213------------------------ | ----------------------------
214`screenshotPath` | `screenshots.path`
215`takeScreenshotsOnFails` | `screenshots.takeOnFails`
216`screenshotPathPattern` | `screenshots.pathPattern`
217
218#### :gear: Default Screenshot Directory
219
220TestCafe now saves the screenshots to `./screenshots` if the base directory is not specified.
221
222The [--screenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-s---screenshots-optionvalueoption2value2) CLI flag, the [runner.screenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#screenshots) method or the [screenshotPath](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#screenshotpath) configuration option are not required to take screenshots. For instance, you can run TestCafe with no additional parameters and use the [t.takeScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-the-entire-page) action in test code:
223
224```sh
225testcafe chrome test.js
226```
227
228*test.js*
229
230```js
231fixture `My fixture`
232 .page `https://example.com`;
233
234test('Take a screenshot', async t => {
235 await t.takeScreenshot();
236});
237```
238
239The `path` argument in [runner.screenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#screenshots) is now optional.
240
241```js
242runner.screenshots({
243 takeOnFails: true
244});
245```
246
247#### :gear: New Option to Disable Screenshots
248
249We have added an option that allows you to disable taking screenshots. If this option is specified, TestCafe does not take screenshots when a test fails and when the [t.takeScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-the-entire-page) or [t.takeElementScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-a-page-element) action is executed.
250
251You can disable screenshots with a command line, API or configuration file option:
252
253* the [--disable-screenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--disable-screenshots) command line flag
254
255 ```sh
256 testcafe chrome my-tests --disable-screenshots
257 ```
258
259* the `disableScreenshots` option in the [runner.run](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#run) method
260
261 ```js
262 runner.run({ disableScreenshots: true });
263 ```
264
265* the [disableScreenshots](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#disablescreenshots) configuration file property
266
267 ```json
268 {
269 "disableScreenshots": true
270 }
271 ```
272
273### Bug Fixes
274
275* Fixed an error thrown when you pass the `-b` command line flag ([#4294](https://github.com/DevExpress/testcafe/issues/4294))
276* TestCafe no longer hangs when Firefox downloads a file ([#2741](https://github.com/DevExpress/testcafe/issues/2741))
277* You can now start tests from TypeScript code executed with `ts-node` ([#4276](https://github.com/DevExpress/testcafe/issues/4276))
278* Fixed TypeScript definitions for client script injection API ([PR #4272](https://github.com/DevExpress/testcafe/pull/4272))
279* Fixed TypeScript definitions for `disablePageCaching` ([PR #4274](https://github.com/DevExpress/testcafe/pull/4274))
280* Fixed a bug when anchor links did not navigate to their target destinations ([testcafe-hammerhead/#2080](https://github.com/DevExpress/testcafe-hammerhead/issues/2080))
281
282## v1.5.0 (2019-9-12)
283
284### Enhancements
285
286#### :gear: Page Caching Can be Disabled ([#3780](https://github.com/DevExpress/testcafe/issues/3780))
287
288TestCafe may be unable to log in to the tested website correctly if the web server uses caching for authentication pages or pages to which users are redirected after login. See the [User Roles](https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html#test-actions-fail-after-authentication) topic for details.
289
290If tests fail unexpectedly after authentication, disable page caching in TestCafe.
291
292Use the [fixture.disablePageCaching](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#disable-page-caching) and [test.disablePageCaching](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#disable-page-caching) methods to disable caching during a particular fixture or test.
293
294```js
295fixture
296 .disablePageCaching `My fixture`
297 .page `https://example.com`;
298```
299
300```js
301test
302 .disablePageCaching
303 ('My test', async t => { /* ... */ });
304```
305
306To disable page caching during the entire test run, use either of the following options:
307
308* the [--disable-page-caching](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--disable-page-caching) command line flag
309
310 ```sh
311 testcafe chrome my-tests --disable-page-caching
312 ```
313
314* the `disablePageCaching` option in the [runner.run](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#run) method
315
316 ```js
317 runner.run({ disablePageCaching: true });
318 ```
319
320* the [disablePageCaching](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#disablepagecaching) configuration file property
321
322 ```json
323 {
324 "disablePageCaching": true
325 }
326 ```
327
328If tests run correctly without page caching, we recommend that you adjust the server settings to disable caching for authentication pages and pages to which the server redirects from them.
329
330### Bug Fixes
331
332* Fixed an error that occured when a selector matched an `<svg>` element ([#3684](https://github.com/DevExpress/testcafe/issues/3684))
333* Fixed an issue when the `reporter` configuration file option was not applied ([#4234](https://github.com/DevExpress/testcafe/issues/4234))
334* Fixed a warning message about invalid `tsconfig.json` file ([#4154](https://github.com/DevExpress/testcafe/issues/4154))
335* `LiveRunner.stop()` now closes the browsers ([#4107](https://github.com/DevExpress/testcafe/issues/4107))
336* Quarantined tests now re-run correctly in live mode ([#4093](https://github.com/DevExpress/testcafe/issues/4093))
337* Fixed a bug when client scripts were not injected in live mode when it re-executed tests ([#4183](https://github.com/DevExpress/testcafe/issues/4183))
338* `form.elements.length` now returns the correct value for forms with file inputs ([testcafe-hammerhead/#2034](https://github.com/DevExpress/testcafe-hammerhead/issues/2034))
339* Fixed a bug when images were not displayed in inputs with the `image` type ([testcafe-hammerhead/#2116](https://github.com/DevExpress/testcafe-hammerhead/issues/2116))
340* Fixed an AngularJS compatibility issue that caused a `TypeError` ([testcafe-hammerhead/#2099](https://github.com/DevExpress/testcafe-hammerhead/issues/2099))
341* TestCafe now works correctly with servers that use `JSZip` to unpack uploaded files ([testcafe-hammerhead/#2115](https://github.com/DevExpress/testcafe-hammerhead/issues/2115))
342
343## v1.4.3 (2019-9-2)
344
345* Information about TestCafe Studio is no longer displayed in the console.
346
347## v1.4.2 (2019-8-28)
348
349### Bug Fixes
350
351* Added support for pages that reference ES6 modules ([testcafe-hammerhead/#1725](https://github.com/DevExpress/testcafe-hammerhead/issues/1725))
352* Events are now emulated correctly if the mouse pointer does not move during scrolling ([#3564](https://github.com/DevExpress/testcafe/issues/3564))
353* Fixed a Capacitor.js compatibility issue ([testcafe-hammerhead/#2094](https://github.com/DevExpress/testcafe-hammerhead/issues/2094))
354* Fixed Node.js TLS warning suppression ([testcafe-hammerhead/PR#2109](https://github.com/DevExpress/testcafe-hammerhead/pull/2109))
355* Fixed a warning about injecting duplicated scripts ([#4116](https://github.com/DevExpress/testcafe/issues/4116))
356* Fixed a bug when information messages were printed in `stderr` ([#3873](https://github.com/DevExpress/testcafe/issues/3873))
357
358## v1.4.1 (2019-8-15)
359
360### Bug Fixes
361
362* Drag now works correctly in Chrome Mobile on Android and Chrome device emulator with touch screens ([#3948](https://github.com/DevExpress/testcafe/issues/3948))
363* Live Mode no longer fails when it restarts tests that import other modules on Node.js v12 ([#4052](https://github.com/DevExpress/testcafe/issues/4052))
364* TestCafe now types into inputs wrapped in `label` elements correctly ([#4068](https://github.com/DevExpress/testcafe/issues/4068))
365* `test.clientScripts` no longer override `fixture.clientScripts` ([#4122](https://github.com/DevExpress/testcafe/issues/4122))
366
367## v1.4.0 (2019-8-7)
368
369### Enhancements
370
371#### :gear: Inject Scripts Into Tested Pages ([#1739](https://github.com/DevExpress/testcafe/issues/1739))
372
373TestCafe now allows you to [inject scripts](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/inject-scripts-into-tested-pages.html) into pages visited during the tests. Use this feature to add helper functions, mock browser API or import modules.
374
375To add client scripts to all tests, specify them in the command line, API or configuration file. Use the following options:
376
377* the [--cs (--client-scripts)](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--cs-pathpath2---client-scripts-pathpath2) command line argument
378
379 ```sh
380 testcafe chrome test.js --client-scripts mockDate.js,assets/react-helpers.js
381 ```
382
383* the [runner.clientScripts](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#clientscripts) API method
384
385 ```js
386 runner.clientScripts('mockDate.js', 'scripts/react-helpers.js');
387 ```
388
389* the [clientScripts](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#clientscripts) configuration file property
390
391 ```json
392 {
393 "clientScripts": ["mockDate.js", "scripts/react-helpers.js"]
394 }
395 ```
396
397If you need to add scripts to individual fixtures or tests, use the [fixture.clientScripts](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#inject-scripts-into-tested-pages) and [test.clientScripts](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#inject-scripts-into-tested-pages) methods in test code.
398
399```js
400fixture `My fixture`
401 .page `http://example.com`
402 .clientScripts('mockDate.js', 'scripts/react-helpers.js');
403```
404
405```js
406test
407 ('My test', async t => { /* ... */ })
408 .clientScripts('mockDate.js', 'scripts/react-helpers.js');
409```
410
411TestCafe also allows you to [inject scripts into specific pages](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/inject-scripts-into-tested-pages.html#provide-scripts-for-specific-pages).
412
413```js
414fixture `My fixture`
415 .clientScripts({
416 page: 'https://myapp.com/page/',
417 path: 'scripts/vue-helpers.js'
418 });
419```
420
421This is helpful when you need to override the browser API on particular pages and use the default behavior everywhere else.
422
423You can specify the scripts to inject as follows:
424
425* pass the [path to a JavaScript file](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/inject-scripts-into-tested-pages.html#inject-a-javascript-file) to inject its content:
426
427 ```js
428 fixture `My fixture`
429 .clientScripts({ path: 'assets/jquery.js' });
430 ```
431
432* use the [module name](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/inject-scripts-into-tested-pages.html#inject-a-module) to inject a module:
433
434 ```js
435 fixture `My fixture`
436 .clientScripts({ module: 'async' });
437 ```
438
439 TestCafe searches for the module's entry point with Node.js mechanisms and injects its content. Note that the browser must be able to execute this module.
440
441* pass the [code](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/inject-scripts-into-tested-pages.html#inject-script-code) you need to inject:
442
443 ```js
444 fixture `My fixture`
445 .clientScripts({ content: 'Geolocation.prototype.getCurrentPosition = () => new Positon(0, 0);' });
446 ```
447
448For more information, see [Inject Scripts into Tested Pages](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/inject-scripts-into-tested-pages.html).
449
450### Bug Fixes
451
452* The browser no longer displays 404 errors after the test submits a form ([#3560](https://github.com/DevExpress/testcafe/issues/3560)
453* TestCafe can now download files when testing in headless mode ([#3127](https://github.com/DevExpress/testcafe/issues/3127))
454* TypeScript no longer throws an error when `fixture` or `fixture.page` uses a tag function ([#4042](https://github.com/DevExpress/testcafe/issues/4042))
455* The `load` event now correctly fires for cached images ([testcafe-hammerhead/#1959](https://github.com/DevExpress/testcafe-hammerhead/issues/1959))
456* TestCafe can now read resources from `asar` archives ([testcafe-hammerhead/#2033](https://github.com/DevExpress/testcafe-hammerhead/issues/2033))
457* Fixed a bug when `testcafe-hammerhead` event listeners were called twice ([testcafe-hammerhead/#2062](https://github.com/DevExpress/testcafe-hammerhead/issues/2062))
458
459## v1.3.3 (2019-7-17)
460
461### Bug Fixes
462
463* TestCafe now throws an error if the specified TypeScript configuration file does not exist ([#3991](https://github.com/DevExpress/testcafe/issues/3991))
464* TypeScript compilation time has been reduced for a large number of files ([#4010](https://github.com/DevExpress/testcafe/issues/4010))
465* Expressions with the `+=` operator are now expanded only when required ([testcafe-hammerhead/#2029](https://github.com/DevExpress/testcafe-hammerhead/issues/2029))
466* Parentheses around the `await` expression are now preserved in the processed scripts ([testcafe-hammerhead/#2072](https://github.com/DevExpress/testcafe-hammerhead/issues/2072))
467* Fixed a compatibility issue with Firefox 68 that prevented text selection ([testcafe-hammerhead/#2071](https://github.com/DevExpress/testcafe-hammerhead/issues/2071))
468
469## v1.3.2 (2019-7-11)
470
471### :gear: Package dependencies have been upgraded to avoid CVEs found in the 'lodash' package
472
473### Bug Fixes
474
475* TestCafe no longer hangs when a disconnected browser reconnects to the network ([#3929](https://github.com/DevExpress/testcafe/issues/3929))
476
477## v1.3.1 (2019-7-5)
478
479This release fixes an issue caused by `tsconfig.json` auto-detection.
480
481### Breaking Changes
482
483#### :boom: TypeScript Configuration File Location is Required to Apply the Custom Compiler Settings ([#3983](https://github.com/DevExpress/testcafe/issues/3983))
484
485Version 1.3.0 introduced support for [custom TypeScript configuration files](https://devexpress.github.io/testcafe/documentation/test-api/typescript-support.html#customize-compiler-options) where you can provide the compiler options. This feature included automatic detection of these configuration files. If the directory from which you run tests contained a `tsconfig.json` file, TestCafe would apply it by default.
486
487However, this behavior caused troubles for users who have already had `tsconfig.json` files with conflicting settings in their projects. TestCafe attempted to apply these configurations, which resulted in issues with test compilation.
488
489In v1.3.1, we have disabled `tsconfig.json` auto-detection. Now you must explicitly specify the `tsconfig.json` file location to apply the compiler settings. You can do it in one of the following ways:
490
491* the [--ts-config-path](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--ts-config-path-path) command line parameter,
492
493 ```sh
494 testcafe chrome my-tests --ts-config-path /Users/s.johnson/testcafe/tsconfig.json
495 ```
496
497* the [runner.tsConfigPath](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#tsconfigpath) API method,
498
499 ```js
500 runner.tsConfigPath('/Users/s.johnson/testcafe/tsconfig.json');
501 ```
502
503* the [tsConfigPath](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#tsconfigpath) configuration file property.
504
505 ```json
506 {
507 "tsConfigPath": "/Users/s.johnson/testcafe/tsconfig.json"
508 }
509 ```
510
511We strongly recommend that you upgrade to v1.3.1. We apologize for any inconvenience.
512
513## v1.3.0 (2019-7-2)
514
515### Enhancements
516
517#### :gear: Customize TypeScript Compiler Options ([#1845](https://github.com/DevExpress/testcafe/issues/1845))
518
519> **Update:** v1.3.1 disables automatic detection of the `tsconfig.json` file. See [v1.3.1 release notes](https://devexpress.github.io/testcafe/blog/testcafe-v1-3-1-released.html) for more information.
520
521TestCafe now allows you to specify the [TypeScript compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) in the `tsconfig.json` configuration file. You can use these options to enable JSX compilation, import code or typings with `paths` aliases, set aliases to React typings, or customize other compiler settings.
522
523Define the `compilerOptions` property in `tsconfig.json` and specify the compiler options in this property:
524
525```json
526{
527 "compilerOptions": {
528 "jsx": "react",
529 "jsxFactory": "myFactory",
530 "paths": {
531 "jquery": [ "node_modules/jquery/dist/jquery" ]
532 },
533 "alwaysStrict": true
534 }
535}
536```
537
538Save this file to the directory from which you run tests (or use the [tsConfigPath](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#tsconfigpath) setting in the main configuration file to specify a different location).
539
540See [Customize Compiler Options](https://devexpress.github.io/testcafe/documentation/test-api/typescript-support.html#customize-compiler-options) for more information.
541
542### Bug Fixes
543
544* TestCafe now waits for asynchronous tasks in `reportTaskDone` to complete before it exits ([#3835](https://github.com/DevExpress/testcafe/issues/3835))
545* `childNodes.length` now returns the correct result after you type in an `iframe` ([#3887](https://github.com/DevExpress/testcafe/issues/3887))
546* TestCafe no longer hangs when a custom request hook throws an error ([#3786](https://github.com/DevExpress/testcafe/issues/3786))
547* Error messages now show the correct selector chains for selectors that use the `with` method ([#3874](https://github.com/DevExpress/testcafe/issues/3874))
548* TestCafe can now work with test files located on a Windows network drive ([#3918](https://github.com/DevExpress/testcafe/issues/3918))
549* Page elements overlapped by the TestCafe status panel are now scrolled into view correctly ([#3924](https://github.com/DevExpress/testcafe/issues/3924))
550* Labels with the `tabIndex` and `for` attributes are now focused correctly ([#3501](https://github.com/DevExpress/testcafe/issues/3501))
551* Fixed a bug that prevented elements behind the footer from being scrolled up on some pages ([#2601](https://github.com/DevExpress/testcafe/issues/2601))
552* Enhanced the previous fix for a Chrome 75 compatibility issue when `t.typeText` typed each character at the beginning of the input ([#3865](https://github.com/DevExpress/testcafe/issues/3865))
553* jQuery scroll functions no longer cause errors ([testcafe-hammerhead/#2045](https://github.com/DevExpress/testcafe-hammerhead/issues/2045))
554
555## v1.2.1 (2019-6-10)
556
557### Bug Fixes
558
559* Fixed a Chrome 75 compatibility issue when `t.typeText` typed each character at the beginning of the input ([#3865](https://github.com/DevExpress/testcafe/issues/3865))
560* Fixed a bug when a test with an unhandled promise rejection passed ([#3787](https://github.com/DevExpress/testcafe/issues/3787))
561* The native dialog handler is now applied when a role redirects to the login page ([#2969](https://github.com/DevExpress/testcafe/issues/2969))
562
563## v1.2.0 (2019-5-28)
564
565### Enhancements
566
567#### :gear: Custom Reporters Can Now Handle Test Start ([#3715](https://github.com/DevExpress/testcafe/issues/3715)) by [@Ivan-Katovich](https://github.com/Ivan-Katovich)
568
569We have added an optional `reportTestStart` method to reporter API. This method fires each time a test starts. You can override it to output information about the started test:
570
571```js
572async reportTestStart (name, meta) {
573 this.write(`Starting test: ${name} (${meta.severity})`)
574 .newline();
575}
576```
577
578This method also enables better integration with third-party reporter frameworks. For instance, [allure](https://github.com/allure-framework/allure2) requires that you perform some actions (namely, [specify the test steps](https://docs.qameta.io/allure/#_steps_6)) before a test starts. Now you can do this in the `reportTestStart` method in a custom reporter.
579
580See the `reportTestStart` method description in [Reporter Methods](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reportteststart).
581
582### Bug Fixes
583
584* Fixed a regression that prevented non-responsive browsers from restarting ([#3781](https://github.com/DevExpress/testcafe/issues/3781))
585* Fixed an issue when `t.click` triggered the `click` event twice ([#3645](https://github.com/DevExpress/testcafe/issues/3645))
586* Fixed a regression that prevented TestCafe from checking `checkbox` inputs with `t.click` ([#3482](https://github.com/DevExpress/testcafe/issues/3482))
587* TestCafe TypeScript definitions no longer cause the `Cannot find namespace 'NodeJS'` error ([#3719](https://github.com/DevExpress/testcafe/issues/3719))
588* TestCafe no longer removes the `Authorization` header when Fetch API is used ([testcafe-hammerhead/#2020](https://github.com/DevExpress/testcafe-hammerhead/issues/2020))
589* TestCafe now provides correct values for the `form.elements.length` property ([testcafe-hammerhead/#2009](https://github.com/DevExpress/testcafe-hammerhead/issues/2009))
590* Fixed the `Invariant Violation` React error caused by TestCafe Hammerhead ([testcafe-hammerhead/#2000](https://github.com/DevExpress/testcafe-hammerhead/issues/2000))
591* Fixed a regression that disabled the `IE=edge` meta tag ([testcafe-hammerhead/#1963](https://github.com/DevExpress/testcafe-hammerhead/issues/1963))
592* Fixed an issue that prevented `t.setFilesToUpload` from raising the `change` event on some file inputs ([testcafe-hammerhead/#2007](https://github.com/DevExpress/testcafe-hammerhead/issues/2007))
593
594## v1.1.4 (2019-5-6)
595
596### Bug Fixes
597
598* Roles now work when navigation to the login URL does not trigger page reload ([#2195](https://github.com/DevExpress/testcafe/issues/2195))
599* TestCafe no longer emits the `touchmove` events when it simulates clicks on Android devices ([#3465](https://github.com/DevExpress/testcafe/issues/3465))
600* `t.takeElementScreenshot` now works if the display has custom color correction ([#2918](https://github.com/DevExpress/testcafe/issues/2918))
601* Fixed a regression that prevented `t.typeText` from working within iframes in IE 11 ([#3724](https://github.com/DevExpress/testcafe/issues/3724))
602* TestCafe now displays the correct error message when a browser is disconnected ([#3711](https://github.com/DevExpress/testcafe/issues/3711))
603* URLs that contain authentication credentials are now processed correctly ([testcafe-hammerhead/#1990](https://github.com/DevExpress/testcafe-hammerhead/issues/1990))
604* TestCafe no longer breaks `async` functions inside constructors ([testcafe-hammerhead/#2002](https://github.com/DevExpress/testcafe-hammerhead/issues/2002))
605
606## v1.1.3 (2019-4-18)
607
608### Bug Fixes
609
610* TestCafe now shows a warning when the `t.resizeWindow` action is used during video recording ([#3513](https://github.com/DevExpress/testcafe/issues/3513))
611* Debugging in the Docker image can now be enabled with the `--inspect` and `--inspect-brk` flags ([#3646](https://github.com/DevExpress/testcafe/issues/3646))
612* You can now use the `--window-width` flag to set the emulated window width for headless Chrome ([#3456](https://github.com/DevExpress/testcafe/issues/3456))
613* TestCafe now shows the correct error message when an iframe is not visible ([#3681](https://github.com/DevExpress/testcafe/issues/3681))
614* The Unlock Page button no longer throws an error when clicked ([#3652](https://github.com/DevExpress/testcafe/issues/3652))
615* The `change` event for a file input is no longer emulated unless the `t.setFilesToUpload` method changes the input value ([testcafe-hammerhead/#1844](https://github.com/DevExpress/testcafe-hammerhead/issues/1844))
616* The upload native dialog is no longer shown in Firefox after a click is simulated ([testcafe-hammerhead/#1984](https://github.com/DevExpress/testcafe-hammerhead/issues/1984))
617* The `style` attribute and the `HTMLElement.style` property values are now synchronized ([testcafe-hammerhead/#1922](https://github.com/DevExpress/testcafe-hammerhead/issues/1922))
618
619## v1.1.2 (2019-4-10)
620
621### Bug Fixes
622
623* TestCafe now captures full-size screenshots on macOS systems with a Retina display ([#3541](https://github.com/DevExpress/testcafe/issues/3541))
624* The `referrer` property is now encoded correctly ([testcafe-hammerhead/#1953](https://github.com/DevExpress/testcafe-hammerhead/issues/1953))
625
626## v1.1.1 (2019-4-4)
627
628### Bug Fixes
629
630* TestCafe no longer crashes if the tested page contains many cross-domain iframes ([testcafe-hammerhead/#1885](https://github.com/DevExpress/testcafe-hammerhead/issues/1885))
631* TestCafe now displays a more concise message when it cannot find and run Chrome or Firefox ([#3534](https://github.com/DevExpress/testcafe/issues/3534))
632* TestCafe no longer creates temporary video files in the concurrency mode ([#3508](https://github.com/DevExpress/testcafe/issues/3508))
633* The `--no-sandbox` and `--disable-dev-shm-usage` flags are now applied automatically when TestCafe runs in a Docker container ([#3531](https://github.com/DevExpress/testcafe/issues/3531))
634* In live mode, TestCafe now hides the spinner when it displays a message or if test compilation has failed ([#3451](https://github.com/DevExpress/testcafe/issues/3451) and ([#3452](https://github.com/DevExpress/testcafe/issues/3452)))
635* TypeScript definitions for `t.expect().contains` have been fixed to support different types ([#3537](https://github.com/DevExpress/testcafe/issues/3537))
636* The `keyPress` event simulation now works properly on Android ([#2236](https://github.com/DevExpress/testcafe/issues/2236))
637* Salesforce Lightning Experience components are now rendered correctly ([testcafe-hammerhead/#1874](https://github.com/DevExpress/testcafe-hammerhead/issues/1874))
638
639## v1.1.0 (2019-2-28)
640
641### Enhancements
642
643#### :gear: TypeScript 3 Support ([#3401](https://github.com/DevExpress/testcafe/issues/3401))
644
645TypeScript test files can now use the new syntax features introduced in [TypeScript 3.0](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html) and [TypeScript 3.3](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-3.html).
646
647#### :gear: Enhanced TypeScript Definitions for Client Functions ([#3431](https://github.com/DevExpress/testcafe/pull/3431)) by [@vitalics](https://github.com/vitalics)
648
649The updated type definitions allow the TypeScript compiler to determine client function's return value type. Static typing now warns you when you call wrong methods for the return value.
650
651```js
652const getFoo = ClientFunction(() => 42);
653const foo = await getFoo();
654foo.match(/foo/);
655```
656
657Before v1.1.0, an error occurred during test execution:
658
659```text
660$ testcafe chrome tests.ts
661 Running tests in:
662 - Chrome 72.0.3626 / Windows 10.0.0
663 Fixture 1
664 √ Test 1
665 √ Test 2
666 ...
667 × Test N
668 1) TypeError: foo.match is not a function
669```
670
671With v1.1.0, the TypeScript compiler throws an error before tests are started:
672
673```text
674$ testcafe chrome tests.ts
675 ERROR Cannot prepare tests due to an error.
676 Error: TypeScript compilation failed.
677
678 tests.ts (4, 2): Property 'match' does not exist on type 'number'.
679```
680
681### Bug Fixes
682
683* TestCafe no longer ignores test and fixture metadata filters specified in the configuration file ([#3443](https://github.com/DevExpress/testcafe/issues/3443)) by [@NanjoW](https://github.com/NanjoW)
684* TestCafe no longer resolves placeholders to `null` in video path patterns ([#3455](https://github.com/DevExpress/testcafe/issues/3455))
685* Fixed the `KeyboardEvent`'s `key` property emulation for Safari ([#3282](https://github.com/DevExpress/testcafe/issues/3282))
686* TestCafe now correctly captures element screenshots after the page was scrolled ([#3292](https://github.com/DevExpress/testcafe/issues/3292))
687* Reduced TypeScript compilation time for a large number of files ([#3475](https://github.com/DevExpress/testcafe/issues/3475))
688* Reach Router can now navigate correctly on tested pages ([testcafe-hammerhead/#1863](https://github.com/DevExpress/testcafe-hammerhead/issues/1863))
689* TestCafe now correctly handles websites that use the `WebKitMutationObserver` class ([testcafe-hammerhead/#1912](https://github.com/DevExpress/testcafe-hammerhead/issues/1912))
690* TestCafe now processes ECMAScript modules in `<script>` tags ([testcafe-hammerhead/#1725](https://github.com/DevExpress/testcafe-hammerhead/issues/1725))
691
692## v1.0.1 (2019-2-15)
693
694### :gear: Package dependencies have been upgraded to avoid CVEs found in the 'lodash' package
695
696### Bug Fixes
697
698* TestCafe no longer hangs when CLI argument validation fails in live mode ([#3402](https://github.com/DevExpress/testcafe/issues/3402))
699* TestCafe no longer fails with the `ERR_STREAM_WRITE_AFTER_END` error after restarting tests in live mode ([#3322](https://github.com/DevExpress/testcafe/issues/3322))
700* TestCafe does not ignore video and encoding options specified in a configuration file ([#3415](https://github.com/DevExpress/testcafe/issues/3415))
701* You can now specify only tests in TestCafe CLI if browsers are specified in a configuration file ([#3421](https://github.com/DevExpress/testcafe/issues/3421))
702* Live mode: TestCafe no longer stops test execution in multiple browsers if tests do not contain actions ([#3410](https://github.com/DevExpress/testcafe/issues/3410))
703* TestCafe now correctly handles the `data-parsley-multiple` attribute ([testcafe-hammerhead/#1845](https://github.com/DevExpress/testcafe-hammerhead/issues/1845))
704* TestCafe now allows passing the `headers` option of the `fetch` function as an Array ([testcafe-hammerhead/#1898](https://github.com/DevExpress/testcafe-hammerhead/issues/1898))
705* No error occurs when page scripts pass a number as an argument to the `window.open` function ([testcafe-hammerhead/#1908](https://github.com/DevExpress/testcafe-hammerhead/issues/1908))
706* TestCafe now correctly processes rewritten stylesheets ([testcafe-hammerhead/#1919](https://github.com/DevExpress/testcafe-hammerhead/pull/1919))
707* TestCafe now correctly processes source maps in stylesheets ([testcafe-hammerhead/#1907](https://github.com/DevExpress/testcafe-hammerhead/issues/1907))
708
709## v1.0.0 (2019-2-7)
710
711### Breaking Changes
712
713#### :boom: Test Syntax Validation Disabled: All Input Files Are Executed
714
715Previous versions performed *test syntax validation* within input script files before executing them. Only files that contained the [fixture](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#fixtures) and [test](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#tests) directives were executed.
716
717Starting with v1.0.0, input script files are **never** validated. This means that TestCafe executes all the scripts you specify as test sources. If you use Glob patterns to specify input test files, please recheck these patterns to avoid unintended file matches.
718
719The `--disable-test-syntax-validation` command line flag and the `disableTestSyntaxValidation` option for the [runner.run](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#run) API method that disabled test syntax validation were removed in v1.0.0.
720
721##### What Has Improved
722
723You can now load tests dynamically without additional customization. The following example illustrates how tests can be imported from an external library.
724
725**external-lib.js**
726
727```js
728export default function runFixture(name, url) {
729 fixture(name)
730 .page(url);
731
732 test(`${url} test`, async t => {
733 // ...
734 });
735}
736```
737
738**test.js**
739
740```js
741import runFixture from './external-lib';
742
743const fixtureName = 'My fixture';
744const url = 'https://testPage';
745
746runFixture(fixtureName, url);
747```
748
749#### :boom: Programming Interface: Multiple Method Calls Prohibited
750
751Previous versions allowed you to call the [runner.src](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#src), [runner.browsers](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#browsers) and [runner.reporter](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#reporter) methods several times to specify multiple test files, browsers or reporters.
752
753```js
754const stream = fs.createWriteStream('report.json');
755
756runner
757 .src('/home/user/tests/fixture1.js')
758 .src('fixture5.js')
759 .browsers('chrome')
760 .browsers('firefox:headless')
761 .reporter('minimal')
762 .reporter('json', stream);
763```
764
765Starting with v1.0.0, pass arrays to these methods to specify multiple values.
766
767To use a reporter that writes to a file, add a `{ name, output }` object to an array (see the [runner.reporter](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#reporter) description for details).
768
769```js
770runner
771 .src(['/home/user/tests/fixture1.js', 'fixture5.js'])
772 .browsers(['chrome', 'firefox:headless'])
773 .reporter(['minimal', { name: 'json', output: 'report.json' }]);
774```
775
776##### What Has Improved
777
778This change was necessary to implement the [configuration file](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html) in a way that is consistent with the API and command line interface.
779
780#### :boom: Custom Request Hooks: Asynchronous API
781
782[Request hook](https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/) methods became asynchronous in TestCafe v1.0.0.
783
784If the [onRequest](https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/creating-a-custom-http-request-hook.html#the-onrequest-method) or [onResponse](https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/creating-a-custom-http-request-hook.html#the-onresponse-method) method in your custom hook returns a Promise, TestCafe now waits for this Promise to resolve.
785
786This does not necessarily leads to unexpected behavior, but still be aware of possible side effects.
787
788Since the [onRequest](https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/creating-a-custom-http-request-hook.html#the-onrequest-method) and [onResponse](https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/creating-a-custom-http-request-hook.html#the-onresponse-method) methods are now asynchronous, add the `async` keyword to their declarations.
789
790```js
791import { RequestHook } from 'testcafe';
792
793class MyRequestHook extends RequestHook {
794 constructor (requestFilterRules, responseEventConfigureOpts) {
795 super(requestFilterRules, responseEventConfigureOpts);
796 // ...
797 }
798
799 async onRequest (event) {
800 // ...
801 }
802
803 async onResponse (event) {
804 // ...
805 }
806}
807```
808
809##### What Has Improved
810
811You can call asynchronous [fs](https://nodejs.org/api/fs.html) functions, invoke a [child_process](https://nodejs.org/api/child_process.html), or perform asynchronous network requests (to a database or any other server) from inside the hooks.
812
813#### :boom: Custom Reporter Plugins: Asynchronous API
814
815TestCafe v1.0.0 also introduces asynchronous API for [reporter plugins](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/).
816
817Similarly to [request hooks](#-boom-custom-request-hooks-asynchronous-api), if any of the custom reporter's methods ([reportTaskStart](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reporttaskstart), [reportFixtureStart](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reportfixturestart), [reportTestDone](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reporttestdone) or [reportTaskDone](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reporttaskdone)) returns a Promise, this Promise is now awaited.
818
819Side effects may show up in certain cases.
820
821Since the reporter methods are now asynchronous, add the `async` keyword to their declarations.
822
823```js
824async reportTaskStart (startTime, userAgents, testCount) {
825 // ...
826},
827
828async reportFixtureStart (name, path, meta) {
829 // ...
830},
831
832async reportTestDone (name, testRunInfo, meta) {
833 // ...
834},
835
836async reportTaskDone (endTime, passed, warnings, result) {
837 // ...
838}
839```
840
841##### What Has Improved
842
843Reporters can call asynchronous [fs](https://nodejs.org/api/fs.html) functions, invoke a [child_process](https://nodejs.org/api/child_process.html), or perform asynchronous network requests (to send an email, use REST API, connect to a database, etc).
844
845### Enhancements
846
847#### :gear: Video Recording ([#2151](https://github.com/DevExpress/testcafe/issues/2151))
848
849You can now [record videos of test runs](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#record-videos) in Google Chrome and Mozilla Firefox. To enable video recording, [install the FFmpeg library](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#prerequisites) and then do one of the following:
850
851* specify the [--video](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--video-basepath) command line flag,
852
853 ```sh
854 testcafe chrome test.js --video artifacts/videos/
855 ```
856
857* call the [runner.video](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#video) API method,
858
859 ```js
860 runner.video('artifacts/videos/');
861 ```
862
863* specify the [videoPath](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#videopath) configuration file property (configuration file is also a new feature, see below).
864
865 ```json
866 {
867 "videoPath": "artifacts/videos/"
868 }
869 ```
870
871TestCafe records all tests and saves each recording in a separate file. You can change this behavior in [video options](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#basic-video-options). You can also customize [video encoding parameters](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#video-encoding-options).
872
873#### :gear: Configuration File ([#3131](https://github.com/DevExpress/testcafe/issues/3131))
874
875TestCafe now allows you to store its settings in the `.testcaferc.json` [configuration file](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html) (with support for [JSON5 syntax](https://json5.org/)).
876
877```json5
878{
879 "browsers": "chrome",
880 "src": ["/home/user/auth-tests/fixture-1.js", "/home/user/mobile-tests/"],
881 "reporter": {
882 "name": "xunit",
883 "output": "reports/report.xml"
884 },
885 "screenshotPath": "/home/user/tests/screenshots/",
886 "takeScreenshotsOnFails": true,
887 "videoPath": "/home/user/tests/videos/",
888 "pageLoadTimeout": 1000,
889 "hostname": "host.mycorp.com"
890 // and more
891}
892```
893
894Keep the configuration file in the project's root directory from which you run TestCafe.
895
896Settings you specify when you launch tests from the command line and programming interfaces override settings from `.testcaferc.json`.
897
898See [Configuration File](https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html) for more information.
899
900#### :gear: Live Mode ([#3215](https://github.com/DevExpress/testcafe/issues/3215))
901
902We have integrated the [testcafe-live](https://github.com/DevExpress/testcafe-live) module into our main code so you can now use the new [live mode](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/live-mode.html).
903
904Live mode keeps the TestCafe process and browsers opened the whole time you are working on tests. Changes you make in code immediately restart the tests. That is, live mode allows you to see test results instantly. See [How Live Mode Works](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/live-mode.html#how-live-mode-works).
905
906Use the [-L (--live)](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-l---live) flag to enable live mode from the command line interface.
907
908```sh
909testcafe chrome tests/test.js -L
910```
911
912In the API, create a [live mode runner](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/livemoderunner.html) with the [testcafe.createLiveModeRunner](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/testcafe.html#createlivemoderunner) function and use it instead of a [regular test runner](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html).
913
914```js
915const createTestCafe = require('testcafe');
916let testcafe = null;
917
918createTestCafe('localhost', 1337, 1338)
919 .then(tc => {
920 testcafe = tc;
921 const liveRunner = testcafe.createLiveModeRunner();
922 return liveRunner
923 .src('tests/test.js')
924 .browsers('chrome')
925 .run();
926 })
927 .then(() => {
928 testcafe.close();
929 });
930```
931
932#### :gear: Custom Reporter API Enhancements (Part of [#2753](https://github.com/DevExpress/testcafe/issues/2753); [Pull Request](https://github.com/DevExpress/testcafe/pull/3177))
933
934* You can now access warnings that appeared during the test run from the [reportTestDone](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reporttestdone) method. Use the `warnings` property of the [testRunInfo](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#testruninfo-object) object.
935
936 ```js
937 async reportTestDone (name, testRunInfo, meta) {
938 const warnings = testRunInfo.warnings;
939 const hasWarnings = !!warnings.length;
940
941 if(hasWarnings) {
942 this.newline()
943 .write('Warnings:');
944
945 warnings.forEach(warning => {
946 this.newline()
947 .write(warning);
948 });
949 }
950 }
951 ```
952
953* The [reportTaskDone](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reporttaskdone) method now receives the [result](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#result-object) parameter that contains information about the number of passed, failed, and skipped tests.
954
955 ```js
956 async reportTaskDone (endTime, passed, warnings, result) {
957 this.write(`Testing finished!`)
958 .newline()
959 .write(`Passed: ${result.passedCount}`)
960 .newline()
961 .write(`Failed: ${result.failedCount}`)
962 .newline();
963 .write(`Skipped: ${result.skippedCount}`)
964 .newline();
965 }
966 ```
967
968#### :gear: Typings for Programming Interface ([#3341](https://github.com/DevExpress/testcafe/issues/3341)) by [@infctr](https://github.com/infctr)
969
970TestCafe [programming interface](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/) now features TypeScript typings.
971
972![API Typings](docs/articles/images/api-typings.png)
973
974#### :gear: Programming Interface: Simpler API to Write Reports to a File
975
976You no longer need to use `fs.createWriteStream` to create a stream that writes a report to a file. You can now pass the file name as the [runner.reporter](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#reporter) parameter.
977
978```js
979runnner.reporter('json', 'reports/report.json');
980```
981
982### Bug Fixes
983
984* The test runner no longer hangs when a custom reporter implementation uses synchronous callbacks ([#3209](https://github.com/DevExpress/testcafe/issues/3209))
985* Fixture hooks for two adjacent fixtures are now executed in the correct order ([#3298](https://github.com/DevExpress/testcafe/issues/3298))
986* Iframes no longer throw an error after a `document.open` call in IE and Edge ([#3343](https://github.com/DevExpress/testcafe/issues/3343))
987* TestCafe no longer triggers a click event when you disable a button with a `span` element inside ([#2902](https://github.com/DevExpress/testcafe/issues/2902))
988* Fixed a bug that led to errors in certain cases ([#3189](https://github.com/DevExpress/testcafe/issues/3189))
989* We have improved the status panel design and adaptivity ([#3073](https://github.com/DevExpress/testcafe/issues/3073))
990* Redirects through several pages in iframes now work correctly ([testcafe-hammerhead/#1825](https://github.com/DevExpress/testcafe-hammerhead/issues/1825))
991* TestCafe can now correctly work with pages that override `HTMLElement.classList` in IE11 ([testcafe-hammerhead/#1890](https://github.com/DevExpress/testcafe-hammerhead/issues/1890))
992
993## v0.23.3 (2018-12-19)
994
995### Bug Fixes
996
997* Remote browsers now start after tests are compiled ([#3219](https://github.com/DevExpress/testcafe/issues/3219)) by [@link89](https://github.com/link89)
998* The TestCafe Docker image now includes version tags ([#2315](https://github.com/DevExpress/testcafe/issues/2315))
999* Tests now fail with a meaningful error if no fixture is defined ([#2913](https://github.com/DevExpress/testcafe/issues/2913))
1000* Tests now resume correctly after a long waiting ([#3070](https://github.com/DevExpress/testcafe/issues/3070))
1001* TestCafe now throws a meaningful exception when taking screenshots in a browser that does not support it ([#2878](https://github.com/DevExpress/testcafe/issues/2878))
1002* Events are now simulated in the correct order when focusing an element after another element was focused on the `changed` event ([#3098](https://github.com/DevExpress/testcafe/issues/3098))
1003* The `Invalid calling object` exception is no longer thrown in IE11 ([testcafe-hammerhead/#1846](https://github.com/DevExpress/testcafe-hammerhead/issues/1846))
1004* The JSON parse error is no longer thrown when sending an XHR request ([testcafe-hammerhead/#1839](https://github.com/DevExpress/testcafe-hammerhead/issues/1839))
1005* Overridden functions now have the right prototype in an `iframe` without `src` ([testcafe-hammerhead/#1824](https://github.com/DevExpress/testcafe-hammerhead/issues/1824))
1006* `gulp-testcafe` now correctly closes Chrome after tests are finished ([testcafe-hammerhead/#1826](https://github.com/DevExpress/testcafe-hammerhead/issues/1826))
1007* Saving the `window` prototype to a property now works correctly ([testcafe-hammerhead/#1828](https://github.com/DevExpress/testcafe-hammerhead/issues/1828))
1008* Hammerhead is now retained after `document.close` in Firefox ([testcafe-hammerhead/#1821](https://github.com/DevExpress/testcafe-hammerhead/issues/1821))
1009
1010## v0.23.2 (2018-11-12)
1011
1012### Bug Fixes
1013
1014* TestCafe no longer posts internal messages to the browser console ([#3099](https://github.com/DevExpress/testcafe/issues/3099))
1015* The TestCafe process no longer terminates before the report is written to a file ([#2502](https://github.com/DevExpress/testcafe/issues/2502))
1016
1017## v0.23.1 (2018-11-7)
1018
1019### Enhancements
1020
1021#### :gear: Select Tests and Fixtures to Run by Their Metadata ([#2527](https://github.com/DevExpress/testcafe/issues/2527)) by [@NickCis](https://github.com/NickCis)
1022
1023You can now run only those tests or fixtures whose [metadata](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#specifying-testing-metadata) contains a specific set of values. Use the [--test-meta](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--test-meta-keyvaluekey2value2) and [--fixture-meta](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--fixture-meta-keyvaluekey2value2) flags to specify these values.
1024
1025```sh
1026testcafe chrome my-tests --test-meta device=mobile,env=production
1027```
1028
1029```sh
1030testcafe chrome my-tests --fixture-meta subsystem=payments,type=regression
1031```
1032
1033In the API, test and fixture metadata is now passed to the [runner.filter](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#filter) method in the `testMeta` and `fixtureMeta` parameters. Use this metadata to build a logic that determines whether to run the current test.
1034
1035```js
1036runner.filter((testName, fixtureName, fixturePath, testMeta, fixtureMeta) => {
1037 return testMeta.mobile === 'true' &&
1038 fixtureMeta.env === 'staging';
1039});
1040```
1041
1042#### :gear: Run Dynamically Loaded Tests ([#2074](https://github.com/DevExpress/testcafe/issues/2074))
1043
1044You can now run tests imported from external libraries or generated dynamically even if the `.js` file does not contain any tests.
1045
1046Previously, test files had to contain the [fixture](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#fixtures) and [test](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#tests) directives. You can now add the `--disable-test-syntax-validation` command line flag to bypass this check.
1047
1048```sh
1049testcafe safari test.js --disable-test-syntax-validation
1050```
1051
1052In the API, use the `disableTestSyntaxValidation` option.
1053
1054```js
1055runner.run({ disableTestSyntaxValidation: true })
1056```
1057
1058### Bug Fixes
1059
1060* Touch events are now simulated with correct touch properties (`touches`, `targetTouches`, `changedTouches`) ([#2856](https://github.com/DevExpress/testcafe/issues/2856))
1061* Google Chrome now closes correctly on macOS after tests are finished ([#2860](https://github.com/DevExpress/testcafe/issues/2860))
1062* Internal attribute and node changes no longer trigger `MutationObserver` notifications ([testcafe-hammerhead/#1769](https://github.com/DevExpress/testcafe-hammerhead/issues/1769))
1063* The `ECONNABORTED` error is no longer raised ([testcafe-hammerhead/#1744](https://github.com/DevExpress/testcafe-hammerhead/issues/1744))
1064* Websites that use `Location.ancestorOrigins` are now proxied correctly ([testcafe-hammerhead/#1342](https://github.com/DevExpress/testcafe-hammerhead/issues/1342))
1065
1066## v0.23.0 (2018-10-25)
1067
1068### Enhancements
1069
1070#### :gear: Stop Test Run After the First Test Fail ([#1323](https://github.com/DevExpress/testcafe/issues/1323))
1071
1072You can now configure TestCafe to stop the entire test run after the first test fail. This saves your time when you fix problems with your tests one by one.
1073
1074Specify the [--sf](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--sf---stop-on-first-fail) flag to enable this feature when you run tests from the command line.
1075
1076```sh
1077testcafe chrome my-tests --sf
1078```
1079
1080In the API, use the [stopOnFirstFail](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#run) option.
1081
1082```js
1083runner.run({ stopOnFirstFail: true })
1084```
1085
1086#### :gear: View the JavaScript Errors' Stack Traces in Reports ([#2043](https://github.com/DevExpress/testcafe/issues/2043))
1087
1088Now when a JavaScript error occurs on the tested webpage, the test run report includes a stack trace for this error (only if the [--skip-js-errors](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-e---skip-js-errors) option is disabled).
1089
1090![A report that contains a stack trace for a client JS error](docs/articles/images/client-error-stack-report.png)
1091
1092#### :gear: Browsers are Automatically Restarted When They Stop Responding ([#1815](https://github.com/DevExpress/testcafe/issues/1815))
1093
1094If a browser stops responding while it executes tests, TestCafe restarts the browser and reruns the current test in a new browser instance.
1095If the same problem occurs with this test two more times, the test run finishes and an error is thrown.
1096
1097### Bug Fixes
1098
1099* An error message about an unawaited call to an async function is no longer displayed when an uncaught error occurs ([#2557](https://github.com/DevExpress/testcafe/issues/2557))
1100* A request hook is no longer added multiple times when a filter rule is used ([#2650](https://github.com/DevExpress/testcafe/issues/2650))
1101* Screenshot links in test run reports now contain paths specified by the `--screenshot-pattern` option ([#2726](https://github.com/DevExpress/testcafe/issues/2726))
1102* Assertion chains no longer produce unhandled promise rejections ([#2852](https://github.com/DevExpress/testcafe/issues/2852))
1103* The `moment` loader now works correctly in the Jest environment ([#2500](https://github.com/DevExpress/testcafe/issues/2500))
1104* TestCafe no longer hangs if the screenshot directory contains forbidden symbols ([#681](https://github.com/DevExpress/testcafe/issues/681))
1105* The `--ssl` option's parameters are now parsed correctly ([#2924](https://github.com/DevExpress/testcafe/issues/2924))
1106* TestCafe now throws a meaningful error if an assertion method is missing ([#1063](https://github.com/DevExpress/testcafe/issues/1063))
1107* TestCafe no longer hangs when it clicks a custom element ([#2861](https://github.com/DevExpress/testcafe/issues/2861))
1108* TestCafe now performs keyboard navigation between radio buttons/groups in a way that matches the native browser behavior ([#2067](https://github.com/DevExpress/testcafe/issues/2067), [#2045](https://github.com/DevExpress/testcafe/issues/2045))
1109* The `fetch` method can now be used with data URLs ([#2865](https://github.com/DevExpress/testcafe/issues/2865))
1110* The `switchToIframe` function no longer throws an error ([#2956](https://github.com/DevExpress/testcafe/issues/2956))
1111* TestCafe can now scroll through fixed elements when the action has custom offsets ([#2978](https://github.com/DevExpress/testcafe/issues/2978))
1112* You can now specify the current directory or its parent directories as the base path to store screenshots ([#2975](https://github.com/DevExpress/testcafe/issues/2975))
1113* Tests no longer hang up when you try to debug in headless browsers ([#2846](https://github.com/DevExpress/testcafe/issues/2846))
1114* The `removeEventListener` function now works correctly when an object is passed as its third argument ([testcafe-hammerhead/#1737](https://github.com/DevExpress/testcafe-hammerhead/issues/1737))
1115* Hammerhead no longer adds the `event` property to a null `contentWindow` in IE11 ([testcafe-hammerhead/#1684](https://github.com/DevExpress/testcafe-hammerhead/issues/1684))
1116* The browser no longer resets connection with the server for no reason ([testcafe-hammerhead/#1647](https://github.com/DevExpress/testcafe-hammerhead/issues/1647))
1117* Hammerhead now stringifies values correctly before outputting them to the console ([testcafe-hammerhead/#1750](https://github.com/DevExpress/testcafe-hammerhead/issues/1750))
1118* A document fragment from the top window can now be correctly appended to an iframe ([testcafe-hammerhead/#912](https://github.com/DevExpress/testcafe-hammerhead/issues/912))
1119* Lifecycle callbacks that result from the `document.registerElement` method are no longer called twice ([testcafe-hammerhead/#695](https://github.com/DevExpress/testcafe-hammerhead/issues/695))
1120
1121## v0.22.0 (2018-9-3)
1122
1123### Enhancements
1124
1125#### :gear: CoffeeScript Support ([#1556](https://github.com/DevExpress/testcafe/issues/1556)) by [@GeoffreyBooth](https://github.com/GeoffreyBooth)
1126
1127TestCafe now allows you to write tests in CoffeeScript. You do not need to compile CoffeeScript manually or make any customizations - everything works out of the box.
1128
1129```coffee
1130import { Selector } from 'testcafe'
1131
1132fixture 'CoffeeScript Example'
1133 .page 'https://devexpress.github.io/testcafe/example/'
1134
1135nameInput = Selector '#developer-name'
1136
1137test 'Test', (t) =>
1138 await t
1139 .typeText(nameInput, 'Peter')
1140 .typeText(nameInput, 'Paker', { replace: true })
1141 .typeText(nameInput, 'r', { caretPos: 2 })
1142 .expect(nameInput.value).eql 'Parker';
1143```
1144
1145#### :gear: Failed Selector Method Pinpointed in the Report ([#2568](https://github.com/DevExpress/testcafe/issues/2568))
1146
1147Now the test run report can identify which selector's method does not match any DOM element.
1148
1149![Failed Selector Report](docs/articles/images/failed-selector-report.png)
1150
1151#### :gear: Fail on Uncaught Server Errors ([#2546](https://github.com/DevExpress/testcafe/issues/2546))
1152
1153Previously, TestCafe ignored uncaught errors and unhandled promise rejections that occurred on the server. Whenever an error or a promise rejection happened, test execution continued.
1154
1155Starting from v0.22.0, tests fail if a server error or promise rejection is unhandled. To return to the previous behavior, we have introduced the `skipUncaughtErrors` option. Use the [--skip-uncaught-errors](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-u---skip-uncaught-errors) flag in the command line or the [skipUncaughtErrors](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#run) option in the API.
1156
1157```sh
1158testcafe chrome tests/fixture.js --skipUncaughtErrors
1159```
1160
1161```js
1162runner.run({skipUncaughtErrors:true})
1163```
1164
1165#### :gear: Use Glob Patterns in `runner.src` ([#980](https://github.com/DevExpress/testcafe/issues/980))
1166
1167You can now use [glob patterns](https://github.com/isaacs/node-glob#glob-primer) in the [runner.src](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#src) method to specify a set of test files.
1168
1169```js
1170runner.src(['/home/user/tests/**/*.js', '!/home/user/tests/foo.js']);
1171```
1172
1173### Bug Fixes
1174
1175* `RequestLogger` no longer fails when it tries to stringify a null request body ([#2718](https://github.com/DevExpress/testcafe/issues/2718))
1176* Temporary directories are now correctly removed when the test run is finished ([#2735](https://github.com/DevExpress/testcafe/issues/2735))
1177* TestCafe no longer throws `ECONNRESET` when run against a Webpack project ([#2711](https://github.com/DevExpress/testcafe/issues/2711))
1178* An error is no longer thrown when TestCafe tests Sencha ExtJS applications in IE11 ([#2639](https://github.com/DevExpress/testcafe/issues/2639))
1179* Firefox no longer waits for page elements to appear without necessity ([#2080](https://github.com/DevExpress/testcafe/issues/2080))
1180* `${BROWSER}` in the screenshot pattern now correctly resolves to the browser name ([#2742](https://github.com/DevExpress/testcafe/issues/2742))
1181* The `toString` function now returns a native string for overridden descriptor ancestors ([testcafe-hammerhead/#1713](https://github.com/DevExpress/testcafe-hammerhead/issues/1713))
1182* The `iframe` flag is no longer added when a form with `target="_parent"` is submitted ([testcafe-hammerhead/#1680](https://github.com/DevExpress/testcafe-hammerhead/issues/1680))
1183* Hammerhead no longer sends request headers in lower case ([testcafe-hammerhead/#1380](https://github.com/DevExpress/testcafe-hammerhead/issues/1380))
1184* The overridden `createHTMLDocument` method has the right context now ([testcafe-hammerhead/#1722](https://github.com/DevExpress/testcafe-hammerhead/issues/1722))
1185* Tests no longer lose connection ([testcafe-hammerhead/#1647](https://github.com/DevExpress/testcafe-hammerhead/issues/1647))
1186* The case when both the `X-Frame-Options` header and a CSP with `frame-ancestors` are set is now handled correctly ([testcafe-hammerhead/#1666](https://github.com/DevExpress/testcafe-hammerhead/issues/1666))
1187* The mechanism that resolves URLs on the client now works correctly ([testcafe-hammerhead/#1701](https://github.com/DevExpress/testcafe-hammerhead/issues/1701))
1188* `LiveNodeListWrapper` now imitates the native behavior correctly ([testcafe-hammerhead/#1376](https://github.com/DevExpress/testcafe-hammerhead/issues/1376))
1189
1190## v0.21.1 (2018-8-8)
1191
1192### Bug fixes
1193
1194* The `RequestLogger.clear` method no longer raises an error if it is called during a long running request ([#2688](https://github.com/DevExpress/testcafe/issues/2688))
1195* TestCafe now uses native methods to work with the `fetch` request ([#2686](https://github.com/DevExpress/testcafe/issues/2686))
1196* A URL now resolves correctly for elements in a `document.implementation` instance ([testcafe-hammerhead/#1673](https://github.com/DevExpress/testcafe-hammerhead/issues/1673))
1197* Response header names specified via the `respond` function are lower-cased now ([testcafe-hammerhead/#1704](https://github.com/DevExpress/testcafe-hammerhead/issues/1704))
1198* The cookie domain validation rule on the client side has been fixed ([testcafe-hammerhead/#1702](https://github.com/DevExpress/testcafe-hammerhead/issues/1702))
1199
1200## v0.21.0 (2018-8-2)
1201
1202### Enhancements
1203
1204#### :gear: Test Web Pages Served Over HTTPS ([#1985](https://github.com/DevExpress/testcafe/issues/1985))
1205
1206Some browser features (like [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API), [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API), [ApplePaySession](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession), or [SubtleCrypto](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto)) require a secure origin. This means that the website should use the HTTPS protocol.
1207
1208Starting with v0.21.0, TestCafe can serve proxied web pages over HTTPS. This allows you to test pages that require a secure origin.
1209
1210To enable HTTPS when you use TestCafe through the command line, specify the [--ssl](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--ssl-options) flag followed by the [HTTPS server options](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener). The most commonly used options are described in the [TLS topic](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) in the Node.js documentation.
1211
1212```sh
1213testcafe --ssl pfx=path/to/file.pfx;rejectUnauthorized=true;...
1214```
1215
1216When you use a programming API, pass the HTTPS server options to the [createTestCafe](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/createtestcafe.html) method.
1217
1218```js
1219'use strict';
1220
1221const createTestCafe = require('testcafe');
1222const selfSignedSertificate = require('openssl-self-signed-certificate');
1223let runner = null;
1224
1225const sslOptions = {
1226 key: selfSignedSertificate.key,
1227 cert: selfSignedSertificate.cert
1228};
1229
1230createTestCafe('localhost', 1337, 1338, sslOptions)
1231 .then(testcafe => {
1232 runner = testcafe.createRunner();
1233 })
1234 .then(() => {
1235 return runner
1236 .src('test.js')
1237
1238 // Browsers restrict self-signed certificate usage unless you
1239 // explicitly set a flag specific to each browser.
1240 // For Chrome, this is '--allow-insecure-localhost'.
1241 .browsers('chrome --allow-insecure-localhost')
1242 .run();
1243 });
1244```
1245
1246See [Connect to TestCafe Server over HTTPS](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/connect-to-the-testcafe-server-over-https.html) for more information.
1247
1248#### :gear: Construct Screenshot Paths with Patterns ([#2152](https://github.com/DevExpress/testcafe/issues/2152))
1249
1250You can include placeholders in the path, for example, `${DATE}`, `${TIME}`, `${USERAGENT}`, etc. For a complete list, refer to [Path Pattern Placeholders](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#path-pattern-placeholders).
1251
1252You should specify a screenshot path pattern when you run tests. Each time TestCafe takes a screenshot, it substitutes the placeholders with actual values and saves the screenshot to the resulting path.
1253
1254The following example shows how to use the command line to specify a screenshot path pattern:
1255
1256```sh
1257testcafe all test.js -s path=screenshots,pathPattern=${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png
1258```
1259
1260When you use a programming API, pass the screenshot path pattern to the [runner.screenshots method](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#screenshots).
1261
1262```js
1263runner.screenshots({
1264 path: 'reports/screenshots/',
1265 takeOnFails: true,
1266 pathPattern: '${TEST_INDEX}/${OS}/${BROWSER}-v${BROWSER_VERSION}/${FILE_INDEX}.png'
1267});
1268```
1269
1270#### :gear: Add Info About Screenshots and Quarantine Attempts to Custom Reports ([#2216](https://github.com/DevExpress/testcafe/issues/2216))
1271
1272Custom reporters can now access screenshots' data and the history of quarantine attempts (if the test run in the quarantine mode).
1273
1274The following information about screenshots is now available:
1275
1276* the path to the screenshot file,
1277* the path to the thumbnail image,
1278* the browser's user agent,
1279* the quarantine attempt number (if the screenshot was taken in the quarantine mode),
1280* whether the screenshot was taken because the test failed.
1281
1282If the test was run in the quarantine mode, you can also determine which attempts failed and passed.
1283
1284Refer to the [reportTestDone method description](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html#reporttestdone) for details on how to access this information.
1285
1286### Bug Fixes
1287
1288* HTML5 drag events are no longer simulated if `event.preventDefault` is called for the `mousedown` event ([#2529](https://github.com/DevExpress/testcafe/issues/2529))
1289* File upload no longer causes an exception when there are several file inputs on the page ([#2642](https://github.com/DevExpress/testcafe/issues/2642))
1290* File upload now works with inputs that have the `required` attribute ([#2509](https://github.com/DevExpress/testcafe/issues/2509))
1291* The `load` event listener is no longer triggered when added to an image ([testcafe-hammerhead/#1688](https://github.com/DevExpress/testcafe-hammerhead/issues/1688))
1292
1293## v0.20.5 (2018-7-18)
1294
1295### Bug fixes
1296
1297* The `buttons` property was added to the `MouseEvent` instance ([#2056](https://github.com/DevExpress/testcafe/issues/2056))
1298* Response headers were converted to lowercase ([#2534](https://github.com/DevExpress/testcafe/issues/2534))
1299* Updated flow definitions ([#2053](https://github.com/DevExpress/testcafe/issues/2053))
1300* An `AttributesWrapper` instance is now updated when the the element's property specifies the `disabled` attribute ([#2539](https://github.com/DevExpress/testcafe/issues/2539))
1301* TestCafe no longer hangs when it redirects from a tested page to the 'about:error' page with a hash ([#2371](https://github.com/DevExpress/testcafe/issues/2371))
1302* TestCafe now reports a warning for a mocked request if CORS validation failed ([#2482](https://github.com/DevExpress/testcafe/issues/2482))
1303* Prevented situations when a request logger tries to stringify a body that is not logged ([#2555](https://github.com/DevExpress/testcafe/issues/2555))
1304* The Selector API now reports `NaN` instead of `integer` when type validation fails ([#2470](https://github.com/DevExpress/testcafe/issues/2470))
1305* Enabled `noImplicitAny` and disabled `skipLibCheck` in the TypeScript compiler ([#2497](https://github.com/DevExpress/testcafe/issues/2497))
1306* Pages with `rel=prefetch` links no longer hang during test execution ([#2528](https://github.com/DevExpress/testcafe/issues/2528))
1307* Fixed the `TypeError: this.res.setHeader is not a function` error in Firefox ([#2438](https://github.com/DevExpress/testcafe/issues/2438))
1308* The `formtarget` attribute was overridden ([testcafe-hammerhead/#1513](https://github.com/DevExpress/testcafe-hammerhead/issues/1513))
1309* `fetch.toString()` now equals `function fetch() { [native code] }` ([testcafe-hammerhead/#1662](https://github.com/DevExpress/testcafe-hammerhead/issues/1662))
1310
1311## v0.20.4 (2018-6-25)
1312
1313### Enhancements
1314
1315#### TestCafe now takes screenshots using browsers' debug protocols ([#2492](https://github.com/DevExpress/testcafe/pull/2492))
1316
1317### Bug fixes
1318
1319* `fetch` requests now correctly proxied in a specific case ([testcafe-hammerhead/#1613](https://github.com/DevExpress/testcafe-hammerhead/issues/1613))
1320* Resources responding with `304` HTTP status code and with the 'content-length: ' header are proxied correctly now ([testcafe-hammerhead/#1602](https://github.com/DevExpress/testcafe-hammerhead/issues/1602))
1321* The `transfer` argument of `window.postMessage` is passed correctly now ([testcafe-hammerhead/#1535](https://github.com/DevExpress/testcafe-hammerhead/issues/1535))
1322* Incorrect focus events order in IE has been fixed ([#2072](https://github.com/DevExpress/testcafe/issues/2072))
1323
1324## v0.20.3 (2018-6-6)
1325
1326### Enhancements
1327
1328#### :gear: Add TS definitions to the Docker image ([#2481](https://github.com/DevExpress/testcafe/pull/2481))
1329
1330### Bug fixes
1331
1332* Selection in a `contenteditable` `div` now works properly in a specific scenario ([#2365](https://github.com/DevExpress/testcafe/issues/2365))
1333* A collision related to several `moment-duration-format` package versions is now fixed ([#1750](https://github.com/DevExpress/testcafe/issues/1750))
1334* TestCafe now reports a warning when saving several screenshots at the same path ([#2213](https://github.com/DevExpress/testcafe/issues/2213))
1335* A regression related to wrongly processed `document.write` in IE11 is now fixed ([#2469](https://github.com/DevExpress/testcafe/issues/2469))
1336* An out of memory crash on calling console methods is now fixed ([testcafe-hammerhead/#1546](https://github.com/DevExpress/testcafe-hammerhead/issues/1546))
1337* `Click` action for an element with 1px height or width works properly now ([#2020](https://github.com/DevExpress/testcafe/issues/2020))
1338* Touch emulation for the latest Google Chrome was fixed ([#2448](https://github.com/DevExpress/testcafe/issues/2448))
1339
1340## v0.20.2 (2018-5-24)
1341
1342### :gear: Package dependencies have been upgraded to avoid CVEs reported by Node Security Platform
1343
1344### Bug fixes
1345
1346* Enabled the screenshot and window resizing functionalities in the concurrency mode for Firefox and Chrome on macOS [#2095](https://github.com/DevExpress/testcafe/issues/2095)
1347
1348## v0.20.1 (2018-5-21)
1349
1350### :gear: Typescript definitions for new features from v0.20.0 have been added ([#2428](https://github.com/DevExpress/testcafe/issues/2428))
1351
1352### Bug fixes
1353
1354* Now sites with the overridden `Element.prototype.matches` method work properly [#2241](https://github.com/DevExpress/testcafe/issues/2241)
1355* `window.Blob` now returns a correct result when Array of `ArrayBuffer` is passed as a parameter ([testcafe-hammerhead/#1599](https://github.com/DevExpress/testcafe-hammerhead/issues/1599))
1356* Firefox Shield popup is not shown during test execution now ([#2421](https://github.com/DevExpress/testcafe/pull/2421))
1357
1358## v0.20.0 (2018-5-15)
1359
1360### Request Hooks: Intercepting HTTP requests ([#1341](https://github.com/DevExpress/testcafe/issues/1341))
1361
1362TestCafe now allows you to record HTTP request data or mock responses. You can also create a custom HTTP request hook to emulate authentications like **Kerberos** or **Client Certificate Authentication**.
1363
1364See [Intercepting HTTP Requests](https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests) for more information.
1365
1366### Enhancements
1367
1368#### :gear: Specifying resources accessed by bypassing a proxy server ([#1791](https://github.com/DevExpress/testcafe/issues/1791))
1369
1370TestCafe now allows you to bypass the proxy server when accessing specific resources.
1371
1372To specify resources that require direct access, use the [--proxy-bypass](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--proxy-bypass-rules) flag in the command line or the [useProxy](https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html) API method's parameters.
1373
1374```sh
1375testcafe chrome my-tests/**/*.js --proxy proxy.corp.mycompany.com --proxy-bypass localhost:8080,internal-resource.corp.mycompany.com
1376```
1377
1378```js
1379runner.useProxy('172.0.10.10:8080', ['localhost:8080', 'internal-resource.corp.mycompany.com']);
1380```
1381
1382#### :gear: Specifying testing metadata ([#2242](https://github.com/DevExpress/testcafe/issues/2242))
1383
1384TestCafe allows you to specify additional information for tests in the form of key-value metadata and use it in reports.
1385
1386You can define metadata for a fixture or a test using the [meta](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#specifying-testing-metadata) method:
1387
1388```js
1389fixture `My Fixture`
1390 .meta('fixtureID', 'f-0001')
1391 .meta({ author: 'John', creationDate: '05/03/2018' });
1392```
1393
1394```js
1395test
1396 .meta('testID', 't-0005')
1397 .meta({ severity: 'critical', testedAPIVersion: '1.0' })
1398 ('MyTest', async t => { /* ... */});
1399```
1400
1401To include testing metadata to reports, use the [custom reporter methods](https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/reporter-methods.html).
1402
1403#### :gear: Passing a regular promise to `t.expect` is deprecated now ([#2207](https://github.com/DevExpress/testcafe/issues/2207))
1404
1405TestCafe now throws an error if you pass a regular promise to the assertion's `expect` method.
1406
1407If you need to assert a regular promise, set the [allowUnawaitedPromise](https://devexpress.github.io/testcafe/documentation/test-api/assertions/#optionsallowunawaitedpromise) option to `true`.
1408
1409```js
1410await t.expect(doSomethingAsync()).ok('check that a promise is returned', { allowUnawaitedPromise: true });
1411```
1412
1413### Bug Fixes
1414
1415* The session recovery bubble in Firefox is disabled ([#2341](https://github.com/DevExpress/testcafe/pull/2341))
1416* TestCafe works properly if a `body` element has the `pointer-events: none;` css style rule ([#2251](https://github.com/DevExpress/testcafe/issues/2251))
1417* Resizing Chrome in the emulation mode works correctly ([#2154](https://github.com/DevExpress/testcafe/issues/2154))
1418* The location port is used for service messages ([#2308](https://github.com/DevExpress/testcafe/pull/2308))
1419* A browser instance shuts down correctly on Unix systems ([#2226](https://github.com/DevExpress/testcafe/issues/2226))
1420* An `Integrity` attribute is removed from `script` and `link` tags ([testcafe-hammerhead/#235](https://github.com/DevExpress/testcafe-hammerhead/issues/235))
1421* The `event.preventDefault()` method call changes the `event.defaultPrevented` property value ([testcafe-hammerhead/#1588](https://github.com/DevExpress/testcafe-hammerhead/issues/1588))
1422* It is possible to set the `meta` element's `content` attribute ([testcafe-hammerhead/#1586](https://github.com/DevExpress/testcafe-hammerhead/issues/1586))
1423* TestCafe no longer overrides attributes used in a non-standard way with `null` ([testcafe-hammerhead/#1583](https://github.com/DevExpress/testcafe-hammerhead/pull/1583))
1424* The `Change` event fires correctly if the `target.value` changes ([#2319](https://github.com/DevExpress/testcafe/issues/2319))
1425* `MouseEvent.screenX` and `MouseEvent.screenY` are added to the emulated events ([#2325](https://github.com/DevExpress/testcafe/issues/2325))
1426* Cookies on `localhost` are processed correctly ([testcafe-hammerhead/#1491](https://github.com/DevExpress/testcafe-hammerhead/issues/1491))
1427* Setting the `//` url for an image works correctly ([#2312](https://github.com/DevExpress/testcafe/issues/2312))
1428* `shadowUI` internal elements are no longer processed ([#2281](https://github.com/DevExpress/testcafe/issues/2281))
1429* `typeInput` event is raised correctly ([#1956](https://github.com/DevExpress/testcafe/issues/1956))
1430* Selecting text in contenteditable elements works properly ([#2301](https://github.com/DevExpress/testcafe/issues/2301))
1431
1432## v0.19.2 (2018-4-11)
1433
1434### Enhancements
1435
1436#### Added support for browser providers from private repositories ([#2221](https://github.com/DevExpress/testcafe/issues/2221))
1437
1438### Bug Fixes
1439
1440* Restored the screenshot functionality in legacy tests ([#2235](https://github.com/DevExpress/testcafe/issues/2235))
1441* Updated the list of emulation devices in Google Chrome ([#2257](https://github.com/DevExpress/testcafe/issues/2257))
1442* Fixed touch events emulation ([#2268](https://github.com/DevExpress/testcafe/issues/2268))
1443* The `event.relatedTarget` property is set correctly for the emulated focus and drag events ([#2197](https://github.com/DevExpress/testcafe/issues/2197))
1444* The `event.detail` property is set correctly for the emulated mouse events ([#2232](https://github.com/DevExpress/testcafe/issues/2232))
1445* The `Element.innerHTML` property is processed correctly in certain cases ([testcafe-hammerhead/#1538](https://github.com/DevExpress/testcafe-hammerhead/issues/1538))
1446* The iframe location has the correct value when it is not initialized ([testcafe-hammerhead/#1531](https://github.com/devexpress/testcafe-hammerhead/issues/1531))
1447* A trailing slash is added to test page URL when necessary ([#2005](https://github.com/DevExpress/testcafe/issues/2005))
1448* The `focus` event is not called for a disabled input ([#2123](https://github.com/devexpress/testcafe/issues/2123))
1449
1450## v0.19.1 (2018-3-13)
1451
1452### Backward compatibility with the legacy test syntax has been restored ([#2210](https://github.com/DevExpress/testcafe/issues/2210))
1453
1454### Bug Fixes
1455
1456* The `document.all` property is overridden ([testcafe-hammerhead/#1046](https://github.com/DevExpress/testcafe-hammerhead/issues/1046))
1457* Proxying properties in `async` class methods are supported ([testcafe-hammerhead/#1510](https://github.com/DevExpress/testcafe-hammerhead/issues/1510))
1458* Fixed wrongly proxying a `localStorage` check-in WebWorkers ([testcafe-hammerhead/#1496](https://github.com/DevExpress/testcafe-hammerhead/issues/1496))
1459
1460## v0.19.0 (2018-3-1)
1461
1462### TestCafe Live: See instant feedback when working on tests ([#1624](https://github.com/DevExpress/testcafe/issues/1624))
1463
1464We have prepared a new tool for rapid test development.
1465
1466TestCafe Live provides a service that keeps the TestCafe process and browsers opened while you are working on tests. Changes you make in code immediately restart the tests. That is, TestCafe Live allows you to see test results instantly.
1467
1468[![TestCafe Live Video](https://raw.githubusercontent.com/DevExpress/testcafe/master/media/changelog/testcafe-live-video.png)](https://www.youtube.com/watch?v=RWQtB6Xv01Q)
1469
1470See [TestCafe Live](https://github.com/DevExpress/testcafe-live) for more information.
1471
1472### Enhancements
1473
1474#### :gear: Taking Screenshots of Individual Page Elements ([#1496](https://github.com/DevExpress/testcafe/issues/1496))
1475
1476We have added the [t.takeElementScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-a-page-element) action that allows you to take a screenshot of an individual page element.
1477
1478```js
1479import { Selector } from 'testcafe';
1480
1481fixture `My fixture`
1482 .page `http://devexpress.github.io/testcafe/example/`;
1483
1484test('Take a screenshot of a fieldset', async t => {
1485 await t
1486 .click('#reusing-js-code')
1487 .click('#continuous-integration-embedding')
1488 .takeElementScreenshot(Selector('fieldset').nth(1), 'my-fixture/important-features.png');
1489});
1490```
1491
1492This action provides additional customization that allows you to adjust the screenshot's center or crop it. Refer to the [t.takeElementScreenshot](https://devexpress.github.io/testcafe/documentation/test-api/actions/take-screenshot.html#take-a-screenshot-of-a-page-element) description for more information.
1493
1494#### :gear: Filtering Elements by Their Visibility ([#1018](https://github.com/DevExpress/testcafe/issues/1018))
1495
1496You can now use the [filterVisible](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/functional-style-selectors.html#filtervisible) and [filterHidden](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/functional-style-selectors.html#filterhidden) methods to display only visible or hidden elements.
1497
1498```js
1499import { Selector } from 'testcafe';
1500
1501fixture `My fixture`
1502 .page `http://devexpress.github.io/testcafe/example/`;
1503
1504test('Filter visible and hidden elements', async t => {
1505 const inputs = Selector('input');
1506 const hiddenInput = inputs.filterHidden();
1507 const visibleInputs = inputs.filterVisible();
1508
1509 await t
1510 .expect(hiddenInput.count).eql(1)
1511 .expect(visibleInputs.count).eql(11);
1512});
1513```
1514
1515#### :gear: Finding Elements by the Exact Matching Text ([#1292](https://github.com/DevExpress/testcafe/issues/1292))
1516
1517The current selector's [withText](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/functional-style-selectors.html#withtext) method looks for elements whose text content *contains* the specified string. With this release, we have added the [withExactText](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/functional-style-selectors.html#withexacttext) method that searches by *strict match*.
1518
1519```js
1520import { Selector } from 'testcafe';
1521
1522fixture `My fixture`
1523 .page `http://devexpress.github.io/testcafe/example/`;
1524
1525test('Search by exact text', async t => {
1526 const labels = Selector('label');
1527 const winLabel = labels.withExactText('Windows');
1528 const reusingLabel = labels.withText('JavaScript');
1529
1530 await t
1531 .expect(winLabel.exists).ok()
1532 .expect(reusingLabel.exists).ok();
1533});
1534```
1535
1536#### :gear: Using Decorators in TypeScript Code ([#2117](https://github.com/DevExpress/testcafe/issues/2117)) by [@pietrovich](https://github.com/pietrovich)
1537
1538TestCafe now allows you to use [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html) when [writing tests in TypeScript](https://devexpress.github.io/testcafe/documentation/test-api/typescript-support.html).
1539
1540Note that decorators are still an experimental feature in TypeScript.
1541
1542### Bug Fixes
1543
1544* TestCafe can scroll a webpage when the `body` has a scroll bar ([#1940](https://github.com/DevExpress/testcafe/issues/1940))
1545* Firefox no longer hangs with a dialog asking to set it as the default browser ([#1926](https://github.com/DevExpress/testcafe/issues/1926))
1546* Legacy APIs no longer freeze because of an unexpected error ([#1790](https://github.com/DevExpress/testcafe/issues/1790))
1547* Clicking an element that was hidden and then recreated on timeout works correctly ([#1994](https://github.com/DevExpress/testcafe/issues/1994))
1548* TestCafe finds browsers in headless mode on macOS when tests are executing concurrently ([#2035](https://github.com/DevExpress/testcafe/issues/2035))
1549* The local storage is restored correctly ([#2015](https://github.com/DevExpress/testcafe/issues/2015)) when roles are switched using the `preserverUrl` flag
1550* TestCafe progress bar is no longer visible on screenshots ([#2076](https://github.com/DevExpress/testcafe/issues/2076))
1551* Window manipulations wait for pages to load ([#2000](https://github.com/DevExpress/testcafe/issues/2000))
1552* All toolbars are hidden when taking screenshots ([#1445](https://github.com/DevExpress/testcafe/issues/1445))
1553* TestCafe works with the latest CucumberJS version ([#2107](https://github.com/DevExpress/testcafe/issues/2107))
1554* Fixed an error connected to file permissions on Ubuntu ([#2144](https://github.com/DevExpress/testcafe/issues/2144))
1555* Browser manipulations can be executed step-by-step ([#2150](https://github.com/DevExpress/testcafe/issues/2150))
1556* Fixed a bug where a page does not load because of an error in `generateCallExpression` ([testcafe-hammerhead/#1389](https://github.com/DevExpress/testcafe-hammerhead/issues/1389))
1557* The overridden Blob constructor does not process data unnecessarily ([testcafe-hammerhead/#1359](https://github.com/DevExpress/testcafe-hammerhead/issues/1359))
1558* The `target` attribute is not set for a button after clicking on it ([testcafe-hammerhead/#1437](https://github.com/DevExpress/testcafe-hammerhead/issues/1437))
1559* The `sandbox`, `target` and `style` attributes are cleaned up ([testcafe-hammerhead/#1448](https://github.com/DevExpress/testcafe-hammerhead/issues/1448))
1560* A `RangeError` with the message `Maximum call stack size exceeded` is no longer raised ([testcafe-hammerhead/#1452](https://github.com/DevExpress/testcafe-hammerhead/issues/1452))
1561* A script error is no longer raised on pages that contain a `beforeunload` handler ([testcafe-hammerhead/#1419](https://github.com/DevExpress/testcafe-hammerhead/issues/1419))
1562* Fixed wrongly overridding an event object ([testcafe-hammerhead/#1445](https://github.com/DevExpress/testcafe-hammerhead/issues/1445))
1563* An illegal invocation error is no longer raised when calling the `FileListWrapper.item` method ([testcafe-hammerhead/#1446](https://github.com/DevExpress/testcafe-hammerhead/issues/1446)) by [@javiercbk](https://github.com/javiercbk)
1564* A script error is no longer raised when `Node.nextSibling` is `null` ([testcafe-hammerhead/#1469](https://github.com/DevExpress/testcafe-hammerhead/issues/1469))
1565* The `isShadowUIElement` check is performed for `Node.nextSibling` when a node is not an element ([testcafe-hammerhead/#1465](https://github.com/DevExpress/testcafe-hammerhead/issues/1465))
1566* The `toString` function is overridden for anchor elements ([testcafe-hammerhead/#1483](https://github.com/DevExpress/testcafe-hammerhead/issues/1483))
1567
1568## v0.18.6 (2017-12-28)
1569
1570### Enhancements
1571
1572#### Chrome DevTools are opened in a separate window during test execution ([#1964](https://github.com/DevExpress/testcafe/issues/1964))
1573
1574### Bug Fixes
1575
1576* In Chrome, disabled showing the 'Save password' prompt after typing text in the `password` input ([#1913](https://github.com/DevExpress/testcafe/issues/1913))
1577* TestCafe correctly scrolls a page to an element when this page has scrollbars ([#1955](https://github.com/DevExpress/testcafe/pull/1955))
1578* Fixed the 'Cannot redefine property %testCafeCore%' script error ([#1996](https://github.com/DevExpress/testcafe/issues/1996))
1579* TestCafe rounds off dimension values when it calculates scrolling ([#2004](https://github.com/DevExpress/testcafe/pull/2004))
1580* In Chrome, the 'Download multiple files' dialog no longer prevents the test execution process ([#2017](https://github.com/DevExpress/testcafe/issues/2017))
1581* TestCafe closes a connection to the specified resource if the destination server hangs ([testcafe-hammerhead/#1384](https://github.com/DevExpress/testcafe-hammerhead/issues/1384))
1582* Proxying the `location's` `href` property works correctly ([testcafe-hammerhead/#1362](https://github.com/DevExpress/testcafe-hammerhead/issues/1362))
1583* The proxy supports `https` requests for node 8.6 and higher ([testcafe-hammerhead/#1401](https://github.com/DevExpress/testcafe-hammerhead/issues/1401))
1584* Added support for pages with the `super` keyword ([testcafe-hammerhead/#1390](https://github.com/DevExpress/testcafe-hammerhead/issues/1390))
1585* The proxy emulates native browser behavior for non-success status codes ([testcafe-hammerhead/#1397](https://github.com/DevExpress/testcafe-hammerhead/issues/1397))
1586* The proxied `ServiceWorker.register` method returns a rejected Promise for unsecure URLs ([testcafe-hammerhead/#1411](https://github.com/DevExpress/testcafe-hammerhead/issues/1411))
1587* Added support for `javascript` protocol expressions applied to the location's properties ([testcafe-hammerhead/#1274](https://github.com/DevExpress/testcafe-hammerhead/issues/1274))
1588
1589## v0.18.5 (2017-11-23): Security Update
1590
1591### Vulnerability Fix ([testcafe-legacy-api/#26](https://github.com/DevExpress/testcafe-legacy-api/issues/26))
1592
1593We have fixed a vulnerability related to the dependency on [uglify-js v1.x](https://github.com/mishoo/UglifyJS). We used it in our [testcafe-legacy-api](https://github.com/DevExpress/testcafe-legacy-api/) module that provides backward compatibility with older APIs from the paid TestCafe version.
1594
1595This vulnerability affected only those who run tests created with the commercial version of TestCafe in the new open-source TestCafe.
1596
1597## v0.18.4 (2017-11-17)
1598
1599### Enhancements
1600
1601#### :gear: WebSockets support ([testcafe-hammerhead/#911](https://github.com/DevExpress/testcafe-hammerhead/issues/911))
1602
1603TestCafe provides full-featured WebSocket support (`wss` and `ws` protocols, request authentication, etc.).
1604
1605### Bug Fixes
1606
1607* You can click on elements under the Status bar and specify the `transition` css property ([#1934](https://github.com/DevExpress/testcafe/issues/1934))
1608* Added support for pages with the `rest` and `default parameter` instructions ([testcafe-hammerhead/#1336](https://github.com/DevExpress/testcafe-hammerhead/issues/1336))
1609* Pages with several `base` tags are supported ([testcafe-hammerhead/#1349](https://github.com/DevExpress/testcafe-hammerhead/issues/1349))
1610* Redirects from cross-domain to same-domain pages are processed ([#1922](https://github.com/DevExpress/testcafe/issues/1922))
1611* Contenteditable custom elements are correctly recognized ([testcafe-hammerhead/#1366](https://github.com/DevExpress/testcafe-hammerhead/issues/1366))
1612* Internal headers for `fetch` requests are set correctly ([testcafe-hammerhead/#1360](https://github.com/DevExpress/testcafe-hammerhead/issues/1360))
1613
1614## v0.18.3 (2017-11-08)
1615
1616### Bug Fixes
1617
1618* Readonly instrumented DOM properties are now set correctly for plain objects ([testcafe-hammerhead/#1351](https://github.com/DevExpress/testcafe-hammerhead/issues/1351)).
1619* The `HTMLElement.style` property is proxied on the client side now ([testcafe-hammerhead/#1348](https://github.com/DevExpress/testcafe-hammerhead/issues/1348)).
1620* The `Refresh` response header is proxied now ([testcafe-hammerhead/#1354](https://github.com/DevExpress/testcafe-hammerhead/issues/1354])).
1621
1622## v0.18.2 (2017-10-26)
1623
1624### Bug Fixes
1625
1626* Screenshots are captured correctly when using High DPI monitor configurations on Windows ([#1896](https://github.com/DevExpress/testcafe/issues/1896))
1627* Fixed the `Cannot read property 'getItem' of null` error which is raised when a console message was printed in an iframe before it is completely loaded ([#1875](https://github.com/DevExpress/testcafe/issues/1875))
1628* Fixed the `Content iframe did not load` error which is raised if an iframe reloaded during the `switchToIframe` command execution ([#1842](https://github.com/DevExpress/testcafe/issues/1842))
1629* Selector options are passed to all derivative selectors ([#1907](https://github.com/DevExpress/testcafe/issues/1907))
1630* Fixed a memory leak in IE related to live node collection proxying ([testcafe-hammerhead/#1262](https://github.com/DevExpress/testcafe-hammerhead/issues/1262))
1631* `DocumentFragment` nodes are correctly processed ([testcafe-hammerhead/#1334](https://github.com/DevExpress/testcafe-hammerhead/issues/1334))
1632
1633## v0.18.1 (2017-10-17): a recovery release following v0.18.0
1634
1635### --reporter flag name fixed ([#1881](https://github.com/DevExpress/testcafe/issues/1881))
1636
1637In v0.18.0, we changed the [--reporter](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-r-nameoutput---reporter-nameoutput) CLI flag to `--reporters`. In this release, we rolled back to the previous flag name.
1638
1639### Compatibility with RequireJS restored ([#1874](https://github.com/DevExpress/testcafe/issues/1874))
1640
1641Changes in v0.18.0 made TestCafe incompatible with [RequireJS](http://requirejs.org). It is fixed in this recovery release.
1642
1643We apologize for any inconvenience.
1644
1645## v0.18.0 (2017-10-10)
1646
1647### Enhancements
1648
1649#### :gear: Testing in headless Firefox
1650
1651We have added support for [headless](https://developer.mozilla.org/en-US/Firefox/Headless_mode) testing in Firefox (version 56+) and Chrome.
1652
1653```sh
1654testcafe firefox:headless tests/sample-fixture.js
1655```
1656
1657```js
1658runner
1659 .src('tests/sample-fixture.js')
1660 .browsers('firefox:headless')
1661 .run()
1662 .then(failedCount => {
1663 // ...
1664 });
1665```
1666
1667#### :gear: Outputting test results to multiple channels ([#1412](https://github.com/DevExpress/testcafe/issues/1412))
1668
1669You can now print a report in the console and saved it to a `.json` file by specifying multiple reporters when running tests.
1670
1671```sh
1672testcafe all tests/sample-fixture.js -r spec,json:report.json
1673```
1674
1675```js
1676const stream = fs.createWriteStream('report.json');
1677
1678runner
1679 .src('tests/sample-fixture.js')
1680 .browsers('chrome')
1681 .reporter('spec')
1682 .reporter('json', stream)
1683 .run()
1684 .then(failedCount => {
1685 stream.end();
1686 });
1687```
1688
1689#### :gear: Entering the debug mode when a test fails ([#1608](https://github.com/DevExpress/testcafe/issues/1608))
1690
1691TestCafe can now automatically switch to the debug mode when a test fails. Test execution is paused so that you can explore the tested page to determine the failure's cause.
1692
1693To enable this behavior, use the `--debug-on-fail` flag in the command line or the `debugOnFail` option in the API.
1694
1695```sh
1696testcafe chrome tests/fixture.js --debug-on-fail
1697```
1698
1699```js
1700runner.run({ debugOnFail: true });
1701```
1702
1703#### :gear: Interacting with the tested page in debug mode ([#1848](https://github.com/DevExpress/testcafe/issues/1848))
1704
1705When debugging your tests, you can now interact with the tested page. Click the **Unlock page** button in the page footer to enable interaction.
1706
1707![Unlock page button](docs/articles/images/unlock-page-button.png)
1708
1709Click **Resume** to continue running the test or click **Next Step** to skip to the next step.
1710
1711#### :gear: Chrome and Firefox are opened with clean profiles by default ([#1623](https://github.com/DevExpress/testcafe/issues/1623))
1712
1713TestCafe now opens Chrome and Firefox with empty profiles to eliminate profile settings' and extensions' influence on tests.
1714
1715However, you can **return to the previous behavior** using the `:userProfile` browser option.
1716
1717```sh
1718testcafe firefox:userProfile tests/test.js
1719```
1720
1721```js
1722runner
1723 .src('tests/fixture1.js')
1724 .browsers('firefox:userProfile')
1725 .run();
1726```
1727
1728#### :gear: Customizable timeout to wait for the `window.load` event ([#1645](https://github.com/DevExpress/testcafe/issues/1645))
1729
1730Previously, TestCafe started a test when the `DOMContentLoaded` event was raised. However, there are many pages that execute initialization code on the `window.load` event (which is raised after `DOMContentLoaded` because it waits for all stylesheets, images and subframes to load). In this case, you need to wait for the `window.load` event to fire before running tests.
1731
1732With this release, TestCafe waits `3` seconds for the `window.load` event.
1733We have also added a `pageLoadTimeout` setting that allows you to customize this interval.
1734You can set it to `0` to skip waiting for `window.load`.
1735
1736The following examples show how to use the `pageLoadTimeout` setting from the command line and API:
1737
1738```sh
1739testcafe chrome test.js --page-load-timeout 0
1740```
1741
1742```js
1743runner.run({
1744 pageLoadTimeout: 0
1745});
1746```
1747
1748You can also use the `setPageLoadTimeout` method in the test API to set the timeout for an individual test.
1749
1750```js
1751fixture `Page load timeout`
1752 .page `http://devexpress.github.io/testcafe/example/`;
1753
1754test(`Page load timeout`, async t => {
1755 await t
1756 .setPageLoadTimeout(0)
1757 .navigateTo('http://devexpress.github.io/testcafe/');
1758});
1759```
1760
1761#### :gear: Access messages output by the tested app to the browser console ([#1738](https://github.com/DevExpress/testcafe/issues/1738))
1762
1763You can now obtain messages that the tested app outputs to the browser console. This is useful if your application or the framework it uses posts errors, warnings or other informative messages to the console.
1764
1765Use the `t.getBrowserConsoleMessages` method that returns the following object:
1766
1767```js
1768{
1769 error: ["Cannot access the 'db' database. Wrong credentials.", '...'], // error messages
1770 warn: ['The setTimeout property is deprecated', '...'], // warning messages
1771 log: ['[09:12:08] Logged in', '[09:25:43] Changes saved', '...'], // log messages
1772 info: ['The application was updated since your last visit.', '...'] // info messages
1773}
1774```
1775
1776Note that this method returns only messages posted via the `console.error`, `console.warn`, `console.log` and `console.info` methods. Messages the browser outputs (like when an unhandled exception occurs on the page) are not returned.
1777
1778For instance, you can use React's typechecking feature, [PropTypes](https://reactjs.org/docs/typechecking-with-proptypes.html), to check that you assigned valid values to the component's props. If a `PropTypes` rule is violated, React posts an error to the JavaScript console.
1779
1780The following example shows how to check the React prop types for errors using the `t.getBrowserConsoleMessages` method:
1781
1782```js
1783// check-prop-types.js
1784import { t } from 'testcafe';
1785
1786export default async function () {
1787 const { error } = await t.getBrowserConsoleMessages();
1788
1789 await t.expect(error[0]).notOk();
1790}
1791
1792// test.js
1793import { Selector } from 'testcafe';
1794import checkPropTypes from './check-prop-types';
1795
1796fixture `react example`
1797 .page `http://localhost:8080/` // https://github.com/mzabriskie/react-example
1798 .afterEach(() => checkPropTypes());
1799
1800test('test', async t => {
1801 await t
1802 .typeText(Selector('.form-control'), 'devexpress')
1803 .click(Selector('button').withText('Go'))
1804 .click(Selector('h4').withText('Organizations'));
1805});
1806```
1807
1808#### :gear: Defining drag end point on the destination element ([#982](https://github.com/DevExpress/testcafe/issues/982))
1809
1810The `t.dragToElement` action can now drop a dragged element at any point inside the destination element.
1811You can specify the target point using the `destinationOffsetX` and `destinationOffsetY` options.
1812
1813```js
1814import { Selector } from 'testcafe';
1815
1816const fileIcon = Selector('.file-icon');
1817const directoryPane = Selector('.directory');
1818
1819fixture `My Fixture`
1820 .page `https://example.com/`;
1821
1822test('My Test', async t => {
1823 await t
1824 .dragToElement(fileIcon, directoryPane, {
1825 offsetX: 10,
1826 offsetY: 10,
1827 destinationOffsetX: 100,
1828 destinationOffsetY: 50,
1829 modifiers: {
1830 shift: true
1831 }
1832 });
1833});
1834```
1835
1836#### :gear: TestCafe exits gracefully when the process is interrupted ([#1378](https://github.com/DevExpress/testcafe/issues/1378))
1837
1838Previously, TestCafe left browsers open when you exited the process by pressing `Ctrl+C` in the terminal.
1839Now TestCafe exits gracefully closing all browsers opened for testing.
1840
1841### Bug Fixes
1842
1843* Tests no longer hang in Nightmare ([#1493](https://github.com/DevExpress/testcafe/issues/1493))
1844* The `focus` event is raised when clicking links with `tabIndex="0"` ([#1803](https://github.com/DevExpress/testcafe/issues/1803))
1845* Headless Chrome processes no longer hang after test runs ([#1826](https://github.com/DevExpress/testcafe/issues/1826))
1846* `setFilesToUpload` no longer throws a `RangeError` on websites that use Angular ([#1731](https://github.com/DevExpress/testcafe/issues/1731))
1847* Fixed a bug where an `iframe` got a wrong origin ([#1753](https://github.com/DevExpress/testcafe/issues/1753))
1848* `document.open` does not throw an error if `document.defaultView` is `null` ([testcafe-hammerhead/#1272](https://github.com/DevExpress/testcafe-hammerhead/issues/1272))
1849* No error is thrown when the handler passed to `addEventListener` is `undefined` ([testcafe-hammerhead/#1251](https://github.com/DevExpress/testcafe-hammerhead/issues/1251))
1850* An error is no longer raised if the processed element is not extendible ([testcafe-hammerhead/#1300](https://github.com/DevExpress/testcafe-hammerhead/issues/1300))
1851* Fixed a bug where an `onclick` handler did not work after click on a `Submit` button ([testcafe-hammerhead/#1291](https://github.com/DevExpress/testcafe-hammerhead/issues/1291))
1852* Images with `style = background-image: url("img.png");` are loaded correctly ([testcafe-hammerhead/#1212](https://github.com/DevExpress/testcafe-hammerhead/issues/1212))
1853* Documents can contain two `ShadowUI` roots ([testcafe-hammerhead/#1246](https://github.com/DevExpress/testcafe-hammerhead/issues/1246))
1854* HTML in an overridden `document.write` function is processed correctly ([testcafe-hammerhead/#1311](https://github.com/DevExpress/testcafe-hammerhead/issues/1311))
1855* Elements processing works for a `documentFragment` as it is added to the DOM ([testcafe-hammerhead/#1334](https://github.com/DevExpress/testcafe-hammerhead/issues/1334))
1856
1857## v0.17.2 (2017-9-6)
1858
1859### Bug Fixes
1860
1861* Taking a screenshot on teamcity agent works correctly ([#1625](https://github.com/DevExpress/testcafe/issues/1625))
1862* It is possible to run tests on remote devices from a docker container ([#1728](https://github.com/DevExpress/testcafe/issues/1728))
1863* TestCafe compiles TypeScript tests correctly if Mocha or Jest typedefs are included in the project ([#1537](https://github.com/DevExpress/testcafe/issues/1537))
1864* Running on remote devices works correctly on MacOS ([#1732](https://github.com/DevExpress/testcafe/issues/1732))
1865* A target directory is checked before creating a screenshot ([#1551](https://github.com/DevExpress/testcafe/issues/1551))
1866* TypeScript definitions allow you to send any objects as `dependencies` for `ClientFunctions` ([#1713](https://github.com/DevExpress/testcafe/issues/1713))
1867* The second `MutationObserver` callback argument is not missed ([testcafe-hammerhead/#1268](https://github.com/DevExpress/testcafe-hammerhead/issues/1268))
1868* Link's `href` property with an unsupported protocol is set correctly ([testcafe-hammerhead/#1276](https://github.com/DevExpress/testcafe-hammerhead/issues/1276))
1869* The `document.documentURI` property is processed correctly in IE ([testcafe-hammerhead/#1270](https://github.com/DevExpress/testcafe-hammerhead/issues/1270))
1870* `JSON.stringify` and `Object.keys` functions work properly for a `MessageEvent` instance ([testcafe-hammerhead/#1277](https://github.com/DevExpress/testcafe-hammerhead/issues/1277))
1871
1872## v0.17.1 (2017-8-17)
1873
1874### Bug Fixes
1875
1876* The `hover` action no longer fails for elements that hide on mouseover ([#1679](https://github.com/DevExpress/testcafe/issues/1679))
1877* SelectText and SelectTextAreaContent TypeScript definitions match the documentation ([#1697](https://github.com/DevExpress/testcafe/issues/1697))
1878* TestCafe finds browsers installed for the current user on Windows ([#1688](https://github.com/DevExpress/testcafe/issues/1688))
1879* TestCafe can resize MS Edge 15 window ([#1517](https://github.com/DevExpress/testcafe/issues/1517))
1880* Google Chrome Canary has a dedicated `chrome-canary` alias ([#1711](https://github.com/DevExpress/testcafe/issues/1711))
1881* Test no longer hangs when `takeScreenshot` is called in headless Chrome Canary on Windows ([#1685](https://github.com/DevExpress/testcafe/issues/1685))
1882* Tests fail if the `uncaughtRejection` exception is raised ([#1473](https://github.com/DevExpress/testcafe/issues/1473))
1883* TypeScript tests run on macOS with no errors ([#1696](https://github.com/DevExpress/testcafe/issues/1696))
1884* The test duration is reported accurately ([#1674](https://github.com/DevExpress/testcafe/issues/1674))
1885* XHR requests with an overridden `setRequestHeader` function returned by the `XhrSandbox.openNativeXhr` method are now handled properly ([testcafe-hammerhead/#1252](https://github.com/DevExpress/testcafe-hammerhead/issues/1252))
1886* HTML in an overridden `document.write` function is now processed correctly ([testcafe-hammerhead/#1218](https://github.com/DevExpress/testcafe-hammerhead/issues/1218))
1887* `Object.assign` is overridden ([testcafe-hammerhead/#1208](https://github.com/DevExpress/testcafe-hammerhead/issues/1208))
1888* Scripts with `async` functions are processed correctly ([testcafe-hammerhead/#1260](https://github.com/DevExpress/testcafe-hammerhead/issues/1260))
1889
1890## v0.17.0 (2017-8-2)
1891
1892### Enhancements
1893
1894#### :gear: Testing Electron applications ([testcafe-browser-provider-electron](https://github.com/DevExpress/testcafe-browser-provider-electron))
1895
1896We have created a browser provider that allows you to test Electron applications with TestCafe.
1897
1898To do this, install the browser provider plugin from npm:
1899
1900```sh
1901npm install testcafe-browser-provider-electron
1902```
1903
1904Create a `.testcafe-electron-rc` file that contains the Electron plugin's configurations.
1905The only required setting here is `mainWindowUrl`. It is a URL (or path) to the main window page that relates to the application's directory.
1906
1907```json
1908{
1909 "mainWindowUrl": "./index.html"
1910}
1911```
1912
1913Place this file in the application root directory.
1914
1915Next, install the Electron module.
1916
1917```sh
1918npm install electron@latest
1919```
1920
1921You can now run tests. Specify the `electron` browser name and the application path
1922when the test launches.
1923
1924```sh
1925testcafe "electron:/home/user/electron-app" "path/to/test/file.js"
1926```
1927
1928```js
1929testCafe
1930 .createRunner()
1931 .src('path/to/test/file.js')
1932 .browsers('electron:/home/user/electron-app')
1933 .run();
1934```
1935
1936Nota that you can also test the Electron app's executable files. See the plugin [readme](https://github.com/DevExpress/testcafe-browser-provider-electron) to learn more about the Electron browser provider.
1937
1938#### :gear: Concurrent test execution ([#1165](https://github.com/DevExpress/testcafe/issues/1165))
1939
1940We have added concurrent test launch. This makes a test batch complete faster.
1941
1942TestCafe launches one instance of each specified browser by default. Tests are run one by one in each of them.
1943
1944Enable *concurrency* and TestCafe launches multiple instances of each browser. It distributes the test batch among them. The tests are run in parallel.
1945
1946To enable concurrency, add `-c`in the command line or use the `runner.concurrency()` API method.
1947Specify the number of instances for each browser.
1948
1949```js
1950testcafe -c 3 chrome tests/test.js
1951```
1952
1953```js
1954var testRunPromise = runner
1955 .src('tests/test.js')
1956 .browsers('chrome')
1957 .concurrency(3)
1958 .run();
1959```
1960
1961See [Concurrent Test Execution](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/concurrent-test-execution.html) for more details.
1962
1963#### :gear: Further improvements in automatic waiting mechanism ([#1521](https://github.com/DevExpress/testcafe/issues/1521))
1964
1965We have enhanced the waiting mechanism behavior in certain scenarios which required `wait` actions.
1966
1967#### :gear: User roles preserve the local storage ([#1454](https://github.com/DevExpress/testcafe/issues/1454))
1968
1969TestCafe now saves the local storage state when switching between roles. You get the same local storage content you left when you switch back.
1970
1971This is useful for testing websites that perform authentication via local storage instead of cookies.
1972
1973### Bug Fixes
1974
1975* Selector's `withAttribute` method supports searching by strict match ([#1548](https://github.com/DevExpress/testcafe/issues/1548]))
1976* Description for the `path` parameter of the `t.takeScreenshot` action has been corrected ([#1515](https://github.com/DevExpress/testcafe/issues/1515))
1977* Local storage is now cleaned appropriately after the test run.([#1546](https://github.com/DevExpress/testcafe/issues/1546))
1978* TestCafe now checks element visibility with a timeout when the target element's `style.top` is negative ([#1185](https://github.com/DevExpress/testcafe/issues/1185))
1979* Fetching an absolute CORS URL now works correctly. ([#1629](https://github.com/DevExpress/testcafe/issues/1629))
1980* Add partial support for proxying live node collections (the `GetElementsByTagName` method) ([#1442](https://github.com/DevExpress/testcafe/issues/1442))
1981* TypeScript performance has been enhanced. ([#1591](https://github.com/DevExpress/testcafe/issues/1591))
1982* The right port is now applied to a cross-domain iframe location after redirect. ([testcafe-hammerhead/#1191](https://github.com/DevExpress/testcafe-hammerhead/issues/1191))
1983* All internal properties are marked as non-enumerable. ([testcafe-hammerhead/#1182](https://github.com/DevExpress/testcafe-hammerhead/issues/1182))
1984* Support proxying pages with defined referrer policy. ([testcafe-hammerhead/#1195](https://github.com/DevExpress/testcafe-hammerhead/issues/1195))
1985* WebWorker content is now correctly proxied in FireFox 54. ([testcafe-hammerhead/#1216](https://github.com/DevExpress/testcafe-hammerhead/issues/1216))
1986* Code instrumentation for the `document.activeElement` property works properly if it is `null`. ([testcafe-hammerhead/#1226](https://github.com/DevExpress/testcafe-hammerhead/issues/1226))
1987* `length`, `item` and `namedItem` are no longer own properties of `LiveNodeListWrapper`. ([testcafe-hammerhead/#1222](https://github.com/DevExpress/testcafe-hammerhead/issues/1222))
1988* The `scope` option in the `serviceWorker.register` function is processed correctly. ([testcafe-hammerhead/#1233](https://github.com/DevExpress/testcafe-hammerhead/issues/1233))
1989* Promises from a fetch request are now processed correctly. ([testcafe-hammerhead/#1234](https://github.com/DevExpress/testcafe-hammerhead/issues/1234))
1990* Fix transpiling for the `for..of` loop to support browsers without `window.Iterator`. ([testcafe-hammerhead/#1231](https://github.com/DevExpress/testcafe-hammerhead/issues/1231))
1991
1992## v0.16.2 (2017-6-27)
1993
1994### Bug Fixes
1995
1996* Typing text now raises the `onChange` event in latest React versions. ([#1558](https://github.com/DevExpress/testcafe/issues/1558))
1997* Screenshots can now be taken when TestCafe runs from the Docker image. ([#1540](https://github.com/DevExpress/testcafe/issues/1540))
1998* The native `value` property setters of `HTMLInputElement` and `HTMLTextAreaElement` prototypes are now saved. ([testcafe-hammerhead/#1185](https://github.com/DevExpress/testcafe-hammerhead/issues/1185))
1999* The `name` and `namedItem` methods of an `HTMLCollection` are now marked as non-enumerable. ([testcafe-hammerhead/#1172](https://github.com/DevExpress/testcafe-hammerhead/issues/1172))
2000* Code instrumentation of the `length` property runs faster. ([testcafe-hammerhead/#979](https://github.com/DevExpress/testcafe-hammerhead/issues/979))
2001
2002## v0.16.1 (2017-6-21)
2003
2004### Bug Fixes
2005
2006* A typo in RoleOptions typedefs was fixed ([#1541](https://github.com/DevExpress/testcafe/issues/1541))
2007* TestCafe no longer crashes on node 4 with an unmet dependency ([#1547](https://github.com/DevExpress/testcafe/issues/1547))
2008* Markup imported via `meta[rel="import"]` is now processed. ([testcafe-hammerhead/#1161](https://github.com/DevExpress/testcafe-hammerhead/issues/1161))
2009* The correct context is passed to `MutationObserver`. ([testcafe-hammerhead/#1178](https://github.com/DevExpress/testcafe-hammerhead/issues/1178))
2010* The `innerHtml` property is no longer processed for elements that don't have this property. ([testcafe-hammerhead/#1164](https://github.com/DevExpress/testcafe-hammerhead/issues/1164))
2011
2012## v0.16.0 (2017-6-13)
2013
2014TypeScript support, seamless testing in headless Chrome and device emulator, and numerous bug fixes.
2015
2016### Enhancements
2017
2018#### :gear: TypeScript support ([#408](https://github.com/DevExpress/testcafe/issues/408))
2019
2020In this release, we have added the capability to write tests in [TypeScript](https://www.typescriptlang.org/). 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.
2021
2022TestCafe bundles TypeScript declaration file with the npm package, so you have no need to install any additional packages.
2023
2024Just create a `.ts` file with the
2025
2026<!-- Use `js` instead of `ts` for this code block for proper code highlighting -->
2027
2028```js
2029import { Selector } from 'testcafe';
2030```
2031
2032and write your test.
2033
2034For details, see [TypeScript Support](https://devexpress.github.io/testcafe/documentation/test-api/typescript-support.html)
2035
2036#### :gear: Support running in Chrome in headless mode and in device emulator ([#1417](https://github.com/DevExpress/testcafe/issues/1417))
2037
2038Now TestCafe allows you to run your tests in Google Chrome in headless and device emulation modes.
2039
2040[Headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome) allows you to run tests in Chrome without any visible UI shell. To run tests in headless mode, use the `:headless` postfix:
2041
2042```sh
2043testcafe "chrome:headless" tests/sample-fixture.js
2044```
2045
2046Device emulation mode allows you to check how your tests works on mobile devices via Chrome's built-in [device emulator](https://developers.google.com/web/tools/chrome-devtools/device-mode/). To run tests in device emulation mode, specify `emulation:` and [device parameters](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browser-support.html#available-chrome-options):
2047
2048```sh
2049testcafe "chrome:emulation:device=iphone 6" tests/sample-fixture.js
2050```
2051
2052For details, see [Using Chrome-specific Features](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browser-support.html#using-chrome-specific-features).
2053
2054#### :gear: Support HTML5 Drag and Drop ([#897](https://github.com/DevExpress/testcafe/issues/897))
2055
2056Starting with this release, TestCafe supports HTML5 drag and drop, so you can test elements with the `draggable` [attribute](http://w3c.github.io/html/editing.html#the-draggable-attribute).
2057
2058#### :gear: Fixed URL for opening remote browsers ([#1476](https://github.com/DevExpress/testcafe/issues/1476))
2059
2060We have simplified the format of links that TestCafe generates when you [run tests on remote browsers](https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browser-support.html#browsers-on-remote-devices).
2061
2062Now, 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.
2063
2064### Bug Fixes
2065
2066* No TestCafe UI on screenshots created during testing ([#1357](https://github.com/DevExpress/testcafe/issues/1357))
2067* `mouseenter` and `mouseleave` events are not triggered during cursor moving ([#1426](https://github.com/DevExpress/testcafe/issues/1426))
2068* The runner's speed option affects the speed of `doubleClick` action ([#1486](https://github.com/DevExpress/testcafe/issues/1486))
2069* Press action shortcuts work wrong if input's value ends with '.' or starts with '-.' ([#1499](https://github.com/DevExpress/testcafe/issues/1499))
2070* A test report has too small line length on Travis ([#1469](https://github.com/DevExpress/testcafe/issues/1469))
2071* Service messages with cookies do not have enough time to come to server before a new page is loaded ([testcafe-hammerhead/#1086](https://github.com/DevExpress/testcafe-hammerhead/issues/1086))
2072* The `window.history.replaceState` function is overridden incorrectly ([testcafe-hammerhead/#1146](https://github.com/DevExpress/testcafe-hammerhead/issues/1146))
2073* Hammerhead crashes if a script file contains a sourcemap comment ([testcafe-hammerhead/#1052](https://github.com/DevExpress/testcafe-hammerhead/issues/1052))
2074* The proxy should override the `DOMParser.parseFromString` method ([testcafe-hammerhead/#1133](https://github.com/DevExpress/testcafe-hammerhead/issues/1133))
2075* The `fetch` method should emulate the native behaviour on merging headers ([testcafe-hammerhead/#1116](https://github.com/DevExpress/testcafe-hammerhead/issues/1116))
2076* The `EventSource` requests are broken when used via proxy ([testcafe-hammerhead/#1106](https://github.com/DevExpress/testcafe-hammerhead/issues/1106))
2077* The code processing may cause syntax errors in some cases because of wrong `location` property wrapping ([testcafe-hammerhead/#1101](https://github.com/DevExpress/testcafe-hammerhead/issues/1101))
2078* When calling the `fetch` function without parameters, we should return its native result instead of `window.Promise.reject` ([testcafe-hammerhead/#1099](https://github.com/DevExpress/testcafe-hammerhead/issues/1099))
2079* The `querySelector` function is overridden incorrectly ([testcafe-hammerhead/#1131](https://github.com/DevExpress/testcafe-hammerhead/issues/1131))
2080
2081## v0.15.0 (2017-4-26)
2082
2083Plugins for React and Vue.js, TestCafe Docker image, support for Internet access proxies and lots of bug fixes.
2084
2085### Breaking Changes
2086
2087#### New calls to selector's withText method no longer override previous calls
2088
2089We have changed the way the [withText](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#withtext)
2090method behaves when it is called in a chain.
2091
2092```js
2093const el = Selector('div').withText('This is').withText('my element');
2094```
2095
2096In previous versions, this selector searched for a `div` with text `my element` because the second call to `withText` overrode the first one.
2097
2098Now this code returns an element whose text contains both `This is` and `my element` as the second call compounds with the first one.
2099
2100### Enhancements
2101
2102#### :gear: Plugin for testing React apps
2103
2104In this release cycle, we have created a plugin for testing React applications.
2105This plugin allows you to select React components by their names.
2106
2107```js
2108import ReactSelector from 'testcafe-react-selector';
2109
2110const TodoList = ReactSelector('TodoApp TodoList');
2111const itemsCountStatus = ReactSelector('TodoApp div');
2112const itemsCount = ReactSelector('TodoApp div span');
2113```
2114
2115And it enables you to get React component's `state` and `props`.
2116
2117```js
2118import ReactSelector from 'testcafe-react-selector';
2119
2120fixture `TODO list test`
2121 .page('http://localhost:1337');
2122
2123test('Check list item', async t => {
2124 const el = ReactSelector('TodoList');
2125
2126 await t.expect(el.getReact().props.priority).eql('High');
2127 await t.expect(el.getReact().state.isActive).eql(false);
2128});
2129```
2130
2131To learn more, see the [testcafe-react-selectors](https://github.com/DevExpress/testcafe-react-selectors/) repository.
2132
2133#### :gear: Plugin for testing Vue.js apps
2134
2135In addition to the React plugin, we have released a plugin that facilitates testing Vue.js applications.
2136
2137In the same manner, it allows you to select Vue.js components with `VueSelector` selectors.
2138
2139```js
2140import VueSelector from 'testcafe-vue-selectors';
2141
2142const rootVue = VueSelector();
2143const todoInput = VueSelector('todo-input');
2144const todoItem = VueSelector('todo-list todo-item');
2145```
2146
2147These selectors allow you to get Vue component's `props`, `state` and `computed` properties.
2148
2149```js
2150import VueSelector from 'testcafe-vue-selector';
2151
2152fixture `TODO list test`
2153 .page('http://localhost:1337');
2154
2155test('Check list item', async t => {
2156 const todoItem = VueSelector('todo-item');
2157
2158 await t
2159 .expect(todoItem.getVue().props.priority).eql('High')
2160 .expect(todoItem.getVue().state.isActive).eql(false)
2161 .expect(todoItem.getVue().computed.text).eql('Item 1');
2162});
2163```
2164
2165To learn more, see the [testcafe-vue-selectors](https://github.com/DevExpress/testcafe-vue-selectors) repository.
2166
2167#### :gear: TestCafe Docker image ([#1141](https://github.com/DevExpress/testcafe/issues/1141))
2168
2169We have created a Docker image with TestCafe, Chromium and Firefox preinstalled.
2170
2171You no longer need to manually install browsers or the testing framework on your server.
2172Pull the Docker image from the repository and run TestCafe immediately.
2173
2174```sh
2175docker pull testcafe/testcafe
2176docker run -v //user/tests:/tests -it testcafe/testcafe firefox tests/**/*.js
2177```
2178
2179To learn more, see [Using TestCafe Docker Image](https://devexpress.github.io/testcafe/documentation/using-testcafe/installing-testcafe.html#using-testcafe-docker-image)
2180
2181#### :gear: Support for Internet access proxies ([#1206](https://github.com/DevExpress/testcafe/issues/1206))
2182
2183If your local network uses a proxy server to access the Internet, TestCafe can use it reach the external webpages.
2184
2185To specify the proxy server, use a command line option
2186
2187```sh
2188testcafe chrome my-tests/**/*.js --proxy 172.0.10.10:8080
2189```
2190
2191or a method in the API.
2192
2193```js
2194runner.useProxy('username:password@proxy.mycorp.com');
2195```
2196
2197Note that you can pass the credentials with the proxy server host.
2198
2199#### :gear: Debugging mode option ([#1347](https://github.com/DevExpress/testcafe/issues/1347))
2200
2201As an alternative to calling the [t.debug](https://devexpress.github.io/testcafe/documentation/test-api/debugging.html#client-side-debugging) method
2202in test code, you can now specify the `--debug-mode` command line option to pause the test before the first action or assertion.
2203When the test is paused, you can debug in the browser developer tools as well as continue test execution step by step.
2204
2205```sh
2206testcafe chrome my-tests/**/*.js --debug-mode
2207```
2208
2209If you use TestCafe API, provide the `debugMode` option to the `runner.run` method.
2210
2211```js
2212runner.run({ debugMode: true });
2213```
2214
2215#### :gear: Filtering selector's matched set by attribute ([#1346](https://github.com/DevExpress/testcafe/issues/1346))
2216
2217You can now use the `withAttribute` method to select elements that have a particular attribute set to a specific value.
2218You can omit the attribute value to select elements that simply have the specified attribute.
2219
2220```js
2221const el = Selector('div').withAttribute('attributeName', 'value').nth(2);
2222```
2223
2224#### :gear: hasAttribute method added to DOM node state ([#1045](https://github.com/DevExpress/testcafe/issues/1045))
2225
2226For you convenience, the DOM node state object now provides the `hasAttribute` method that allows you to determine if an element has a particular attribute.
2227
2228```js
2229const el = Selector('div.button');
2230
2231t.expect(el.hasAttribute('disabled')).ok();
2232```
2233
2234#### :gear: Redirection when switching between roles ([#1339](https://github.com/DevExpress/testcafe/issues/1339))
2235
2236[User roles](https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html) now provide a `preserveUrl` option
2237that allows you to save the webpage URL to which the browser was redirected after logging in. If you enable this option when creating a role,
2238the browser will be redirected to the saved URL every time you switch to this role.
2239
2240```js
2241const regularUser = Role(url, async t => {
2242 /* authentication code */
2243}, { preserveUrl: true })
2244```
2245
2246### Bug Fixes
2247
2248* Fixed a bug where incorrect call site and callstack were generated for an assertion that failed in a class method ([#1267](https://github.com/DevExpress/testcafe/issues/1267))
2249* Incorrect validation result no longer appears when a test controller is used inside an async function ([#1285](https://github.com/DevExpress/testcafe/issues/1285))
2250* Click on the status panel no longer affects the page state ([#1389](https://github.com/DevExpress/testcafe/issues/1389))
2251* The `input` event is now raised with a correct selection value when input value was changed ([#1388](https://github.com/DevExpress/testcafe/issues/1388))
2252* Inline source maps are now placed in transpiled files so that breakpoints work correctly ([#1375](https://github.com/DevExpress/testcafe/issues/1375))
2253* `value` and `selectedIndex` in the `input` event handler for the dropdown element are now valid ([#1366](https://github.com/DevExpress/testcafe/issues/1366))
2254* A `presskey('enter')` call now raises the `click` event on a button element ([#1424](https://github.com/DevExpress/testcafe/issues/1424))
2255* The cursor position in Monaco editor is now set correctly on the click action ([#1385](https://github.com/DevExpress/testcafe/issues/1385))
2256* `hasScroll` now works correctly if the `body` has absolute positioning ([#1353](https://github.com/DevExpress/testcafe/issues/1353))
2257* Text can now be typed into HTML5 input elements ([#1327](https://github.com/DevExpress/testcafe/issues/1327))
2258* `focusin` and `focusout` events are now raised when the browser window is in the background ([testcafe-hammerhead/#1044](https://github.com/DevExpress/testcafe-hammerhead/issues/1044))
2259* `caretPositionFromPoint` and `caretRangeFromPoint` now ignore TestCafe UI elements on the page ([testcafe-hammerhead/#1084](https://github.com/DevExpress/testcafe-hammerhead/issues/1084))
2260* Images created with the `Image` constructor are now loaded through the proxy ([testcafe-hammerhead/#1087](https://github.com/DevExpress/testcafe-hammerhead/issues/1087))
2261* The `innerText` return value is now clear of script and style code ([testcafe-hammerhead/#1079](https://github.com/DevExpress/testcafe-hammerhead/issues/1079))
2262* Non-string values for element's text properties are now converted to `String` ([testcafe-hammerhead/#1091](https://github.com/DevExpress/testcafe-hammerhead/issues/1091))
2263* SVG elements are now processed correctly in IE ([testcafe-hammerhead/#1083](https://github.com/DevExpress/testcafe-hammerhead/issues/1083))
2264
2265## v0.14.0 (2017-3-28)
2266
2267Authentication via user roles, client-side debugging and numerous bug fixes.
2268
2269### Enhancements
2270
2271#### :gear: Authentication via user roles ([#243](https://github.com/DevExpress/testcafe/issues/243))
2272
2273Many test scenarios involve the activity of more than one user. TestCafe addresses these scenarios by providing a convenient way
2274to isolate authentication test actions and apply them easily whenever you need to switch the user account.
2275
2276A piece of logic that logs in a particular user is called a *role*. It is a good practice to create a role for each user account participating in your test.
2277
2278Create roles via the `Role` constructor. You can keep them in a separate helper file.
2279
2280*helper.js*
2281
2282```js
2283import { Role } from 'testcafe';
2284
2285export var regularAccUser = Role('http://example.com/login', async t => {
2286 await t
2287 .typeText('#login', 'TestUser')
2288 .typeText('#password', 'testpass')
2289 .click('#sign-in');
2290});
2291
2292export var facebookAccUser = Role('http://example.com/login', async t => {
2293 await t
2294 .click('#sign-in-with-facebook')
2295 .typeText('#email', 'testuser@mycompany.com')
2296 .typeText('#pass', 'testpass')
2297 .click('#submit');
2298});
2299
2300export var admin = Role('http://example.com/login', async t => {
2301 await t
2302 .typeText('#login', 'Admin')
2303 .typeText('#password', 'adminpass')
2304 .click('#sign-in');
2305});
2306```
2307
2308In test code, use the `t.useRole` method to switch between roles.
2309
2310*test.js*
2311
2312```js
2313import { regularAccUser, admin } from './helper';
2314import { Selector } from 'testcafe';
2315
2316const entry = Selector('#entry');
2317const removeButton = Selector('#remove-entry');
2318
2319fixture `My Fixture`
2320 .page `http://example.com`;
2321
2322test('test that involves two users', async t => {
2323 await t
2324 .useRole(regularAccUser)
2325 .expect(entry.exists).ok()
2326 .expect(removeButton.visible).notOk()
2327 .useRole(admin)
2328 .expect(removeButton.visible).ok()
2329 .click(removeButton)
2330 .expect(entry.exists).notOk()
2331});
2332```
2333
2334To learn more, see [User Roles](https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html).
2335
2336#### :gear: BrowserStack support
2337
2338We have released the [BrowserStack](https://www.browserstack.com/) browser provider [plugin](https://github.com/DevExpress/testcafe-browser-provider-browserstack).
2339
2340Install this plugin from `npm`.
2341
2342```sh
2343npm install testcafe-browser-provider-browserstack
2344```
2345
2346And save the BrowserStack username and access key to environment variables `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY`.
2347
2348Now you can run tests on any virtual machine available on BrowserStack.
2349
2350```sh
2351testcafe "browserstack:Chrome@53.0:Windows 10" "path/to/test/file.js"
2352```
2353
2354#### :gear: Client-side debugging ([#918](https://github.com/DevExpress/testcafe/issues/918))
2355
2356We have added a new `t.debug` method to debug test behavior on the client.
2357
2358When test execution reaches `t.debug`, it pauses so that you can open browser's developer tools
2359and check the web page state, DOM elements location, their CSS styles.
2360
2361```js
2362fixture `My fixture`
2363 .page `https://devexpress.github.io/testcafe/example`;
2364
2365test('My test', async t => {
2366 await t
2367 .debug()
2368 .setNativeDialogHandler(() => true)
2369 .click('#populate')
2370 .click('#submit-button');
2371});
2372```
2373
2374In the footer, you'll find buttons that allow you to continue test execution or step to the next test action.
2375
2376![Page Footer in the Debug Mode](media/client-debugging-footer.png)
2377
2378TestCafe logs points in code where the debugger stopped.
2379
2380![Logging Debugger Breakpoints](media/log-debugger.png)
2381
2382#### :gear: Testing local webpages ([#1286](https://github.com/DevExpress/testcafe/issues/1286))
2383
2384You can now run tests against local webpages. To do this, specify a URL with the `file://` scheme or a relative path when calling the [page](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#specifying-the-start-webpage) function.
2385
2386```js
2387fixture `MyFixture`
2388 .page `file:///user/my-website/index.html`;
2389```
2390
2391```js
2392fixture `MyFixture`
2393 .page `../my-project/index.html`;
2394```
2395
2396You can also navigate to local pages with the [t.navigateTo](https://devexpress.github.io/testcafe/documentation/test-api/actions/navigate.html) action.
2397
2398```js
2399fixture `My fixture`
2400 .page `http://www.example.com/`;
2401
2402test('Navigate to local pages', async t => {
2403 await t
2404 .navigateTo('file:///user/my-website/index.html')
2405 .navigateTo('../my-project/index.html');
2406});
2407```
2408
2409#### :gear: Adding custom methods to the selector ([#1212](https://github.com/DevExpress/testcafe/issues/1212))
2410
2411You can now extend selectors with custom methods executed on the client. Use the [addCustomMethods](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#custom-methods) method to provide custom methods.
2412
2413```js
2414const myTable = Selector('.my-table').addCustomMethods({
2415 getCellText: (table, rowIndex, columnIndex) =>
2416 table.rows[rowIndex].cells[columnIndex].innerText
2417});
2418
2419await t.expect(myTable.getCellText(1, 1)).contains('hey!');
2420```
2421
2422Use this feature to build selectors that reflect the specifics of your web app.
2423
2424#### :gear: Removing the native dialog handler ([#243](https://github.com/DevExpress/testcafe/issues/243))
2425
2426We have added the capability to remove a [native dialog handler](https://devexpress.github.io/testcafe/documentation/test-api/handling-native-dialogs.html) by passing `null` to the `t.setNativeDialogHandler` method.
2427
2428```js
2429fixture `My fixture`
2430 .page `https://devexpress.github.io/testcafe/example`;
2431
2432test('My test', async t => {
2433 await t
2434 .setNativeDialogHandler(() => true)
2435 .click('#populate')
2436 .setNativeDialogHandler(null)
2437 .click('#submit-button');
2438});
2439```
2440
2441### Bug Fixes
2442
2443* Fixed a bug that led to an incorrect callstack in test run report ([#1226](https://github.com/DevExpress/testcafe/issues/1226))
2444* Cursor is now hidden on screenshots created using the `t.takeScreenshot` action ([#1245](https://github.com/DevExpress/testcafe/issues/1245))
2445* Error no longer appears when selecting a non-existent child by index ([#1240](https://github.com/DevExpress/testcafe/issues/1240))
2446* The blur event is now raised on time when an input is hidden in IE ([#1275](https://github.com/DevExpress/testcafe/issues/1275))
2447* TestCafe no longer fails if a client function argument contains ES6 class method syntax ([#1279](https://github.com/DevExpress/testcafe/issues/1279))
2448* TestCafe now reports errors that occur during browser provider initialization ([#1282](https://github.com/DevExpress/testcafe/issues/1282))
2449* Click on the debugger panel no longer affects the tested page ([#1200](https://github.com/DevExpress/testcafe/issues/1200))
2450* An unhandled error no longer occurs when running a fixture without tests ([#1302](https://github.com/DevExpress/testcafe/issues/1302))
2451* The `input` event is now raised when the value of a `select` element is changed ([#1311](https://github.com/DevExpress/testcafe/issues/1311))
2452* You can now perform actions with ShadowDOM elements ([#1312](https://github.com/DevExpress/testcafe/issues/1312))
2453* Server no longer responds with status 222 when window.fetch() is called in Chrome ([#1134](https://github.com/DevExpress/testcafe/issues/1134))
2454* The JSON reporter no longer returns `screenshotPath: null` if a screenshot path is not specified ([#1269](https://github.com/DevExpress/testcafe/issues/1269))
2455* The `navigateTo` action no longer fails silently with schemes like `http*string*://` ([#965](https://github.com/DevExpress/testcafe/issues/965))
2456* The SVG `use` tag is no longer broken when the parent page has a `file://` URL ([testcafe-hammerhead/#1051](https://github.com/DevExpress/testcafe-hammerhead/issues/1051))
2457* Fixed a bug where `toString` was used instead of `instanceToString` from DOM utils ([testcafe-hammerhead/#1055](https://github.com/DevExpress/testcafe-hammerhead/issues/1055))
2458* File download is no longer raised if the resource is fetched by setting the script src ([testcafe-hammerhead/#1062](https://github.com/DevExpress/testcafe-hammerhead/issues/1062))
2459* Fixed wrong CORS emulation for `fetch` requests ([testcafe-hammerhead/#1059](https://github.com/DevExpress/testcafe-hammerhead/issues/1059))
2460* `Navigator.sendBeacon` function is now overridden ([testcafe-hammerhead/#1035](https://github.com/DevExpress/testcafe-hammerhead/issues/1035))
2461
2462## v0.13.0 (2017-2-16)
2463
2464IDE plugins, fixture hooks, `speed` option for test actions, a couple of API enhancements and lots of bug fixes.
2465
2466### Enhancements
2467
2468#### :gear: IDE Plugins
2469
2470With this release, we have prepared test runner plugins for
2471[VSCode](https://github.com/romanresh/vscode-testcafe) and [SublimeText](https://github.com/churkin/testcafe-sublimetext).
2472These plugins allow you to
2473
2474* Run a particular test, fixture, all tests in a file or directory via the context menu or built-in commands,
2475* Automatically detect browsers installed on the local machine,
2476* Repeat last test run,
2477* Debug tests,
2478* View test results in the `Debug Console` panel.
2479
2480#### :gear: Fixture hooks ([#903](https://github.com/DevExpress/testcafe/issues/903))
2481
2482You can now specify fixture hooks that will be executed before the first test in a fixture is started and after the last test is finished.
2483
2484```js
2485fixture `My fixture`
2486 .page `http://example.com`
2487 .before( async ctx => {
2488 /* fixture initialization code */
2489 })
2490 .after( async ctx => {
2491 /* fixture finalization code */
2492 });
2493```
2494
2495Unlike test hooks, fixture hooks are executed between test runs and do not have access to the tested page.
2496Use them to perform server-side operations like preparing the server that hosts the tested app.
2497
2498##### Sharing variables between fixture hooks and test code
2499
2500Use the `ctx` parameter passed to `fixture.before` and `fixture.after` methods (*fixture context*) to share values and objects with test code.
2501You can assign to `ctx` parameter's properties or add new properties.
2502
2503In test code, use the `t.fixtureCtx` property to access the fixture context.
2504
2505```js
2506fixture `Fixture1`
2507 .before(async ctx => {
2508 ctx.someProp = 123;
2509 })
2510 .after(async ctx => {
2511 console.log(ctx.newProp); // > abc
2512 });
2513
2514test('Test1', async t => {
2515 console.log(t.fixtureCtx.someProp); // > 123
2516});
2517
2518test('Test2', async t => {
2519 t.fixtureCtx.newProp = 'abc';
2520});
2521```
2522
2523#### :gear: Speed option for test actions ([#865](https://github.com/DevExpress/testcafe/issues/865))
2524
2525You can now specify speed for individual test actions using the `speed` option.
2526
2527```js
2528import { Selector } from 'testcafe';
2529
2530const nameInput = Selector('#developer-name');
2531
2532fixture `My Fixture`
2533 .page `http://devexpress.github.io/testcafe/example/`
2534
2535test('My Test', async t => {
2536 await t
2537 .typeText(nameInput, 'Peter')
2538 .typeText(nameInput, ' Parker', { speed: 0.1 });
2539});
2540```
2541
2542If speed is also specified for the whole test, the action speed setting overrides test speed.
2543
2544#### :gear: Setting test speed from test code ([#865](https://github.com/DevExpress/testcafe/issues/865))
2545
2546You can now specify test speed from code using the `t.setTestSpeed` method.
2547
2548```js
2549import { Selector } from 'testcafe';
2550
2551fixture `Test Speed`
2552 .page `http://devexpress.github.io/testcafe/example/`;
2553
2554const nameInput = Selector('#developer-name');
2555
2556test(`Test Speed`, async t => {
2557 await t
2558 .typeText(nameInput, 'Peter')
2559 .setTestSpeed(0.1)
2560 .typeText(nameInput, ' Parker');
2561});
2562```
2563
2564#### :gear: Using test controller outside of test code ([#1166](https://github.com/DevExpress/testcafe/issues/1166))
2565
2566You may sometimes need to call test API from outside of test code. For instance, your [page model](https://devexpress.github.io/testcafe/documentation/recipes/extract-reusable-test-code/use-page-model.html)
2567can contain methods that perform common operations used in many tests, like authentication.
2568
2569```js
2570import { Selector } from 'testcafe';
2571
2572export default class Page {
2573 constructor () {
2574 this.loginInput = Selector('#login');
2575 this.passwordInput = Selector('#password');
2576 this.signInButton = Selector('#sign-in-button');
2577 }
2578 async login (t) {
2579 await t
2580 .typeText(this.loginInput, 'MyLogin')
2581 .typeText(this.passwordInput, 'Pa$$word')
2582 .click(this.signInButton);
2583 }
2584}
2585```
2586
2587In this instance, you need to access the test controller from the page model's `login` method.
2588
2589TestCafe allows you to avoid passing the test controller to the method explicitly.
2590Instead, you can simply import `t` to the page model file.
2591
2592```js
2593import { Selector, t } from 'testcafe';
2594
2595export default class Page {
2596 constructor () {
2597 this.loginInput = Selector('#login');
2598 this.passwordInput = Selector('#password');
2599 this.signInButton = Selector('#sign-in-button');
2600 }
2601 async login () {
2602 await t
2603 .typeText(this.loginInput, 'MyLogin')
2604 .typeText(this.passwordInput, 'Pa$$word')
2605 .click(this.signInButton);
2606 }
2607}
2608```
2609
2610TestCafe will implicitly resolve test context and provide the right test controller.
2611
2612#### :gear: Inserting text with one keystroke with t.typeText action (by [@ericyd](https://github.com/ericyd)) ([#1230](https://github.com/DevExpress/testcafe/issues/1230))
2613
2614The new `paste` option allows you to insert a portion of text with one keystroke, similar to the paste operation.
2615
2616```js
2617import { Selector } from 'testcafe';
2618
2619fixture `My fixture`
2620 .page `http://devexpress.github.io/testcafe/example/`;
2621
2622const nameInput = Selector('#developer-name');
2623
2624test(`My test`, async t => {
2625 await t
2626 .typeText(nameInput, 'Peter')
2627 .typeText(nameInput, ' Parker', { paste: true });
2628});
2629```
2630
2631#### :gear: prevSibling and nextSibling selector's DOM search methods ([#1218](https://github.com/DevExpress/testcafe/issues/1218))
2632
2633The new `prevSibling` and `nextSibling` methods allow you to search among sibling elements that reside before and after the selector's matching elements in the DOM tree.
2634
2635```js
2636Selector('li .active').prevSibling(2);
2637Selector('li').nextSibling('.checked');
2638```
2639
2640#### :gear: Deprecated functionality removed ([#1167](https://github.com/DevExpress/testcafe/issues/1167))
2641
2642The following deprecated members have been removed from the API.
2643
2644* `t.select` method - use `Selector` instead:
2645
2646```js
2647const id = await t.select('.someClass').id;
2648
2649// can be replaced with
2650
2651const id = await Selector('.someClass').id;
2652```
2653
2654* `selectorOptions.index` - use [selector.nth()](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#nth) instead.
2655* `selectorOptions.text` - use [selector.withText()](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#withtext) instead.
2656* `selectorOptions.dependencies` - use [filtering](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#filter-dom-nodes) and [hierarchical](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#search-for-elements-in-the-dom-hierarchy) methods to build combined selectors instead.
2657
2658### Bug Fixes
2659
2660* Fixed a bug where tests failed with a script error ([#1188](https://github.com/DevExpress/testcafe/issues/1188))
2661* Text can now be typed to an input field with type "email" in Firefox ([#1187](https://github.com/DevExpress/testcafe/issues/1187))
2662* `npm install` no longer displays warnings ([#769](https://github.com/DevExpress/testcafe/issues/769))
2663* Dev Tools can now be opened with a keyboard shortcut or right click on macOS ([#1193](https://github.com/DevExpress/testcafe/issues/1193))
2664* A warning no longer appears when using ClientFunction with dependencies ([#1168](https://github.com/DevExpress/testcafe/issues/1168))
2665* Tests can now run against React Storybook ([#1147](https://github.com/DevExpress/testcafe/issues/1147))
2666* Script error is no longer thrown in iOS webviews (Firefox, Chrome of iOS) ([#1189](https://github.com/DevExpress/testcafe/issues/1189))
2667* XhrSandbox.createNativeXHR now works correctly ([testcafe-hammerhead/#1042](https://github.com/DevExpress/testcafe-hammerhead/issues/1042))
2668* Window.prototype is no longer used for NativeMethods initialization ([testcafe-hammerhead/#1040](https://github.com/DevExpress/testcafe-hammerhead/issues/1040))
2669* Functions from the 'vm' module are now overridden on the client ([testcafe-hammerhead/#1029](https://github.com/DevExpress/testcafe-hammerhead/issues/1029))
2670* Input type is now changed while setting the selection range in Firefox ([testcafe-hammerhead/#1025](https://github.com/DevExpress/testcafe-hammerhead/issues/1025))
2671* An iframe with the `about:blank` src can now send `postMessage` ([testcafe-hammerhead/#1026](https://github.com/DevExpress/testcafe-hammerhead/issues/1026))
2672* The `formaction` attribute is now overridden correctly after it is appended in DOM ([testcafe-hammerhead/#1021](https://github.com/DevExpress/testcafe-hammerhead/issues/1021))
2673* Fixed a bug where the Authorization Header was wrongly removed ([testcafe-hammerhead/#1016](https://github.com/DevExpress/testcafe-hammerhead/issues/1016))
2674* The `file://` protocol is now supported ([testcafe-hammerhead/#908](https://github.com/DevExpress/testcafe-hammerhead/issues/908))
2675
2676## v0.12.1 (2017-1-20)
2677
2678:racing_car: A recovery release following [v0.12.0](#v0120-2017-1-19) with an important fix. :racing_car:
2679
2680### Bug Fixes
2681
2682* Fixed a bug when the cursor was not visible while running tests ([#1156](https://github.com/DevExpress/testcafe/issues/1156)).
2683
2684## v0.12.0 (2017-1-19)
2685
2686HTTP authentication support, a CI-friendly way to start and stop the tested app and lots of API enhancements.
2687
2688### Enhancements
2689
2690#### :gear: HTTP authentication support ([#955](https://github.com/DevExpress/testcafe/issues/955), [#1109](https://github.com/DevExpress/testcafe/issues/1109))
2691
2692TestCafe now supports testing webpages protected with HTTP Basic and NTLM authentication.
2693
2694Use the [httpAuth](https://devexpress.github.io/testcafe/documentation/test-api/http-authentication.html) function in fixture or test declaration to specify the credentials.
2695
2696```js
2697fixture `My fixture`
2698 .page `http://example.com`
2699 .httpAuth({
2700 username: 'username',
2701 password: 'Pa$$word',
2702
2703 // Optional parameters, can be required for the NTLM authentication.
2704 domain: 'CORP-DOMAIN',
2705 workstation: 'machine-win10'
2706 });
2707
2708test('Test1', async t => {}); // Logs in as username
2709
2710test // Logs in as differentUserName
2711 .httpAuth({
2712 username: 'differentUserName',
2713 password: 'differentPa$$word'
2714 })
2715 ('Test2', async t => {});
2716```
2717
2718#### :gear: Built-in CI-friendly way to start and stop the tested web app ([#1047](https://github.com/DevExpress/testcafe/issues/1047))
2719
2720When launching tests, you can now specify a command that starts the tested application.
2721TestCafe will automatically execute this command before running tests and stop the process when tests are finished.
2722
2723```sh
2724testcafe chrome tests/ --app "node server.js"
2725```
2726
2727```js
2728runner
2729 .startApp('node server.js')
2730 .run();
2731```
2732
2733You can also specify how long TestCafe should wait until the tested application initializes (the default is 1 sec).
2734
2735```sh
2736testcafe chrome tests/ --app "node server.js" --app-init-delay 4000
2737```
2738
2739```js
2740runner
2741 .startApp('node server.js', 4000)
2742 .run();
2743```
2744
2745#### :gear: Screenshot and window resize actions now work on Linux ([#1117](https://github.com/DevExpress/testcafe/issues/1117))
2746
2747The `t.takeScreenshot`, `t.resizeWindow`, `t.resizeWindowToFitDevice` and `t.maximizeWindow` actions can now be executed on Linux machines.
2748
2749#### :gear: Adding custom properties to the element state ([#749](https://github.com/DevExpress/testcafe/issues/749))
2750
2751The state of webpage elements can now be extended with custom properties.
2752
2753We have added the [addCustomDOMProperties](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#adding-custom-properties-to-element-state)
2754method to the selector, so that you can add properties to the element state like in the following example.
2755
2756```js
2757import { Selector } from 'testcafe'
2758
2759fixture `My fixture`
2760 .page `https://devexpress.github.io/testcafe/example/`;
2761
2762test('Check Label HTML', async t => {
2763 const label = Selector('label').addCustomDOMProperties({
2764 innerHTML: el => el.innerHTML
2765 });
2766
2767 await t.expect(label.innerHTML).contains('input type="checkbox" name="remote"');
2768});
2769```
2770
2771#### :gear: Skipping tests ([#246](https://github.com/DevExpress/testcafe/issues/246))
2772
2773TestCafe now allows you to specify that a particular test or fixture should be skipped when running tests.
2774Use the `fixture.skip` and `test.skip` methods for this.
2775
2776```js
2777fixture.skip `Fixture1`; // All tests in this fixture will be skipped
2778
2779test('Fixture1Test1', () => {});
2780test('Fixture1Test2', () => {});
2781
2782fixture `Fixture2`;
2783
2784test('Fixture2Test1', () => {});
2785test.skip('Fixture2Test2', () => {}); // This test will be skipped
2786test('Fixture2Test3', () => {});
2787```
2788
2789You can also use the `only` method to specify that only a particular test or fixture should run while all others should be skipped.
2790
2791```js
2792fixture.only `Fixture1`;
2793test('Fixture1Test1', () => {});
2794test('Fixture1Test2', () => {});
2795
2796fixture `Fixture2`;
2797test('Fixture2Test1', () => {});
2798test.only('Fixture2Test2', () => {});
2799test('Fixture2Test3', () => {});
2800
2801// Only tests in Fixture1 and the Fixture2Test2 test will run
2802```
2803
2804#### :gear: Specifying the start webpage for a test ([#501](https://github.com/DevExpress/testcafe/issues/501))
2805
2806An individual test can now override the fixture's `page` setting and start on a different page.
2807
2808 ```js
2809 fixture `MyFixture`
2810 .page `http://devexpress.github.io/testcafe/example`;
2811
2812 test('Test1', async t => {
2813 // Starts at http://devexpress.github.io/testcafe/example
2814 });
2815
2816 test
2817 .page `http://devexpress.github.io/testcafe/blog/`
2818 ('Test2', async t => {
2819 // Starts at http://devexpress.github.io/testcafe/blog/
2820 });
2821 ```
2822
2823#### :gear: Initialization and finalization methods for a test ([#1108](https://github.com/DevExpress/testcafe/issues/1108))
2824
2825We have added the [before](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#initialization-and-clean-up)
2826and [after](https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#initialization-and-clean-up) methods to the test declaration.
2827Use them to provide code that will be executed before a test is started and after it is finished.
2828
2829```js
2830test
2831 .before( async t => {
2832 /* test initialization code */
2833 })
2834 ('My Test', async t => {
2835 /* test code */
2836 })
2837 .after( async t => {
2838 /* test finalization code */
2839 });
2840```
2841
2842#### :gear: Sharing variables between hooks and test code ([#841](https://github.com/DevExpress/testcafe/issues/841))
2843
2844You can now share variables between `fixture.beforeEach`, `fixture.afterEach`, `test.before`, `test.after` functions and test code
2845by using the *test context* object.
2846
2847Test context is available through the `t.ctx` property.
2848
2849Instead of using a global variable, assign the object you want to share directly to `t.ctx` or create a property like in the following example.
2850
2851```js
2852fixture `Fixture1`
2853 .beforeEach(async t => {
2854 t.ctx.someProp = 123;
2855 });
2856
2857test
2858 ('Test1', async t => {
2859 console.log(t.ctx.someProp); // > 123
2860 })
2861 .after(async t => {
2862 console.log(t.ctx.someProp); // > 123
2863 });
2864```
2865
2866#### :gear: Assertion methods to check for regexp match ([#1038](https://github.com/DevExpress/testcafe/issues/1038))
2867
2868We have added `match` and `notMatch` methods to check if a string matches a particular regular expression.
2869
2870```js
2871await t.expect('foobar').match(/^f/, 'this assertion passes');
2872```
2873
2874```js
2875await t.expect('foobar').notMatch(/^b/, 'this assertion passes');
2876```
2877
2878#### :gear: Improved filtering by predicates in selectors ([#1025](https://github.com/DevExpress/testcafe/issues/1025) and [#1065](https://github.com/DevExpress/testcafe/issues/1065))
2879
2880Selector's filter predicates now receive more information about the current node, which enables you to implement more advanced filtering logic.
2881
2882The `filter`, `find`, `parent`, `child` and `sibling` methods now pass the node's index to the predicate.
2883The `find`, `parent`, `child` and `sibling` methods now also pass a node from the preceding selector.
2884
2885```js
2886Selector('ul').find((node, idx, originNode) => {
2887 // node === the <ul>'s descendant node
2888 // idx === index of the current <ul>'s descendant node
2889 // originNode === the <ul> element
2890});
2891```
2892
2893In addition, all these methods now allow you to pass objects to the predicate's scope on the client. To this end, we have added
2894an optional `dependencies` parameter.
2895
2896```js
2897const isNodeOk = ClientFunction(node => { /*...*/ });
2898const flag = getFlag();
2899
2900Selector('ul').child(node => {
2901 return isNodeOk(node) && flag;
2902}, { isNodeOk, flag });
2903```
2904
2905#### :gear: Filtering by negative index in selectors ([#738](https://github.com/DevExpress/testcafe/issues/738))
2906
2907You can now pass negative `index` values to selector methods. In this instance, index is counted from the end of the matched set.
2908
2909```js
2910const lastChild = Selector('.someClass').child(-1);
2911```
2912
2913#### :gear: Improved cursor positioning in test actions ([#981](https://github.com/DevExpress/testcafe/issues/981))
2914
2915In action options, X and Y offsets that define the point where action is performed can now be negative.
2916In this instance, the cursor position is calculated from the bottom-right corner of the target element.
2917
2918```js
2919await t.click('#element', { offsetX: -10, offsetY: -30 });
2920```
2921
2922#### :gear: Client functions as an assertion's actual value ([#1009](https://github.com/DevExpress/testcafe/issues/1009))
2923
2924You can now pass client functions to assertion's `expect` method. In this instance, the
2925[Smart Assertion Query Mechanism](https://devexpress.github.io/testcafe/documentation/test-api/assertions/#smart-assertion-query-mechanism)
2926will run this client function and use the return value as the assertion's actual value.
2927
2928```js
2929import { ClientFunction } from 'testcafe';
2930
2931const windowLocation = ClientFunction(() => window.location.toString());
2932
2933fixture `My Fixture`
2934 .page `http://www.example.com`;
2935
2936test('My Test', async t => {
2937 await t.expect(windowLocation()).eql('http://www.example.com');
2938});
2939```
2940
2941#### :gear: Automatic waiting for scripts added during a test action ([#1072](https://github.com/DevExpress/testcafe/issues/1072))
2942
2943If a test action adds scripts on a page, TestCafe now automatically waits for them to finish before proceeding to the next test action.
2944
2945#### :gear: New ESLint plugin ([#1083](https://github.com/DevExpress/testcafe/issues/1083))
2946
2947We have prepared an [ESLint plugin](https://github.com/miherlosev/eslint-plugin-testcafe).
2948Get it to ensure that ESLint does not fail on TestCafe test code.
2949
2950### Bug Fixes
2951
2952* Remote browser connection timeout has been increased ([#1078](https://github.com/DevExpress/testcafe/issues/1078))
2953* You can now run tests located in directories with a large number of files ([#1090](https://github.com/DevExpress/testcafe/issues/1090))
2954* Key identifiers for all keys are now passed to key events ([#1079](https://github.com/DevExpress/testcafe/issues/1079))
2955* Touch events are no longer emulated for touch monitors ([#984](https://github.com/DevExpress/testcafe/issues/984))
2956* v8 flags can now be passed to Node.js when using TestCafe from the command line ([#1006](https://github.com/DevExpress/testcafe/issues/1006))
2957* ShadowUI root is now hidden for `elementFromPoint` in an iframe in IE ([#1029](https://github.com/DevExpress/testcafe/issues/1029))
2958* Preventing the form submit event no longer leads to additional delay between actions ([#1115](https://github.com/DevExpress/testcafe/issues/1115))
2959* TestCafe no longer hangs when a cursor is moved out of a reloading iframe ([#1140](https://github.com/DevExpress/testcafe/issues/1140))
2960* Onclick event handler is now executed correctly during click automation in specific cases ([#1138](https://github.com/DevExpress/testcafe/issues/1138))
2961* The `application/pdf` mime type is no longer recognized as a page ([testcafe-hammerhead#1014](https://github.com/DevExpress/testcafe-hammerhead/issues/1014))
2962* Limited support for the `frameset` tag is implemented ([testcafe-hammerhead#1009](https://github.com/DevExpress/testcafe-hammerhead/issues/1009))
2963* `Function.prototype.toString` is now proxied correctly when it is overriden in a user script ([testcafe-hammerhead#999](https://github.com/DevExpress/testcafe-hammerhead/issues/999))
2964* Script processing no longer hangs on chained assignments ([testcafe-hammerhead#866](https://github.com/DevExpress/testcafe-hammerhead/issues/866))
2965* `formaction` attribute is now processed ([testcafe-hammerhead#988](https://github.com/DevExpress/testcafe-hammerhead/issues/988))
2966* `document.styleSheets` is now overrided ([testcafe-hammerhead#1000](https://github.com/DevExpress/testcafe-hammerhead/issues/1000))
2967* `href` attribute is now processed correctly in an iframe without src when it is set from the main window ([testcafe-hammerhead#620](https://github.com/DevExpress/testcafe-hammerhead/issues/620))
2968* Cookies without a key are now set correctly ([testcafe-hammerhead#899](https://github.com/DevExpress/testcafe-hammerhead/issues/899))
2969* The `noscript` tag is now processed correctly when it was added via `innerHTML` ([testcafe-hammerhead#987](https://github.com/DevExpress/testcafe-hammerhead/issues/987))
2970* `Element.insertAdjacentHTML` function is now overrided in IE ([testcafe-hammerhead#954](https://github.com/DevExpress/testcafe-hammerhead/issues/954))
2971* Browser behaviour is now emulated correctly when the cookie size is bigger than the browser limit ([testcafe-hammerhead#767](https://github.com/DevExpress/testcafe-hammerhead/issues/767))
2972
2973## v0.11.1 (2016-12-8)
2974
2975:racing_car: A quick follow-up for the [v0.11.0](#v0110-2016-12-8) with important fix for Firefox users. :racing_car:
2976
2977### Bug Fixes
2978
2979* Firefox now launches successfully if TestCafe installation directory contains whitespaces ([#1042](https://github.com/DevExpress/testcafe/issues/1042)).
2980
2981## v0.11.0 (2016-12-8)
2982
2983### Enhancements
2984
2985#### :gear: Redesigned selector system. ([#798](https://github.com/DevExpress/testcafe/issues/798))
2986
2987##### New selector methods
2988
2989Multiple [filtering](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#filter-multiple-dom-nodes) and [hierarchical](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#find-elements-by-dom-hierarchy) methods were introduced for selectors.
2990Now you can build flexible, lazily-evaluated functional-style selector chains.
2991
2992*Here are some examples:*
2993
2994```js
2995Selector('ul').find('label').parent('div.someClass')
2996```
2997
2998Finds all `ul` elements on page. Then, in each found `ul` element finds `label` elements.
2999Then, for each `label` element finds a parent that matches the `div.someClass` selector.
3000
3001------
3002
3003Like in jQuery, if you request a [property](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/dom-node-state.html#members-common-across-all-nodes) of the matched set or try evaluate
3004a [snapshot](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#dom-node-snapshot), the selector returns values for the first element in the set.
3005
3006```js
3007// Returns id of the first element in the set
3008const id = await Selector('ul').find('label').parent('div.someClass').id;
3009
3010// Returns snapshot for the first element in the set
3011const snapshot = await Selector('ul').find('label').parent('div.someClass')();
3012```
3013
3014------
3015
3016However, you can obtain data for any element in the set by using `nth` filter.
3017
3018```js
3019// Returns id of the third element in the set
3020const id = await Selector('ul').find('label').parent('div.someClass').nth(2).id;
3021
3022// Returns snapshot for the fourth element in the set
3023const snapshot = await Selector('ul').find('label').parent('div.someClass').nth(4)();
3024```
3025
3026------
3027
3028Note that you can add text and index filters in the selector chain.
3029
3030```js
3031Selector('.container').parent(1).nth(0).find('.content').withText('yo!').child('span');
3032```
3033
3034In this example the selector:
3035
30361. finds the second parent (parent of parent) of `.container` elements;
30372. peeks the first element in the matched set;
30383. in that element, finds elements that match the `.content` selector;
30394. filters them by text `yo!`;
30405. in each filtered element, searches for a child with tag name `span`.
3041
3042------
3043
3044##### Getting selector matched set length
3045
3046Also, now you can get selector matched set length and check matching elements existence by using selector [`count` and `exists` properties](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#get-selector-matching-set-length).
3047
3048##### Unawaited parametrized selector calls now allowed outside test context
3049
3050Previously selector call outside of text context thrown an error:
3051
3052```js
3053const selector = Selector(arg => /* selector code */);
3054
3055selector('someArg'); // <-- throws
3056
3057test ('Some test', async t=> {
3058...
3059});
3060```
3061
3062Now it's not a case if selector is not awaited. It's useful when you need to build a page model outside the test context:
3063
3064```js
3065const selector = Selector(arg => /* selector code */);
3066const selector2 = selector('someArg').find('span'); // <-- doesn't throw anymore
3067
3068test ('Some test', async t=> {
3069...
3070});
3071```
3072
3073However, once you'll try to obtain element property outside of test context it will throw:
3074
3075```js
3076const selector = Selector(arg => /* selector code */);
3077
3078async getId() {
3079 return await selector('someArg').id; // throws
3080}
3081
3082getId();
3083
3084test ('Some test', async t=> {
3085...
3086});
3087```
3088
3089##### Index filter is not ignored anymore if selector returns single node
3090
3091Previously if selector returned single node `index` was ignored:
3092
3093```js
3094Selector('#someId', { index: 2 } ); // index is ignored and selector returns element with id `someId`
3095```
3096
3097however it's not a case now:
3098
3099```js
3100Selector('#someId').nth(2); // returns `null`, since there is only one element in matched set with id `someId`
3101```
3102
3103##### Deprecated API
3104
3105* [`t.select` method](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#one-time-selection) - use `Selector` instead:
3106
3107```js
3108const id = await t.select('.someClass').id;
3109
3110// can be replaced with
3111
3112const id = await Selector('.someClass').id;
3113```
3114
3115* [selectorOptions.index](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selector-options.html#optionsindex) - use [selector.nth()](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#nth) instead.
3116* [selectorOptions.text](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selector-options.html#optionstext) - use [selector.withText()](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#withtext) instead.
3117* [selectorOptions.dependencies](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selector-options.html#optionsdependencies) - use [filtering](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#filter-multiple-dom-nodes) and [hierarchical](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#find-elements-by-dom-hierarchy) methods to build combined selectors instead.
3118
3119#### :gear: Built-in assertions. ([#998](https://github.com/DevExpress/testcafe/issues/998))
3120
3121TestCafe now ships with [numerous built-in BDD-style assertions](http://devexpress.github.io/testcafe/documentation/test-api/assertions/assertion-api.html).
3122If the TestCafe assertion receives a [Selector's property](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/dom-node-state.html#members-common-across-all-nodes) as an actual value, TestCafe uses the [smart assertion query mechanism](http://devexpress.github.io/testcafe/documentation/test-api/assertions/index.html#smart-assertion-query-mechanism):
3123if an assertion did not passed, the test does not fail immediately. The assertion retries to pass multiple times and each time it re-requests the actual shorthand value. The test fails if the assertion could not complete successfully within a timeout.
3124This approach allows you to create stable tests that lack random errors and decrease the amount of time required to run all your tests due to the lack of extra waitings.
3125
3126*Example page markup:*
3127
3128```html
3129<div id="btn"></div>
3130<script>
3131var btn = document.getElementById('btn');
3132
3133btn.addEventListener(function() {
3134 window.setTimeout(function() {
3135 btn.innerText = 'Loading...';
3136 }, 100);
3137});
3138</script>
3139```
3140
3141*Example test code:*
3142
3143```js
3144test('Button click', async t => {
3145 const btn = Selector('#btn');
3146
3147 await t
3148 .click(btn)
3149 // Regular assertion will fail immediately, but TestCafe retries to run DOM state
3150 // assertions many times until this assertion pass successfully within the timeout.
3151 // The default timeout is 3000 ms.
3152 .expect(btn.textContent).contains('Loading...');
3153});
3154```
3155
3156#### :gear: Added [`selected` and `selectedIndex` DOM node state properties](https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/dom-node-state.html#members-common-across-all-nodes). ([#951](https://github.com/DevExpress/testcafe/issues/951))
3157
3158#### :gear: It's now possible to start browser with arguments. ([#905](https://github.com/DevExpress/testcafe/issues/905))
3159
3160If you need to pass arguments for the specified browser, write them right after browser alias. Surround the browser call and its arguments with quotation marks:
3161
3162```sh
3163testcafe "chrome --start-fullscreen",firefox tests/test.js
3164```
3165
3166See [Starting browser with arguments](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#starting-browser-with-arguments).
3167
3168### Bug Fixes
3169
3170* Action keyboard events now have `event.key` and `event.keyIdentifier` properties set ([#993](https://github.com/DevExpress/testcafe/issues/993)).
3171* `document.body.nextSibling`, that was broken is some cases previously, now operates properly ([#958](https://github.com/DevExpress/testcafe/issues/958)).
3172* Now it's possible to use `t.setFilesToUpload` and `t.clearUpload` methods with the hidden inputs ([#963](https://github.com/DevExpress/testcafe/issues/963)).
3173* Now test not hangs if object `toString` method uses `this.location` getter ([#953](https://github.com/DevExpress/testcafe/issues/953)).
3174* Touch events now correctly dispatched in latest Chrome versions with touch monitor ([#944](https://github.com/DevExpress/testcafe/issues/944)).
3175* Now test compilation doesn't fail if imported helper contains module re-export (e.g. `export * from './mod'`) ([#969](https://github.com/DevExpress/testcafe/issues/969)).
3176* Actions now scroll to element to make it completely visible (there possible) ([#987](https://github.com/DevExpress/testcafe/issues/987), [#973](https://github.com/DevExpress/testcafe/issues/973)).
3177* Dispatched key events now successfully pass `instanceof` check ([#964](https://github.com/DevExpress/testcafe/issues/964)).
3178* Ember elements doesn't throw `Uncaught TypeError: e.getAttribute is not a function` anymore ([#966](https://github.com/DevExpress/testcafe/issues/966)).
3179* First run wizards now automatically disabled in Chrome in Firefox ([testcafe-browser-tools#102](https://github.com/DevExpress/testcafe-browser-tools/issues/102)).
3180* `<td>` now correctly focused on actions ([testcafe-hammerhead#901](https://github.com/DevExpress/testcafe-hammerhead/issues/901)).
3181* `document.baseURI` now returns correct value ([testcafe-hammerhead#920](https://github.com/DevExpress/testcafe-hammerhead/issues/920)).
3182* `Function.constructor` now returns correct value ([testcafe-hammerhead#913](https://github.com/DevExpress/testcafe-hammerhead/issues/913)).
3183* Setting `location` to the URL hash value doesn't lead to JavaScript error anymore ([testcafe-hammerhead#917](https://github.com/DevExpress/testcafe-hammerhead/issues/917)).
3184* Fixed corruption of `<template>` content ([testcafe-hammerhead#912](https://github.com/DevExpress/testcafe-hammerhead/issues/912)).
3185* Fixed `querySelector` for `href` attribute if value contains URL hash ([testcafe-hammerhead#922](https://github.com/DevExpress/testcafe-hammerhead/issues/922)).
3186* HTTP responses with [Brotli](https://github.com/google/brotli) encoding now processed correctly ([testcafe-hammerhead#900](https://github.com/DevExpress/testcafe-hammerhead/issues/900)).
3187* `Element.attributes` now behaves as a live collection ([testcafe-hammerhead#924](https://github.com/DevExpress/testcafe-hammerhead/issues/924)).
3188* TestCafe doesn't fail with `Error: Can't set headers after they are sent.` error on network errors ([testcafe-hammerhead#937](https://github.com/DevExpress/testcafe-hammerhead/issues/937)).
3189* Element property value setters now return correct value ([testcafe-hammerhead#907](https://github.com/DevExpress/testcafe-hammerhead/issues/907)).
3190* `window.fetch` without parameters now returns rejected promise as expected ([testcafe-hammerhead#939](https://github.com/DevExpress/testcafe-hammerhead/issues/939)).
3191* Hyperlinks created in iframe and added to the top window now have correct URL ([testcafe-hammerhead#564](https://github.com/DevExpress/testcafe-hammerhead/issues/564)).
3192* `autocomplete` attribute now not forced on all elements ([testcafe-hammerhead#955](https://github.com/DevExpress/testcafe-hammerhead/issues/955)).
3193* Cookies set via XHR response now available from client code ([testcafe-hammerhead#905](https://github.com/DevExpress/testcafe-hammerhead/issues/905)).
3194* Fixed client rendering problems caused by incorrect DOM element determination ([testcafe-hammerhead#953](https://github.com/DevExpress/testcafe-hammerhead/issues/953)).
3195
3196## v0.10.0 (2016-11-8)
3197
3198### Enhancements
3199
3200#### :gear: Snapshot API shorthands. ([#771](https://github.com/DevExpress/testcafe/issues/771))
3201
3202 Previously, if you needed to use a single property from the snapshot, you had to introduce two assignments
3203
3204 ```js
3205 const snapshot = await selector();
3206 const nodeType = snapshot.nodeType;
3207 ```
3208
3209 or additional parentheses.
3210
3211 ```js
3212 const nodeType = (await selector()).nodeType;
3213 ```
3214
3215 Now snapshot methods and property getters are exposed by selectors
3216 (and selector promises as well) so that you can write more compact code.
3217
3218 ```js
3219 const nodeType = await selector.nodeType;
3220
3221 // or
3222
3223 const nodeType = await selector('someParam').nodeType;
3224 ```
3225
3226 However, shorthand properties do not allow you to omit parentheses when working with dictionary properties
3227 like `style`, `attributes` or `boundingClientRect`.
3228
3229 ```js
3230 const width = (await selector.style)['width'];
3231 ```
3232
3233 That is why we have also introduced shorthand methods for these dictionaries: `getStyleProperty`, `getAttribute` and `getBoundingClientRectProperty`.
3234
3235 ```js
3236 const width = await selector.getStyleProperty('width');
3237 const id = await selector.getAttribute('id');
3238 const left = await selector.getBoundingClientRectProperty('left');
3239 ```
3240
3241 Finally, we have added the `hasClass` method.
3242
3243 ```js
3244 if (await selector.hasClass('foo')) {
3245 //...
3246 }
3247 ```
3248
3249 See [Snapshot API Shorthands](http://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#obtain-element-state).
3250
3251#### :gear: Improved automatic wait mechanism. ([#245](https://github.com/DevExpress/testcafe/issues/245))
3252
3253 We got rid of unnecessary waiting so that tests now run almost two times faster.
3254
3255 ![Tests running in v0.10.0 vs v0.9.0](https://raw.githubusercontent.com/DevExpress/testcafe/master/media/new-0-10-0-autowait.gif)
3256
3257#### :gear: Test execution speed control. ([#938](https://github.com/DevExpress/testcafe/issues/938))
3258
3259 We have introduced an option that allows you to specify how fast tests run.
3260
3261 By default, tests run at the maximum speed. However, if you need to watch a test running to understand what happens in it,
3262 this speed may seem too fast. In this instance, use the new `speed` option to slow the test down.
3263
3264 This option is available from the command line
3265
3266 ```sh
3267 testcafe chrome my-tests --speed 0.1
3268 ```
3269
3270 and from the API.
3271
3272 ```js
3273 await runner.run({
3274 speed: 0.1
3275 })
3276 ```
3277
3278 You can use factor values between `1` (the fastest, used by default) and `0.01` (the slowest).
3279
3280#### :gear: `t.maximizeWindow` test action. ([#812](https://github.com/DevExpress/testcafe/issues/812))
3281
3282 We have added a test action that maximizes the browser window.
3283
3284 ```js
3285 import { expect } from 'chai';
3286 import { Selector } from 'testcafe';
3287
3288 const menu = Selector('#side-menu');
3289
3290 fixture `My fixture`
3291 .page `http://www.example.com/`;
3292
3293 test('Side menu is displayed in full screen', async t => {
3294 await t.maximizeWindow();
3295
3296 expect(await menu.visible).to.be.ok;
3297 });
3298 ```
3299
3300### Bug Fixes
3301
3302* The `t.resizeWindow` and `t.resizeWindowToFitDevice` actions now work correctly on macOS ([#816](https://github.com/DevExpress/testcafe/issues/816))
3303* Browser aliases are now case insensitive in the command line ([#890](https://github.com/DevExpress/testcafe/issues/890))
3304* Tests no longer hang if target scrolling coordinates are fractional ([#882](https://github.com/DevExpress/testcafe/issues/882))
3305* The 'Element is not visible' error is no longer raised when scrolling a document in Quirks mode ([#883](https://github.com/DevExpress/testcafe/issues/883))
3306* `<table>` child elements are now focused correctly ([#889](https://github.com/DevExpress/testcafe/issues/889))
3307* The page is no longer scrolled to the parent element when focusing on a non-focusable child during click automation ([#913](https://github.com/DevExpress/testcafe/issues/913))
3308* Browser auto-detection now works with all the Linux distributions ([#104](https://github.com/DevExpress/testcafe-browser-tools/issues/104),
3309 [#915](https://github.com/DevExpress/testcafe/issues/915))
3310
3311## v0.9.0 (2016-10-18)
3312
3313:tada: Initial release :tada:
3314
\No newline at end of file