npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-protractor-webdriver

v0.2.5

Published

grunt plugin for starting Protractor's bundled Selenium Webdriver

Downloads

11,547

Readme

grunt-protractor-webdriver devDependency Status NPM version Built with Grunt

grunt plugin for starting Protractor's bundled Selenium WebDriver

Npm Downloads

This Grunt task starts a Selenium WebDriver, blocks until it's ready to accept connections, and then leaves it running in the background until the Grunt process finished. During startup it checks for already running WebDriver instances and at the end of the Grunt process also shuts down the Selenium server to not leave you with any zombies.

grunt-protractor-webdriver is capable to handle parallelized tasks in case you use helpers like grunt-concurrent. That way you are able to work around the missing feature in Protractor that it's currently not able to run the tests against multiple browsers in parallel. See the Gruntfile.js for an example on how to do that.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-protractor-webdriver --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-protractor-webdriver');

The "protractor_webdriver" task

Overview

In your project's Gruntfile, add a section named protractor_webdriver to the data object passed into grunt.initConfig().

grunt.initConfig({
  protractor_webdriver: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Options

options.command

Type: String Default value: webdriver-manager start

Customize the way how the Selenium WebDriver is started. By default it assumes the presence of the webdriver-manager script (which comes bundled with Protractor) on the PATH.

options.path

Type: String Default value: ``

Customize the path to the actual command that starts the the Selenium WebDriver. By default it assumes the presence of your script on the PATH.

options.keepAlive

Type: Boolean Default value: false

Whether or not to keep the Selenium server process alive when no more browser session are connected.

Usage Examples

grunt.initConfig({
  protractor_webdriver: {
    your_target: {
      options: {
        path: '/path/to/',
        command: 'custom-webdriver-manager start',
      },
    },
  },
});

Debugging

By default the output of the Selenium WebDriver is not being piped to the console by the protractor_webdriver task. In case you need detailed information about its state, just run your Grunt tasks with the --verbose flag.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • v0.2.5 - Add support for Selenium Server >=v2.47. Fix for issues #17, #18 and #20.
  • v0.2.0 - Possible breaking change for some, depending on the path configuration. Fix for issue #3. Always use node now to execute the webdriver_manager commands.
  • v0.1.9 - Use configuration option keepAlive also in case of exception being thrown by the Selenium process. Alternative implementation for original PR #5.
  • v0.1.8 - Add support for new configuration option keepAlive.
  • v0.1.7 - Fix for issue #1. Print out a warning if Selenium server is not present. Additionally stop Selenium server gracefully on clean Grunt process shutdown.
  • v0.1.6 - No code changes. Updated test showcase to use Protractor v.20.1.
  • v0.1.5 - Unpublished due to wrong dependencies settings.
  • v0.1.4 - No code changes. Just had to push new release as v0.1.3 seems to be lost in the NPM repo...
  • v0.1.3 - Fix regression of v0.1.2 with wrong Selenium server path being used. Add additional exit handlers for .on('error'), .on('uncaughtException') and .on('SIGINT').
  • v0.1.2 - Harden waiting for all browser sessions to be deleted before shutdown. Due to possible race-conditions with log statements for multiple browser sessions in one line, the session counter didn't work properly.
  • v0.1.1 - Ensure waiting for eventual Selenium is already running message on failure. Ensure waiting for all browser sessions to be deleted before shutdown.
  • v0.1.0 - Initial commit.

License

Copyright (c) 2014 Steffen Eckardt. Licensed under the MIT license.