Giter Club home page Giter Club logo

wt-protractor-runner's Introduction

wt-protractor-runner

What's that for?

This module is here to help you with two things:

  • Run protractor from gulp with just one line of code.
  • Run a bunch or protractor instances sequentially for local cross-browser testing or using cloud platforms like Browserstack.

Run protractor

As you may know, there's already gulp-protractor that allows you to use a gulp plugin in order to run protractor. Its readme also shows how to run protractor without a gulp plugin but it needs some copy/pasting. wt-protractor-runner will help you avoid this code duplication and run your tests in few seconds.

Install wt-protractor-runner

Gulpfile.js:

 var protractorRunner = require('wt-protractor-runner');
 
 gulp.task('test-e2e', protractorRunner({
     configList: [
         {
             capabilites: {
                 browser: 'chrome'
             },
             specs: __dirname + '/test/e2e/*.js'
         }
     ]
 }));

Run:

 gulp test-e2e

Run cross-browser tests with protractor.

Just do the same as above and give multiple configurations to protractor.

 
 var protractorRunner = require('wt-protractor-runner');
 var specPattern = __dirname + '/test/e2e/*.js';
 
 gulp.task('test-e2e', protractorRunner({
     configList: [
         /* Chrome. */
         {
             capabilites: {
                 browser: 'chrome'
             },
             specs: specPattern
         },
         /* Safari on browserstack. */
         {
              capabilities: {
                  acceptSslCerts: true,
                  browserName: 'safari',
                  'browserstack.debug': true,
                  'browserstack.user': process.env.YOUR_BROWSERSTACK_USER_ENV_VAR,
                  'browserstack.key': process.env.YOUR_BROWSERSTACK_KEY_ENV_VAR,
                  os: 'OS X',
                  os_version: 'Yosemite'
              },
              seleniumAddress: 'http://hub.browserstack.com/wd/hub'
              specs: specPattern
         }
     ]
 }));

To make this more readable, you should use wt-protractor-utils.

Without gulp.

 protractorRunner({configList: ...})(callback);

wt-protractor-runner's People

Contributors

yjaaidi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.