Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rake'
- require 'rake/testtask'
- require 'json'
- require 'yaml'
- require 'nokogiri'
- require 'rest_client'
- SAUCE_USER = 'qateam_rentpath'
- SAUCE_PLATFORM = 'win7_chrome45'
- HOST_ENV = 'rent_qa'
- # usage: rake test # run all tests sequentially
- # rake test['-n test_home_start'] # run an individual test once
- # rake test['-n test_home_start',10] # run certain tests for 10 times
- # rake test['-t critical_path'] # first argument accepts any test options you normally would use
- desc 'Run all tests sequentially against Rent QA on Saucelabs'
- task :test, [:test_option, :runs] do |t, args|
- args.with_defaults(runs: 1)
- args[:runs].to_i.times do |i|
- run_count_msg = "Running #{i + 1} of #{args[:runs]} runs"
- puts run_count_msg
- begin
- sh "bundle exec mini_autobot -c saucelabs:#{SAUCE_USER}:#{SAUCE_PLATFORM} -e #{HOST_ENV} #{args[:test_option]}"
- rescue
- puts "Failed at #{run_count_msg}"
- end
- end
- end
- # Not sure about this just yet, need to leave it in for continuity for now
- =begin
- begin
- require 'rspec/core/rake_task'
- RSpec::Core::RakeTask.new(:spec) { |r| r.verbose = false }
- task :default => :spec
- rescue LoadError
- puts '==> no rspec available'
- end
- =end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement