Commit ab5acdb4bc47ba0bf39437a3d768024d0e116d2e

Authored by Antonio Terceiro
1 parent 1a6a459a

Solving DB timeout problem que Selenium and SQLite

It seems that the problem happens when selenium steps run before
non-selenium steps (e.g. settind up data for the test). Doing this also
seems to remove the need for the sleeps added to avoid the timeout.
features/comment.feature
... ... @@ -40,15 +40,14 @@ Feature: comment
40 40  
41 41 @selenium
42 42 Scenario: redirect to right place after comment a picture
43   - Given I am logged in as "booking"
44   - And the following files
  43 + Given the following files
45 44 | owner | file | mime |
46 45 | booking | rails.png | image/png |
  46 + Given I am logged in as "booking"
47 47 And I am on /booking/rails.png?view=true
48 48 And I fill in "Title" with "Hey ho, let's go!"
49 49 And I fill in "Enter your comment" with "Hey ho, let's go!"
50 50 When I press "Post comment"
51   - And I wait 2 seconds
52 51 Then I should be exactly on /booking/rails.png?view=true
53 52  
54 53 @selenium
... ... @@ -56,6 +55,5 @@ Feature: comment
56 55 Given I am logged in as "booking"
57 56 And I am on /booking/article-to-comment
58 57 When I press "Post comment"
59   - And I wait 2 seconds
60 58 Then I should see "Title can't be blank"
61 59 And I should see "Body can't be blank"
... ...
features/step_definitions/custom_webrat_steps.rb
... ... @@ -6,10 +6,6 @@ When /^I should not see "([^\"]+)" link$/ do |link|
6 6 response.should_not have_selector("a", :content => link)
7 7 end
8 8  
9   -When /^I wait (\d+) seconds$/ do |seconds|
10   - sleep seconds.to_i
11   -end
12   -
13 9 Then /^I should be exactly on (.+)$/ do |page_name|
14 10 URI.parse(current_url).request_uri.should == path_to(page_name)
15 11 end
... ...