• Stars
    star
    383
  • Rank 108,401 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 12 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automate client-side unit testing in real browsers using the CLI

bunyip

Automate client-side unit testing in real browsers using the CLI

Getting Started

Install the module with: npm install -g bunyip. This is a CLI tool so it needs to be globally installed.

BrowserStack account

In order for bunyip to flex its real muscle I recommend you get a paid BrowserStack account as all paid accounts have access to their API. Without the API you'll need to connect your own slave browsers to bunyip.

localhost sharing service

If you wish to test on devices that are not part of your local network you'll be required to setup a tunneling service. I recommend pagekite as it gives you a nice free chunk of data and allows you to specify a reusable subdomain. Showoff.io is another good option.

Setup the config.js file

If you don't wish to use BrowserStack or a localhost sharing service you can skip this step.

To generate a config file you can run this command:

bunyip config path/to/config.js

This will take you through a multistep process to setup your username, password, tunnel url and tunnel command.

So I if wanted to save a config file to my home directory I would do the following.

bunyip config ~/config.js

Specify config file to use

If I want to specify a specific config file to use the -c, --cdir flag lets you do that.

bunyip -f test/tests.html -c path/to/config.js

If you do not specify a config file to use it will look in your current working directory for a file name config.js otherwise it will not require one in.

Test suite adaptors

Behind the scenes bunyip uses a tool called Yeti. Yeti 0.2.14+ works with YUI Test, QUnit, Mocha, Jasmine or DOH. If you use another client-side test suite, you'll have to write an adaptor - please feel free to contribute it to my yeti-adaptors repo, or file an issue/PR with Yeti itself.

Examples

bunyip -f index.html

The above command will launch a simple Yeti hub on port 9000 and use the index.html inside your current working directory.

bunyip -f index.html -p 1337

This will change the port that is used. The global config value will be updated for you so don't worry.

Locally installed browsers

Using the local command you can now open your test suite in all locally installed browsers or specify a series of browsers

bunyip -f index.html local

This will open in all locally installed browsers with one assumption that phantomjs is installed in /usr/bin/.

bunyip -f index.html local -l "firefox|chrome|safari|phantomjs"

This will open the installed versions of Firefox, Chrome, Safari and Phantomjs.

The local command looks for the following browsers:

  • Firefox, Firefox Aurora, Firefox Nightly
  • Chrome, Chrome Canary
  • Opera, Opera Next
  • Safari
  • Phantomjs

BrowserStack workers

bunyip -f index.html -b ios

Assuming you have a BrowserStack paid account and have setup a localhost sharing service the -b ios will send off a command to launch all iOS devices (3 iPhones and 3 iPads) on BrowserStack and once they're connected you can run your test suite.

bunyip -s

This will query the BrowserStack API for any device or browsers that are currently running on your account.

bunyip -k <id> or all

If you no longer need a specific worker or you wish to destroy all of them you can either specify a single worker id or all and it will destroy said worker(s).

bunyip -h

For more info specify the help flag to get more info about each command flag available.

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

  • 25/10/2012 - v0.2.2 - Fixes incompatibility with latest yeti release.
  • 20/08/2012 - v0.2.0 - Added a local command to run your test suite in locally installed browsers.
  • 15/07/2012 - v0.1.3 - Added ability to generate config file and to specify location of config file to use.

License

Copyright (c) 2012 Ryan Seddon Licensed under the MIT license.

More Repositories

1

react-frame-component

Render your React app to an iFrame
JavaScript
1,690
star
2

H5F

Deprecated, please use hyperform instead https://github.com/hyperform/hyperform
JavaScript
743
star
3

source-map

This is an unconnected fork of Mozilla's source-map library
JavaScript
224
star
4

60fps-scroll

Deprecated - A little library that *could* make your site scroll faster
JavaScript
213
star
5

redux-debounced

Debounce middleware for Redux
JavaScript
166
star
6

slideshowbob

The evil, fumbling, JavaScript free, slide thingy
CSS
98
star
7

ScrollListView

Performant list view that re-uses cells to display large data sets
JavaScript
80
star
8

font-dragr

Drag and drop font testing
HTML
67
star
9

gulp-es6-module-transpiler

JavaScript
61
star
10

bootleg

Bootleg: Dodgy JavaScript free bootstrap plugins
HTML
60
star
11

earthin24

Source code for my twitter bot https://twitter.com/earthin24
Go
22
star
12

yeti-adaptors

Use Yeti with other client-side testing frameworks
JavaScript
18
star
13

sourcemap-onerror

Lookup original location from window.onerror by querying source map
JavaScript
18
star
14

web-components

A talk about web components. What they are and what they offer.
CSS
17
star
15

BrowserSocket

Create a socket server in the browser
JavaScript
15
star
16

sunrise-lifx

Simulate a sunrise effect using the Lifx ruby gem
Ruby
15
star
17

markdown-component

A Web Component to parse markdown to html
14
star
18

picture-component

<x-picture> element for responsive images
6
star
19

SUX

SUX.js a little JavaScript helper to expand short URLs
JavaScript
6
star
20

spaces-talk

Super serious talk on why spaces are the best and you're an idiot if you use tabs
JavaScript
6
star
21

FSA

JavaScript library to give you some helper methods to read and write files or directories using the new File API: Directories and System API
JavaScript
5
star
22

jemena-powershop

Jemena + powershop = almost realtime total power usage
JavaScript
4
star
23

solar-dashboard

A solar dashboard for the Adafruit MagTag
Python
4
star
24

slideshow-component

Every developer who does a talk on Web Components inevitably creates a slideshow component
4
star
25

flexbox-wds13

Flexbox talk for Web Diretions South 2013
JavaScript
3
star
26

travis-ci-templates

A series of templates to get you started with travis-ci integration in your repo
JavaScript
3
star
27

webcomponents-talk

The Composable Web with Web Components
CSS
2
star
28

es6-module-macro

ES6 Module macro that expands to commonjs
JavaScript
1
star
29

css-switch

A simple recreation of the iOS toggle switch using CSS
CSS
1
star
30

layouts

Demo jekyll templates for my projects
1
star
31

webpack-talk

A short look at webpack a module bundler for building web applications
CSS
1
star
32

dumplingsjs.com

Dumplings and JavaScript
1
star
33

bespoke-dir

Add a class to the slide parent element to let you know which direction the slides are going
JavaScript
1
star
34

source-map-workflows

A collection of workflows for client side apps that involve creating source maps
1
star