Permalink
Browse files

selenium: adjusted/extended readme and minor fix in rakefile

Change-Id: I7896791c089fc511d6c041f9bfe764d8c0dbadc7
  • Loading branch information...
1 parent 1d8956d commit 37df957a5a710371fba03f63127caaa4c7259a00 @tobijat tobijat committed Jul 26, 2012
Showing with 29 additions and 5 deletions.
  1. +25 −2 repo/tests/selenium/README
  2. +4 −3 repo/tests/selenium/Rakefile
View
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)

0 comments on commit 37df957

Please sign in to comment.