Attempt to avoid test flickering

pull/6756/head
Henriette Dinger 6 years ago
parent 64eb7dc6e6
commit b23a01712f
  1. 4
      spec/features/boards/attachment_upload_spec.rb
  2. 3
      spec/features/wiki/attachment_upload_spec.rb
  3. 9
      spec/features/work_packages/attachments/attachment_upload_spec.rb

@ -50,7 +50,7 @@ describe 'Upload attachment to board message', js: true do
login_as(user)
end
it 'can upload an image to new and existin messages via drag & drop' do
it 'can upload an image to new and existing messages via drag & drop' do
index_page.visit!
create_page = index_page.click_create_message
@ -66,6 +66,7 @@ describe 'Upload attachment to board message', js: true do
end
expect(page).to have_selector('attachment-list-item', text: 'image.png')
expect(page).not_to have_selector('notification-upload-progress')
show_page = create_page.click_save
@ -86,6 +87,7 @@ describe 'Upload attachment to board message', js: true do
end
expect(page).to have_selector('attachment-list-item', text: 'image.png', count: 2)
expect(page).not_to have_selector('notification-upload-progress')
show_page.click_save

@ -60,6 +60,7 @@ describe 'Upload attachment to wiki page', js: true do
end
expect(page).to have_selector('attachment-list-item', text: 'image.png')
expect(page).not_to have_selector('notification-upload-progress')
click_on 'Save'
@ -87,6 +88,7 @@ describe 'Upload attachment to wiki page', js: true do
end
expect(page).to have_selector('attachment-list-item', text: 'image.png', count: 2)
expect(page).not_to have_selector('notification-upload-progress')
click_on 'Save'
@ -113,6 +115,7 @@ describe 'Upload attachment to wiki page', js: true do
# Upload image to dropzone
expect(page).to have_no_selector('.work-package--attachments--filename')
attachments.attach_file_on_input(image_fixture)
expect(page).not_to have_selector('notification-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png')
# Assume we could still save the page with an empty title

@ -51,6 +51,7 @@ describe 'Upload attachment to work package', js: true do
# Besides testing caption functionality this also slows down clicking on the submit button
# so that the image is properly embedded
page.find('figure.image figcaption').base.send_keys('Some image caption')
expect(page).not_to have_selector('notification-upload-progress')
field.submit_by_click
@ -117,6 +118,8 @@ describe 'Upload attachment to work package', js: true do
caption.click
caption.base.send_keys('Some image caption')
expect(page).not_to have_selector('notification-upload-progress')
click_on 'Save'
wp_page.expect_notification(
@ -143,12 +146,14 @@ describe 'Upload attachment to work package', js: true do
# Attach file manually
expect(page).to have_no_selector('.work-package--attachments--filename')
attachments.attach_file_on_input(image_fixture)
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', wait: 20)
expect(page).not_to have_selector('notification-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', wait: 5)
##
# and via drag & drop
attachments.drag_and_drop_file(container, Rails.root.join('spec/fixtures/files/image.png'))
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', count: 2, wait: 20)
expect(page).not_to have_selector('notification-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', count: 2, wait: 5)
end
end
end

Loading…
Cancel
Save