Wait for image to be uploaded

This commit is contained in:
Benjamin Neff 2017-08-11 02:14:32 +02:00
parent 6b8c2ebe9f
commit 605e292589
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
2 changed files with 2 additions and 1 deletions

View file

@ -33,7 +33,6 @@ function createUploader(){
$("#fileInfo-publisher").text(fileName + " " + progress + "%"); $("#fileInfo-publisher").text(fileName + " " + progress + "%");
}, },
onSubmit: function() { onSubmit: function() {
$("#file-upload-publisher").addClass("loading");
$("#publisher_textarea_wrapper").addClass("with_attachments"); $("#publisher_textarea_wrapper").addClass("with_attachments");
$("#photodropzone").append( $("#photodropzone").append(
"<li class='publisher_photo loading' style='position:relative;'>" + "<li class='publisher_photo loading' style='position:relative;'>" +

View file

@ -93,6 +93,8 @@ When /^(?:|I )attach the file "([^"]*)" to (?:hidden )?"([^"]*)"(?: within "([^"
page.execute_script("$(\"input[name='#{field}']\").css('opacity', '1');") page.execute_script("$(\"input[name='#{field}']\").css('opacity', '1');")
attach_file(field, Rails.root.join(path).to_s) attach_file(field, Rails.root.join(path).to_s)
end end
# wait for the image to be ready
page.assert_selector(".loading", count: 0)
end end
Then /^(?:|I )should see (\".+?\"[\s]*)(?:[\s]+within[\s]* "([^"]*)")?$/ do |vars, selector| Then /^(?:|I )should see (\".+?\"[\s]*)(?:[\s]+within[\s]* "([^"]*)")?$/ do |vars, selector|