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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cucumberjs-chromedriver

v0.3.1

Published

integrating chromedriver with cucumberjs so you don't have to

Readme

cucumberjs-chromedriver

Making local BDD easier.

Getting started

npm install cucumberjs -g
npm install cucumberjs-chromedriver --save-dev

create a feature ./example.feature

Feature: Example feature
  As a user of cucumber.js
  I want to have documentation on cucumber
  So that I can concentrate on building awesome applications

  Scenario: Reading documentation
    When I am on the Cucumber.js GitHub repository
    Then I should see "cucumber" in the page title

create a world file ./local-world.js

module.exports = require('cucumberjs-chromedriver');

this injects cucumberjs-chromedriver into the necessary hooks to start and stop the chromedriver. See Api for more advanced topics.

create a step file ./example.steps.js

var chai = require("chai"),
    chaiAsPromised = require('chai-as-promised');

chai.should();

chai.use(chaiAsPromised);

module.exports = function () {
    this.When(/^I am on the Cucumber.js GitHub repository$/, function () {
        return this.browser.get('./');
    });

    this.Then(/^I should see "(.*)" in the page title$/, function (title) {
        return this.browser.title().should.eventually.contain(title);
  });
};

notice this is requiring more npm installs (but you don't have to use chai if you don't want to)

npm install chai --save-dev
npm install chai-as-promised --save-dev

And run your tests...

cucumberjs example.feature -r local-world.js -r example.steps.js --contentPath=http://github.com/cucumber/cucumber-js/

cucumberjs has conventions so you don't have to be so explicity, but I find them to confuse more than help...

Api

What is injected into the World?

| property | description | |--------|--------| | browser | this is a browser instance from wd.js | | browser.pause() | returns a promise that will never resolve. This makes it easy to stop a test at a certain point in the workflow to manually inspect in the chromedriver browser. Ctr+C to kill the process. | | browser.SPECIAL_KEYS | wd Special Keys so you don't need to require wd just for the keys|

How do I debug what webdriver is doing?

Pass debug through the CLI --debug when starting cucumberjs and it will output webdriver debugging.

How do I extend the world?

module.exports = function(){
	// you can pass `contentPath` or `debug` through here instead of the CLI if you want
    require('cucumberjs-chromedriver').call(this, { contentPath : 'http://localhost:8001' });

	// cache the World factory provided by `cucumberjs-chromedriver`
	var chromeDriverWorldFactory = this.World;
    // create a new WorldFactory
     this.World = function(callback){
     	// now you can do stuff before
         chromeDriverWorldFactory(function(theirWorld){
	         // or after, like extending the world
             var myWorld = Object.create(theirWorld);
             myWorld.jon = 'hoguet';
             // finally pass the world to the callback (which becomes the `this` for all scenarios)
             callback(myWorld);
         });
     };
};

Running Locally

npm install
npm test