UNPKG

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