avoid use :visible option in capybara finders
This commit is contained in:
parent
e9af8d55af
commit
261ac786c1
5 changed files with 11 additions and 10 deletions
|
|
@ -8,7 +8,7 @@ end
|
|||
|
||||
Then /^the first comment field should be closed$/ do
|
||||
page.should have_css(".stream_element")
|
||||
find("#main_stream .stream_element .new_comment", match: :first, visible: false).should_not be_visible
|
||||
page.should_not have_selector("#main_stream .stream_element .new_comment", match: :first)
|
||||
end
|
||||
|
||||
When /^I comment "([^"]*)" on "([^"]*)"$/ do |comment_text, post_text|
|
||||
|
|
|
|||
|
|
@ -95,8 +95,6 @@ end
|
|||
When /^I append "([^"]*)" to the publisher$/ do |stuff|
|
||||
elem = find('#status_message_fake_text')
|
||||
elem.native.send_keys(' ' + stuff)
|
||||
|
||||
find('#status_message_text', visible: false).value.should include(stuff)
|
||||
end
|
||||
|
||||
When /^I append "([^"]*)" to the publisher mobile$/ do |stuff|
|
||||
|
|
@ -119,7 +117,8 @@ end
|
|||
|
||||
When /^I prepare the deletion of the first post$/ do
|
||||
within('.stream_element', match: :first) do
|
||||
find('.remove_post', visible: false).click
|
||||
find('.controls').hover
|
||||
find('.remove_post').click
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -130,7 +129,8 @@ end
|
|||
|
||||
When /^I click to delete the first comment$/ do
|
||||
within("div.comment", match: :first) do
|
||||
find(".comment_delete", visible: false).click
|
||||
find(".controls").hover
|
||||
find(".comment_delete").click
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ When /^I press the "([^\"]*)" key somewhere$/ do |key|
|
|||
end
|
||||
|
||||
When /^I press the "([^\"]*)" key in the publisher$/ do |key|
|
||||
find("#status_message_fake_text", visible: false).native.send_keys(key)
|
||||
find("#status_message_fake_text").native.send_keys(key)
|
||||
end
|
||||
|
||||
Then /^post (\d+) should be highlighted$/ do |position|
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Then /^the post should be expanded$/ do
|
|||
end
|
||||
|
||||
Then /^I should see an uploaded image within the photo drop zone$/ do
|
||||
find("#photodropzone img", visible: false)["src"].should include("uploads/images")
|
||||
find("#photodropzone img")["src"].should include("uploads/images")
|
||||
end
|
||||
|
||||
Then /^I should not see an uploaded image within the photo drop zone$/ do
|
||||
|
|
@ -35,7 +35,8 @@ And /^the post with text "([^"]*)" is reshared by "([^"]*)"$/ do |text, email|
|
|||
end
|
||||
|
||||
When /^I click on the first block button/ do
|
||||
find(".block_user", visible: false).click
|
||||
find(".stream_element", match: :first).hover
|
||||
find(".block_user").click
|
||||
end
|
||||
|
||||
When /^I expand the post$/ do
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ module PublishingCukeHelpers
|
|||
def expand_first_post
|
||||
within(".stream_element", match: :first) do
|
||||
find(".expander").click
|
||||
find(".expander", visible: false).should_not be_visible
|
||||
has_css?(".expander").should be_false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ module PublishingCukeHelpers
|
|||
end
|
||||
|
||||
def first_post_expanded?
|
||||
find(".stream_element .expander", match: :first, visible: false).should_not be_visible
|
||||
has_no_css?(".stream_element .expander", match: :first).should be_true
|
||||
find(".stream_element .collapsible", match: :first).has_no_selector?(".collapsed")
|
||||
find(".stream_element .collapsible", match: :first).has_selector?(".opened")
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue