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 🙏

© 2026 – Pkg Stats / Ryan Hefner

brewie

v1.0.38

Published

Run mocha tests using Selenium.

Downloads

144

Readme

brewie

###Description

brewie makes writing tests with wd.js and Selenium easy. We take care of all the setup that you need, using per environment configuration files, mixins, and easy multiple browser testing to make writing integration tests as effortless as possible.

###Installation

To install brewie, we recommend using npm and installing it globally

npm install brewie -g

If you are going to use configuration constants in any of your tests you will also want to install config[1]

npm install config

###Configuration

####Structure

In a typical setup, you will want to create a folder to house your tests. The simplest way it to create a Tests folder at the root of your project. In that folder you will want a folder for config,mixins, and test.

Check the example project under /examples for a demonstration of how it should look.

####Configuration Files

You will want to add a default configuration file, appropriately named default.js as well as a configuration file for each environment you plan to support. You might setup your development environment to run against a local instance of Selenium, while having the production instance target SauceLabs, for instance.

The default.js file should contain any configuration that you will need regardless of environment. This could be constants you want to access in your tests, or really anything you could need.

#####Browsers

As part of the evironment configuration, you can specify which browsers you want to test against.

browsers: [
  {
    browserName: 'chrome',
    tag: '1',
    name: 'modern.ie development test'
  },
  {
    browserName: 'firefox',
    tag: '2',
    name: 'modern.ie development test'
  }
]

This example illustrates running tests on a local Selenium environment. If you were running against SauceLabs, there are additional properties you can assign to specify browser version, platform, and any other SauceLabs supported data

{
  browserName: 'chrome',
  platform: 'Windows 8',
  version: '27',
  'selenium-version': '2.35.0',
  name: 'modern.ie production test'
}

####Mixins

Any mixins you add will be added to the global browser object so you can easily access them when running your tests. Be mindful that brewie uses wd.js' promise implementation heavily and your mixins should support this if you want to chain them.

###Usage

####Installing Selenium and the web drivers

  1. Install any browser versions you'd like to test in locally.

  2. Install java if it is not already installed.

  1. Download the latest version of Selenium server - http://docs.seleniumhq.org/download/

  2. Download drivers for any browsers you'd like to support (Firefox is supported natively, without a driver).

####Starting the Selenium server

Open a Terminal window or Command Prompt (Windows) and type in one of the examples below. Be sure to replace the path with the path to your Selenium server file and drivers in the examples below. If java is not available, you might need to install it or include it in your system path.

Example of starting a Selenium server instance. By default this only supports Firefox.

java -jar /path/to/your/selenium-server-standalone-2.3X.0.jar -p 4444

Example of starting a Selenium server instance that supports Firefox, IE and Chrome in Windows

java -jar /path/to/your/selenium-server-standalone-2.3X.0.jar -p 4444 -Dwebdriver.ie.driver=/path/to/IEDriverServer.exe -Dwebdriver.chrome.driver=/path/to/chromedriver.exe

Example of starting a Selenium server instance that supports Firefox and Chrome in OSX

java -jar /path/to/your/selenium-server-standalone-2.3X.0.jar -p 4444 -Dwebdriver.chrome.driver=/path/to/chromedriver

####Running Brewie

The brewie commandline tool comes with several options that you can view by running

brewie -h

You can simply run brewie, using the defaults, and it will run your tests as long as your files are all in the correct place. Otherwise, you will need to specify where your tests are, where your mixins file is, and any other configuration you may need to change.

Example

brewie -R spec -T test/ -m mixins/mixins.js

###Building

brewie uses TypeScript for much of its source, so if you are building brewie, there is a provided grunt task that will compile the TypeScript as well as run JSHint on all the files.