UNPKG

2.4 kBMarkdownView Raw
1# testcafe-browser-tools
2
3[![Build Status](https://travis-ci.org/DevExpress/testcafe-browser-tools.svg)](https://travis-ci.org/DevExpress/testcafe-browser-tools)
4
5TestСafe Browser Tools is an utility library for performing platform-dependent actions on browser windows.
6Working with browsers is specific for each operating system and requires native code to deal with. In order to provide painless and simple installation, this package encapsulates pre-built binaries for all supported platforms and JS-wrappers around them. This helps end-users avoid running *post-npm-install* build actions.
7 
8# Build Process
9To build native binaries from source files, execute the gulp task corresponding to your operating system:
10```
11'build-win'
12'build-mac'
13'build-linux'
14```
15Note that the application for a particular platform must be built on a machine with the same platform.
16
17The *bin* directory contains pre-built native binaries. Consider using them if your contribution does not affect the native modules.
18
19# Install
20
21```
22$ npm install testcafe-browser-tools
23```
24# API Reference
25
26**Important note**: To identify the web browser window, most of the provided functions use its title.
27This title matches the web page's `document.title` in most of the browsers.
28However, Microsoft Edge truncates the window title to the hostname if `document.title` contains only a URL
29( e.g. `document.title = 'http://localhost:1337/page'` gives `localhost` in the window title).
30
31So, you need to add some characters before the URL in order to bring it to the window title:
32```js
33document.title = 'title: ' + document.location.toString()
34```
35For API reference, see the [API](API.md) document.
36
37# Testing
38
39To run automated tests:
40```
41$ npm test
42```
43Since the module functionality depends on browsers available on a testing machine and you cannot predict expected returned values for some functions, the automated tests cover only a part of the functionality.
44To test all the functions provided by the module, use the playground. To run it, execute the gulp task corresponding to your operating system:
45```
46$ gulp run-playground-win
47$ gulp run-playground-mac
48$ gulp run-playground-linux
49```
50This will open the Playground web page at [http://localhost:1334/](http://localhost:1334/), where you can manually check if the functions work correctly.
51
52# Author
53
54Developer Express Inc.([http://devexpress.com](http://devexpress.com))