Giter Club home page Giter Club logo

browserstack-runner's Introduction

A command line interface to run browser tests over BrowserStack.

Install

Go to the browserstack-runner directory.
Install browserstack-runner

npm -g install

or

For development,

npm link

Configuration

To run browser tests on BrowserStack infrastructure, you need to create a browserstack.json file in project's root directory (the directory from which tests are run), by running this command:

browserstack-runner init [preset]

If nothing is provided as preset default is used.

Currently only one preset is present: default

Parameters

  • username: BrowserStack username (Alternatively: use BROWSERSTACK_UESRNAME environment variable)

  • key: BrowserStack key (Alternatively: use BROWSERSTACK_KEY environment variable)

  • test_path: Path to the which will execute the tests when opened in a browser.

  • test_framework: Specify test framework which will execute the tests. We support qunit, jasmine and mocha.

  • browsers: A list of browsers on which tests are to be run.

A sample configuration file:

{
  "username": "<username>",
  "key": "<key>",
  "test_path": "relative/path/to/test/page",
  "test_framework": "qunit/jasmine/mocha",
  "browsers":   [{
    "browser": "firefox",
    "browser_version": "15.0",
    "device": null,
    "os": "OS X",
    "os_version": "Snow Leopard"
  },
  {
    "browser": "firefox",
    "browser_version": "16.0",
    "device": null,
    "os": "Windows",
    "os_version": "7"
  },
  {
    "browser": "firefox",
    "browser_version": "17.0",
    "device": null,
    "os": "Windows",
    "os_version": "8"
  },
  {
    "browser": "ie",
    "browser_version": "8.0",
    "device": null,
    "os": "Windows",
    "os_version": "7"
  },
  {
    "browser": "ie",
    "browser_version": "9.0",
    "device": null,
    "os": "Windows",
    "os_version": "7"
  },
  {
    "browser": "ie",
    "browser_version": "10.0",
    "device": null,
    "os": "Windows",
    "os_version": "8"
  }]
}

Secure Information

To prevent checking in the BrowserStack username and key in your source control, the corresponding environment variables can be used.

The environment variables then can be safely provided in the build configuration. For example, with travis-ci you can follow:

http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables

Running tests

Run browserstack-runner to run the tests on all the browsers mentioned in the configuration.

You can include this in your test script to automatically run cross browser tests on every build.

browserstack-runner's People

Contributors

crodjer avatar nakula avatar cvrebert avatar

Watchers

Piyush Ranjan avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.