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.
Only requires that you have Jasmine available as a route in your application for testing. Recommend using Jasminerice
Add this line to your application's Gemfile:
gem 'jasmine-selenium-sauce'
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
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
This when you want to run a Jasmine suite hosted on an internal host. It will use LocalTunnel to make your system available through a public tunnel to a specific port. Selenium is then used to connect to SauceLabs, and request a browser instance to run your suite. The tunnel is then closed down.
rake jasmine:local_sauce
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
SSH_KEY_PATH=~/home/me/id_rsa.pub
- Path to a public key to be used by LocalTunnel
JASMINE_SPEC_FORMAT=documentation
- Allows you to control the format of the RSpec report
See sauce_config.rb
This task is used when you want to run Jasmine using a local browser such as Firefox, Chrome, etc.
rake jasmine:browser
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?.
JASMINE_SPEC_FORMAT=documentation
- Allows you to control the format of the RSpec report
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request