From 9108182d5dd3546c1948ece21a6bdfcb5f5da9e7 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Thu, 11 Aug 2016 20:24:59 +0200 Subject: [PATCH] Fix getting started popovers cuke --- features/desktop/signs_up.feature | 1 - features/step_definitions/custom_web_steps.rb | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/features/desktop/signs_up.feature b/features/desktop/signs_up.feature index 8c8b024f7..7280bbcd0 100644 --- a/features/desktop/signs_up.feature +++ b/features/desktop/signs_up.feature @@ -55,7 +55,6 @@ Feature: new user registration Scenario: closing a popover clears getting started When I confirm the alert after I follow "awesome_button" Then I should be on the stream page - And I have turned off jQuery effects And I wait for the popovers to appear And I click close on all the popovers And I close the publisher diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 6924e53a2..d8a0f9c79 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -255,16 +255,16 @@ Then 'I press the attached image' do end And "I wait for the popovers to appear" do - page.should have_selector(".popover", count: 3) + expect(page).to have_selector(".popover", count: 3) end And /^I click close on all the popovers$/ do - page.execute_script("$('.popover .close')[0].click();") - expect(page).to have_selector(".popover", count: 2) - page.execute_script("$('.popover .close')[0].click();") - expect(page).to have_selector(".popover", count: 1) - page.execute_script("$('.popover .close').click();") - expect(page).to_not have_selector(".popover .close") + find(".popover .close", match: :first).click + expect(page).to have_selector(".popover", count: 2, visible: false) + find(".popover .close", match: :first).click + expect(page).to have_selector(".popover", count: 1, visible: false) + find(".popover .close", match: :first).click + expect(page).to_not have_selector(".popover", visible: false) end Then /^I should see a flash message indicating success$/ do