1 | # gulp-protractor [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
|
2 |
|
3 | > Run your [angular protractor](https://github.com/angular/protractor) tests with [gulp](https://github.com/wearefractal/gulp)
|
4 |
|
5 | ## Usage
|
6 |
|
7 | First, install `gulp-protractor` AND `protractor` as a development dependency:
|
8 |
|
9 | ```shell
|
10 | npm install --save-dev gulp-protractor protractor
|
11 | ```
|
12 |
|
13 | Then, add it to your `gulpfile.js`:
|
14 |
|
15 | ```javascript
|
16 | var protractor = require("gulp-protractor").protractor;
|
17 |
|
18 | gulp.src(["./src/tests/*.js"])
|
19 | .pipe(protractor({
|
20 | configFile: "test/protractor.config.js"
|
21 | }))
|
22 | .on('error', function(e) { throw e })
|
23 | ```
|
24 |
|
25 | ### Protractor Webdriver
|
26 | You have to update and start a standalone selenium server. [Please read the offical instructions](https://github.com/angular/protractor#appendix-a-setting-up-a-standalone-selenium-server). You can use the build in webdriver snippet.
|
27 |
|
28 | ```javascript
|
29 | var webdriver = require("gulp-protractor").webdriver;
|
30 | gulp.task('webdriver', webdriver);
|
31 | ```
|
32 |
|
33 | ## API
|
34 |
|
35 | ### protractor(options)
|
36 |
|
37 | #### options.configFile
|
38 | Type: `String`
|
39 | Default: `null`
|
40 |
|
41 | The path to your protractor config
|
42 |
|
43 | #### options.args
|
44 | Type: `Array`
|
45 | Default: `[]`
|
46 |
|
47 | Arguments get passed directly to the protractor call [Read the docs for more information](https://github.com/angular/protractor/blob/master/docs/getting-started.md#setup-and-config)
|
48 |
|
49 |
|
50 | #### options.debug
|
51 | Type: `Boolean`
|
52 | Default: `false`
|
53 |
|
54 | Runs protractor with the debug flag [Protractor Debugging documentation](https://github.com/angular/protractor/blob/master/docs/debugging.md#timeouts)
|
55 |
|
56 |
|
57 | ## License
|
58 |
|
59 | [MIT License](http://en.wikipedia.org/wiki/MIT_License)
|
60 |
|
61 | [npm-url]: https://npmjs.org/package/gulp-protractor
|
62 | [npm-image]: https://badge.fury.io/js/gulp-protractor.png
|
63 |
|
64 | [travis-url]: http://travis-ci.org/mllrsohn/gulp-protractor
|
65 | [travis-image]: https://secure.travis-ci.org/mllrsohn/gulp-protractor.png?branch=master
|
66 |
|
67 | [depstat-url]: https://david-dm.org/mllrsohn/gulp-protractor
|
68 | [depstat-image]: https://david-dm.org/mllrsohn/gulp-protractor.png
|