Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. require 'rake'
  2. require 'rake/testtask'
  3. require 'json'
  4. require 'yaml'
  5. require 'nokogiri'
  6. require 'rest_client'
  7.  
  8. SAUCE_USER = 'qateam_rentpath'
  9. SAUCE_PLATFORM = 'win7_chrome45'
  10. HOST_ENV = 'rent_qa'
  11.  
  12. # usage: rake test # run all tests sequentially
  13. # rake test['-n test_home_start'] # run an individual test once
  14. # rake test['-n test_home_start',10] # run certain tests for 10 times
  15. # rake test['-t critical_path'] # first argument accepts any test options you normally would use
  16. desc 'Run all tests sequentially against Rent QA on Saucelabs'
  17. task :test, [:test_option, :runs] do |t, args|
  18. args.with_defaults(runs: 1)
  19. args[:runs].to_i.times do |i|
  20. run_count_msg = "Running #{i + 1} of #{args[:runs]} runs"
  21. puts run_count_msg
  22. begin
  23. sh "bundle exec mini_autobot -c saucelabs:#{SAUCE_USER}:#{SAUCE_PLATFORM} -e #{HOST_ENV} #{args[:test_option]}"
  24. rescue
  25. puts "Failed at #{run_count_msg}"
  26. end
  27. end
  28. end
  29.  
  30.  
  31. # Not sure about this just yet, need to leave it in for continuity for now
  32. =begin
  33. begin
  34. require 'rspec/core/rake_task'
  35. RSpec::Core::RakeTask.new(:spec) { |r| r.verbose = false }
  36.  
  37. task :default => :spec
  38. rescue LoadError
  39. puts '==> no rspec available'
  40. end
  41. =end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement