Wait for the image actually uploaded and removed again
This commit is contained in:
parent
80bc90afa9
commit
d06ef4505c
2 changed files with 5 additions and 0 deletions
|
|
@ -127,7 +127,9 @@ end
|
|||
|
||||
When /^I click to delete the first uploaded photo$/ do
|
||||
page.execute_script("$('#photodropzone .x').css('display', 'block');")
|
||||
image_count = all(".publisher_photo img").count
|
||||
find("#photodropzone .x", match: :first).trigger "click"
|
||||
page.assert_selector(".publisher_photo img", count: image_count - 1)
|
||||
end
|
||||
|
||||
And /^I click on selector "([^"]*)"$/ do |selector|
|
||||
|
|
|
|||
|
|
@ -14,10 +14,13 @@ module PublishingCukeHelpers
|
|||
|
||||
def upload_file_with_publisher(path)
|
||||
page.execute_script(%q{$("input[name='qqfile']").css("opacity", '1');})
|
||||
image_count = all(".publisher_photo img").count
|
||||
with_scope("#publisher-textarea-wrapper") do
|
||||
attach_file("qqfile", Rails.root.join(path).to_s)
|
||||
# wait for the image to be ready
|
||||
page.assert_selector(".publisher_photo.loading", count: 0)
|
||||
page.assert_selector(".publisher_photo img", count: image_count + 1)
|
||||
page.assert_selector(".publisher_photo img.hidden", count: 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue