ref: refs/heads/master
commit 54e11ae90770525f3864ea331397cf4b8ca0d3d7
Author: Ladislav Slezak
Date: Wed Jul 15 12:52:17 2009 +0200
test:ui rake task - moved selenium-client check
Display the error about missing selenium-client gem only when running
test:ui task, e.g. 'rake -T' or other tasks must not print this error
---
webclient/lib/tasks/selenium.rake | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/webclient/lib/tasks/selenium.rake b/webclient/lib/tasks/selenium.rake
index 1dde49a..46a6036 100644
--- a/webclient/lib/tasks/selenium.rake
+++ b/webclient/lib/tasks/selenium.rake
@@ -19,25 +19,31 @@ begin
rc.port = 4444
rc.timeout_in_seconds = 3 * 60
end
+rescue LoadError => e
+ selenium_missing = true
+end
- namespace :test do
- # define test:ui:check task
- Rake::TestTask.new(:"ui:check") do |t|
- t.libs << "test"
- t.pattern = 'test/ui/**/*_test.rb'
- t.verbose = true
- end
+namespace :test do
+ # define test:ui:check task
+ Rake::TestTask.new(:"ui:check") do |t|
+ t.libs << "test"
+ t.pattern = 'test/ui/**/*_test.rb'
+ t.verbose = true
+ end
- Rake::Task['test:ui:check'].comment = "Note: Selenium Server must be running"
+ Rake::Task['test:ui:check'].comment = "Note: Selenium Server must be running"
- # define test:ui task - start/shut down Selenium server component automatically
- desc 'Run UI tests using Selenium testing framework'
+ # define test:ui task - start/shut down Selenium server component automatically
+ desc 'Run UI tests using Selenium testing framework'
+ if selenium_missing
+ task :ui do
+ $stderr.puts "ERROR: 'selenium-client' gem is missing, UI testing task (test:ui)"
+ $stderr.puts " cannot be started. Install 'selenium-client' Ruby gem first."
+ exit 1
+ end
+ else
task :ui => [:"selenium:rc:start", :"test:ui:check", :"selenium:rc:stop"]
end
-
-rescue LoadError => e
- $stderr.puts "WARNING: 'selenium-client' gem is missing, UI testing task (test:ui)"
- $stderr.puts " will be missing. Install 'selenium-client' Ruby gem."
end
# vim: ft=ruby
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org