# Cross Browser Testing with bunyip

DevFeed: [Cross Browser Testing with bunyip](<https://devfeed.tech/articles/cross-browser-testing-with-bunyip-52461.md>)

Original publisher: [Read original article](<http://www.jackfranklin.co.uk/blog/cross-browser-testing-with-bunyip/>)

Published: 2012-09-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jack Franklin](<https://devfeed.tech/sources/jack-franklin.md>)

Topics: [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Jasmine](<https://devfeed.tech/topics/jasmine.md>), [browser](<https://devfeed.tech/topics/browser.md>), [Firefox](<https://devfeed.tech/topics/firefox.md>)

Tags: [adapter](<https://devfeed.tech/tags/adapter.md>), [adapters](<https://devfeed.tech/tags/adapters.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [canary](<https://devfeed.tech/tags/canary.md>), [chrome](<https://devfeed.tech/tags/chrome.md>), [cross-browser-testing](<https://devfeed.tech/tags/cross-browser-testing.md>), [firefox](<https://devfeed.tech/tags/firefox.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [nightly](<https://devfeed.tech/tags/nightly.md>), [npm](<https://devfeed.tech/tags/npm.md>), [opera](<https://devfeed.tech/tags/opera.md>), [safari](<https://devfeed.tech/tags/safari.md>), [testing](<https://devfeed.tech/tags/testing.md>), [yui](<https://devfeed.tech/tags/yui.md>)

## AI overview

bunyip runs a test spec runner across installed local browsers through Yeti. The tutorial installs it globally with npm, points it at Jasmine's SpecRunner.html, and adds Ryan Seddon's Jasmine adapter. In execJasmine(), it checks for window.$yetify and calls BUNYIP.hookup(jasmineEnv) before executing the tests. Running `bunyip -f SpecRunner.html local` discovers available browsers, waits for them to connect, then starts testing when prompted; `-l "firefox|phantomjs"` narrows the run. The article says bunyip supports YUI Test out of the box because of Yeti, with adapters for QUnit, Mocha, and Jasmine. It also notes that a paid BrowserStack account can connect bunyip to supported devices, including IE and iOS.

## Source excerpt

Today we're going to take a look at bunyip, a tool from Ryan Seddon to make running your test specs in multiple browsers really easy. Out of the box, bunyip only supports the YUI Test framework (this is due to the fact that Yeti, the tool bunyip uses, only supports YUI) but Ryan has written adapters for QUnit, Mocha and Jasmine. In this tutorial I'll take some Jasmine specs and run them through bunyip, using Ryan's Jasmine adapter. The specs are going to be from my Testing With CoffeeScript ebook, which is free and if you haven't checked it out yet, I'd love it if you could give it a read and let me know your thoughts. bunyip is easily installed through npm, as a global module: npm install -g bunyip To run bunyip locally, simply run: bunyip -f yourspecs.html local The file you point bunyip to should be your spec runner, so for Jasmine users it's the SpecRunner.html file. The local option tells bunyip to run local browsers. It's pretty smart about how it does this, and will look for the following browsers: Firefox and FF Nightly Chrome and Canary Opera and Opera Next Safari PhantomJS Before we run bunyip, lets use Ryan's Jasmine adapter for Yeti, which is what bunyip uses to run the tests. In the top of the spec runner file, just below the line that sources Jasmine, add in a line below to include the Jasmine adapter, which you can find here. I'd recommend downloading it and putting it into the same folder as the Jasmine source. If you take a look at your SpecRunner.html, you'll see this section of JavaScript that runs the tests: (function() { var jasmineEnv = jasmine.getEnv(); jasmineEnv.updateInterval = 1000; var htmlReporter = new jasmine.HtmlReporter(); jasmineEnv.addReporter(htmlReporter); jasmineEnv.specFilter = function(spec) { return htmlReporter.specFilter(spec); }; var currentWindowOnload = window.onload; window.onload = function() { if (currentWindowOnload) { currentWindowOnload(); } execJasmine(); }; function execJasmine() { jasmineEnv.execute(); } })(); A