Wait a little longer on attachments

[ci skip]
pull/6835/head
Oliver Günther 6 years ago
parent 0ce224d934
commit 507fa44804
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 7
      spec/support/components/wysiwyg/wysiwyg_editor.rb

@ -66,21 +66,22 @@ module Components
def drag_attachment(image_fixture, caption = 'Some caption')
in_editor do |container, editable|
sleep 0.5
sleep 1
editable.base.send_keys(:enter, 'some text', :enter, :enter, :enter)
images = editable.all('figure.image')
attachments.drag_and_drop_file(editable, image_fixture)
expect(page)
.to have_selector('figure img[src^="/api/v3/attachments/"]', count: images.length + 1, wait: 10)
.to have_selector('figure img[src^="/api/v3/attachments/"]', count: images.length + 1, wait: 10)
sleep 0.5
sleep 1
expect(page).not_to have_selector('notification-upload-progress')
# Besides testing caption functionality this also slows down clicking on the submit button
# so that the image is properly embedded
editable.all('figure.image figcaption').map { |el| el.base.send_keys(caption) }
sleep 1
end
end

Loading…
Cancel
Save