• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ramonvictor/gulp-protractor-qa: Warns whether Protractor locators have their mat ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ramonvictor/gulp-protractor-qa

开源软件地址(OpenSource Url):

https://github.com/ramonvictor/gulp-protractor-qa

开源编程语言(OpenSource Language):

JavaScript 93.4%

开源软件介绍(OpenSource Introduction):

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:

  • by.binding();
  • by.model();
  • by.repeater();
  • by.css();
  • by.id();
  • by.className();
  • by.name();

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

Changelog

  • 0.2.0 api completely rewritten, including:

    • Introducing runOnce feature;
    • Ignoring commented out element selectors;
    • Handle any form of denormalized directives - except ng:* due to cheerio limitation;
    • Fix a couple of bugs related to by.css old regex;
    • Add suport for more protractor locators: by.id(), by.className() and by.name().
  • 0.1.19 improve by.css regex;

  • 0.1.18 bug fix: adding support for data-* attributes;

  • 0.1.14 showing "<number> out of <total> element selectors are been watched" in the log;

  • 0.1.12 bug fix related to gaze version;

  • 0.1.10 testSrc and viewSrc now receive string or array value;

  • 0.1.07

    • Improved the error log showing in which file each wrong selector came from;
    • Improved the regex that find selectors by: by.css('[attr-name="attr-value"]');
  • 0.1.05

    • Mapping more element() selectors: by.css('[attr-name="attr-value"]') and by.binding();
    • Improve regex rules to support both: protractor.By and by.;
    • Other code improvements;
  • 0.1.0 Mapping just two element() selectors: by.model() and by.repeater().

License

MIT © Ramon Victor




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap