UNPKG

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