diff --git a/features/desktop/signs_up.feature b/features/desktop/signs_up.feature index d68c58f19..bed865064 100644 --- a/features/desktop/signs_up.feature +++ b/features/desktop/signs_up.feature @@ -58,6 +58,7 @@ Feature: new user registration | profile_first_name | some name | And I fill in "tags" with "#rockstar" And I press the first ".as-result-item" within "#as-results-tags" + And I wait until ajax requests finished And I follow "awesome_button" Then I should be on the stream page And the publisher should be expanded diff --git a/features/mobile/activity_stream.feature b/features/mobile/activity_stream.feature index 27475abcd..823b4f7ad 100644 --- a/features/mobile/activity_stream.feature +++ b/features/mobile/activity_stream.feature @@ -21,7 +21,8 @@ Feature: Viewing my activity on the stream mobile page Scenario: Show liked post on my activity When I sign in as "bob@bob.bob" on the mobile website 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" And I should see "Hello! I am #newhere" within ".ltr" diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index f2c564c8f..36092716f 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -186,3 +186,9 @@ end Then /^show me the page$/ do save_and_open_page 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