Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
selenium: adjusted/extended readme and minor fix in rakefile
Browse files Browse the repository at this point in the history
Change-Id: I7896791c089fc511d6c041f9bfe764d8c0dbadc7
  • Loading branch information
tobijat committed Jul 26, 2012
1 parent 1d8956d commit 37df957
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
27 changes: 25 additions & 2 deletions repo/tests/selenium/README
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ set configuration parameters to your needs before running the tests!
== Running the tests on your local machine ==

* In configuration.yml set the WIKI_URL to point to your local MW instance you want to test
* From your command line, run rake[browser] in the selenium directory
(where "browser" specifies the browser you want to use for the tests, e.g. "firefox" || "chrome" || "ie")
* From your command line, run "rake run_tests[<taskname>,<browser>]" in the selenium directory,
whereas <taskname> specifies the task to run, e.g. default (for all tests) or "label" for just the label tests,
and <browser> specifies the browser you want to use for the tests, e.g. "firefox" || "chrome" || "ie".
* Firefox (if installed) should work out of the box.
For other browsers you should check the corresponding Webdriver on
http://code.google.com/p/selenium/w/list
Expand All @@ -33,3 +34,25 @@ set configuration parameters to your needs before running the tests!
* Set REMOTE_SELENIUM_HUB to point to the Selenium Hub instance
* From your command line, run rake[browser,remote] in the selnium directory
(where "browser" specifies the browser you want to use for the tests, e.g. "firefox")

== EXAMPLE RUNS ==

rake
rake run_tests
rake run_tests[all]
this will run all tests locally in the browser you specified in configuration.yml as DEFAULT_BROWSER

rake run_tests[all,chrome]
this will run all tests locally in chrome

rake run_tests[label,firefox]
this will run the label tests locally in firefox

rake run_tests[all,firefox,remote]
this will run all tests on remote selenium grid hub in firefox

rake run_tests[description,chrome,remote,linux]
this will run the description tests on a remote linux box (if available) in chrome

rake run_tests[all,ie,remote,linux]
this will run all tests on a remote windows box (if available) in internet explorer
7 changes: 4 additions & 3 deletions repo/tests/selenium/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require 'rubygems'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec) do |spec|
RSpec::Core::RakeTask.new(:all) do |spec|
spec.ruby_opts = "-I lib:spec"
spec.pattern = 'spec/*/*_spec.rb'
end
Expand Down Expand Up @@ -98,7 +98,7 @@ RSpec::Core::RakeTask.new(:spec_editonoff) do |spec|
spec.pattern = 'spec/item/editonoff_spec.rb'
end

task :default => :spec
task :default => :run_tests
task :item => :spec_item
task :nonexistingitem => :spec_non_existing_item
task :description => :spec_description
Expand All @@ -118,8 +118,9 @@ task :editonoff => :spec_editonoff
task :bugs => :spec_bugs

task :run_tests, :taskname, :browser, :remote, :os do |t, args|
task = args[:taskname] || :all
setup_env(args[:browser], args[:remote], args[:os])
Rake::Task[args[:taskname]].invoke
Rake::Task[task].invoke
end

def setup_env(browser, remote, os)
Expand Down

0 comments on commit 37df957

Please sign in to comment.