From 10fecaca38e917b4bd6701e69ed895e3da25b01f Mon Sep 17 00:00:00 2001 From: Eric Allen Date: Sat, 10 Apr 2010 15:22:22 -0400 Subject: [PATCH] Fix failing note deletion tests Text will remain present because the raw source isn't generated from the modified DOM. Also, there were some hard-coded id's in there that have changed. All Cucumber Selenium tests are now passing. --- features/step_definitions/note_steps.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/features/step_definitions/note_steps.rb b/features/step_definitions/note_steps.rb index 93fab0f6..630f974d 100644 --- a/features/step_definitions/note_steps.rb +++ b/features/step_definitions/note_steps.rb @@ -26,8 +26,10 @@ When /^I add note "([^\"]*)" from the "([^\"]*)" project page$/ do |note, projec end When /^I delete the first note$/ do + title = selenium.get_text("css=div.container h2") + id = title.split(' ').last click_link "delete note" - selenium.get_confirmation.should == "Are you sure that you want to delete the note '1'?" + selenium.get_confirmation.should == "Are you sure that you want to delete the note '#{id}'?" end When /^I click the icon next to the note$/ do @@ -53,8 +55,11 @@ Then /^I should see note "([^\"]*)" on the notes page$/ do |note| end Then /^the first note should disappear$/ do - # the first note contains "A note 1", generated by the Given def above - Then "I should not see \"A note 1\"" + title = selenium.get_text("css=div.container h2") + id = title.split(' ').last + wait_for :timeout => 15 do + !selenium.is_visible("note_#{id}") + end end