Automated JavaScript Testing with BrowserSwarm

Share this article

There are developers who write code which is so perfect they never need test it. They’re usually the same ones who refuse to add comments, use source control or discuss their techniques with fellow colleagues. For the rest of us, testing is essential — but mind-numbingly tedious. Web developers also have the onerous task of deploying their code in a multitude of web browsers on different PCs and OSs.

Fortunately, BrowserSwarm is a new cloud-based system which makes JavaScript testing a little more bearable. The steps are reassuringly simple:

  1. Sign-up for an account at BrowserSwarm.
  2. Add your project. You can automatically link with GitHub or add your own repositories.
  3. Configure your unit tests using tools such as QUnit.
  4. View or download the test results generated for multiple browsers; typically a few recent editions of Firefox, Chrome, Safari and Opera and IE6 to IE10. Those with a SauceLabs account can also test a wider variety of desktop, tablet and mobile browsers on other devices.

An example set of test results for Backbone.js:

BrowserSwarm test

A more detailed error report can be viewed for any test job:

BrowserSwarm test details

You can find tests for other popular libraries including jQuery, jQuery UI, Dojo, MooTools, Prototype and more.

The service is fast, easy to use and removes much of the testing burden we encounter every day. BrowserSwarm is also an open source project; you can contribute other repositories, frameworks, unit tests or any other feature you desire.

Oh yes, I neglected to mention that BrowserSwarm is free!

Who’s responsible for this amazing open source tool? Microsoft. Yes, you read that correctly. The service is a collaboration between Microsoft, AppendTo and SauceLabs to compliment the browser testing facilities already available at modern.IE.

BrowserSwarm is currently in beta and possibly requires a little more help and documentation, but it’s set to make our development lives considerably easier.

Craig BucklerCraig Buckler
View Author

Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler.

Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week