Build Status

Jasmine::Sauce::Ci

Rake tasks for running your Jasmine suite via a local browser or through SauceLabs using the Selenium Webdriver.

Can be used in your CI builds to enable running Jasmine suites. The Jasmine results are reported using RSpec to make parsing easy.

Installation

Add this line to your application's Gemfile:

gem 'jasmine-selenium-sauce'

Running Jasmine via SauceLabs

Remote Jasmine Server

When you want to run a Jasmine suite hosted on a publicly available host. Uses Selenium to connect to SauceLabs, and requests a browser instance to run your suite.

rake jasmine:sauce

Required Environment Variables

Requires the following environment variables to be set:

SAUCELABS_URL=http://username:[email protected]:80/wd/hub
  • URL for Saucelabs with your credentials included
JASMINE_URL=http://my.server.com/jasmine
  • Where your Jasmine tests are hosted
SAUCE_BROWSER=chrome
  • Which browser SauceLabs should use to run your tests

Local Jasmine Server behind a Firewall

When you want to run a Jasmine suite hosted on an internal host. Uses LocalTunnel to make localhost available through a tunnel. It then uses Selenium to connect to SauceLabs, and requests a browser instance to run your suite.

rake jasmine:local_sauce

Required Environment Variables

Requires the following environment variables to be set:

SAUCELABS_URL=http://username:[email protected]:80/wd/hub
  • URL for Saucelabs with your credentials included
JASMINE_PORT=3000
  • Port on localhost where jasmine tests are located
SAUCE_BROWSER=chrome
  • Which browser SauceLabs should use to run your tests

Optional Configuration

RSpec

JASMINE_SPEC_FORMAT=documentation
  • Allows you to control the format of the RSpec report

Additional Sauce Labs Configuration

See sauce_config.rb

Running Jasmine via local browser

rake jasmine:browser

Required Environment Variables

Requires the following environment variables to be set:

JASMINE_URL=http://my.server.com/jasmine
  • Where your Jasmine tests are hosted
LOCAL_BROWSER=firefox
  • Which browser that will be used to run your tests. Selenium may require a driver be installed depending the driver. See the Selenium documentation for more details See Which browsers does WebDriver support?.

Optional Configuration

RSpec

JASMINE_SPEC_FORMAT=documentation
  • Allows you to control the format of the RSpec report

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request