ramonvictor / gulp-protractor-qa

Warns whether Protractor locators have their matches within a given set of AngularJS view files
https://www.npmjs.org/package/gulp-protractor-qa
MIT License
59 stars 18 forks source link

gulp-protractor-qa NPM version Build Status

Protractor QA Logo

Keeping end-to-end tests up-to-date can be really painful. Gulp Protractor QA can help us by warning whether protractor locators have their matches within a given set of AngularJS view files.

Because code changes should not break our tests!

How it works?

Video screen demo of gulp-protractor-qa in action!

Screencast

How gulp-protractor-qa works?

TL;DR: a couple of new features and fixes have been added since this screencast publication.

Install

npm install --save-dev gulp-protractor-qa

Example

var gulp = require('gulp');
var protractorQA = require('gulp-protractor-qa');

Registering the task

gulp.task('protractor-qa', function() {
   protractorQA.init({
      runOnce: true, // optional
      testSrc: 'test/e2e/**/*Spec.js',
      viewSrc: [ 'index.html', 'partials/*.html' ]
   });
});

Running it

gulp.task('default', ['protractor-qa']);

See final gulpfile.js example.

API

protractorQA(options)

options

runOnce

Type: Boolean Default: false

Optional: Set to true when you want to control yourself when to run task. In other words, it won't watch files changes.

testSrc

Type: String or Array Default: ""

Where the plugin should watch the changes in order to map all element() indexes.

viewSrc

Type: String or Array Default: ""

Where your AngularJS view files are located. Protractor QA will watch the changes in those files to verify if all element() selectors could be found.

Watched selectors by gulp-protractor-qa

Gulp-protractor-qa is currently watching the following element() locators:

Note: currently it can't find by.css() selectors with :nth-child().

Changelog

License

MIT © Ramon Victor