Browse files

fixed notices spec with RWebSpec extension syntax

  • Loading branch information...
1 parent 63d8406 commit 3474b5d38cfcc846fe9090209ee35c7f6571b8c5 Zhimin Zhan committed Dec 9, 2012
Showing with 18 additions and 8 deletions.
  1. +1 −1 rwebspec/event_test.rb
  2. +13 −3 selenium-webdriver-rspec/Rakefile
  3. +4 −4 selenium-webdriver-rspec/notices_spec.rb
View
2 rwebspec/event_test.rb
@@ -22,7 +22,7 @@
end
# Press key Ctrl+Shift+T, then enter 123 quickly navigate you here
- story "[487] Can create a new event" do
+ story "[123] Can create a new event" do
event_list_page = expect_page EventListPage
event_page = event_list_page.click_new
event_page.enter_name("ABA Workshop")
View
16 selenium-webdriver-rspec/Rakefile
@@ -48,10 +48,20 @@ end
desc "run selected quick tests"
RSpec::Core::RakeTask.new("test:ui:quick") do |t|
+ puts "XXXXX 1"
quick_specs = ["membership_test.rb", "event_test.rb"]
- ordered_specs = buildwise_ui_test_order(BUILDWISE_PROJECT_IDENTIFIER)
- puts "XXX: #{ordered_specs.inspect}"
- specs_to_be_executed = ordered_specs & quick_specs
+ begin
+ ordered_specs = buildwise_ui_test_order(BUILDWISE_PROJECT_IDENTIFIER)
+ rescue => e
+ # test order not defined
+ ordered_specs = []
+ ensure
+ ordered_specs ||= []
+ end
+ puts "XXXXX 2"
+ # puts "XXX: #{ordered_specs.inspect}"
+ specs_to_be_executed = (ordered_specs + quick_specs).flatten.uniq
+ puts "XXXXX 3 => #{specs_to_be_executed}"
specs_to_be_executed = specs_to_be_executed.collect { |x| "#{$test_dir}/#{x}" } rescue nil
t.pattern = [specs_to_be_executed]
end
View
8 selenium-webdriver-rspec/notices_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
load File.dirname(__FILE__) + '/test_helper.rb'
-specification "Notices" do
+describe "Notices" do
include TestHelper
before(:all) do
@@ -20,7 +20,7 @@
failsafe{ logout } unless debugging?
end
- story "Admin can create a new active notice and display" do
+ it "Admin can create a new active notice and display" do
login_as("admin")
@browser.find_element(:link_text, "Administration").click
@browser.find_element(:link_text, "Notices").click
@@ -53,7 +53,7 @@
@browser.page_source.should_not include("Evacuate in 10 minutes")
end
- story "Admin can create one future notice then change to now" do
+ it "Admin can create one future notice then change to now" do
visit "/"
login_as("admin")
@browser.find_element(:link_text, "Notices").click
@@ -89,7 +89,7 @@
@browser.page_source.should include("Evacuate in 20 minutes")
end
- story "Only Admin User can publish notices" do
+ it "Only Admin User can publish notices" do
login_as("bob")
visit("/notices")
@browser.page_source.should include("Only admin user can preform")

0 comments on commit 3474b5d

Please sign in to comment.