Fix some failing cukes because they were too fast

This commit is contained in:
Benjamin Neff 2017-08-07 01:36:10 +02:00
parent ff3bd1f59b
commit b80d324504
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 9 additions and 1 deletions

View file

@ -58,6 +58,7 @@ Feature: new user registration
| profile_first_name | some name | | profile_first_name | some name |
And I fill in "tags" with "#rockstar" And I fill in "tags" with "#rockstar"
And I press the first ".as-result-item" within "#as-results-tags" And I press the first ".as-result-item" within "#as-results-tags"
And I wait until ajax requests finished
And I follow "awesome_button" And I follow "awesome_button"
Then I should be on the stream page Then I should be on the stream page
And the publisher should be expanded And the publisher should be expanded

View file

@ -21,7 +21,8 @@ Feature: Viewing my activity on the stream mobile page
Scenario: Show liked post on my activity Scenario: Show liked post on my activity
When I sign in as "bob@bob.bob" on the mobile website When I sign in as "bob@bob.bob" on the mobile website
When I click on selector "a.like-action.inactive" When I click on selector "a.like-action.inactive"
And I go to the activity stream page Then I should see an element "a.like-action.active"
When I go to the activity stream page
Then I should see "My activity" within "#main" Then I should see "My activity" within "#main"
And I should see "Hello! I am #newhere" within ".ltr" And I should see "Hello! I am #newhere" within ".ltr"

View file

@ -186,3 +186,9 @@ end
Then /^show me the page$/ do Then /^show me the page$/ do
save_and_open_page save_and_open_page
end end
Then /^I wait until ajax requests finished$/ do
Timeout.timeout(Capybara.default_max_wait_time) do
loop until page.evaluate_script("jQuery.active") == 0
end
end