diff --git a/spec/features/activities/work_package/activities_spec.rb b/spec/features/activities/work_package/activities_spec.rb index 56d1a900a862..2ef9fdb11615 100644 --- a/spec/features/activities/work_package/activities_spec.rb +++ b/spec/features/activities/work_package/activities_spec.rb @@ -902,6 +902,7 @@ end describe "images in the comment", + with_cuprite: false, with_settings: { journal_aggregation_time_minutes: 0, show_work_package_attachments: false } do let(:work_package) { create(:work_package, project:, author: admin) } let(:image_fixture) { UploadedFile.load_from("spec/fixtures/files/image.png") } @@ -915,7 +916,7 @@ wp_page.wait_for_activity_tab page.find_test_selector("op-open-work-package-journal-form-trigger").click - editor.drag_attachment(image_fixture.path, "") + editor.drag_attachment(image_fixture.path, "", scroll: false) editor.wait_until_upload_progress_toaster_cleared page.find_test_selector("op-submit-work-package-journal-form").click diff --git a/spec/support/components/attachments/attachments.rb b/spec/support/components/attachments/attachments.rb index 02dbd709b9f9..5acf6b5e19f9 100644 --- a/spec/support/components/attachments/attachments.rb +++ b/spec/support/components/attachments/attachments.rb @@ -7,7 +7,13 @@ class Attachments ## # Drag and Drop the file loaded from path on to the (native) target element - def drag_and_drop_file(target, path, position = :center, stopover = nil, cancel_drop: false, delay_dragleave: false) + def drag_and_drop_file(target, + path, + position = :center, + stopover = nil, + cancel_drop: false, + delay_dragleave: false, + scroll: true) # Remove any previous input, if any page.execute_script <<-JS jQuery('#temporary_attachment_files').remove() @@ -22,7 +28,7 @@ def drag_and_drop_file(target, path, position = :center, stopover = nil, cancel_ target else # Use the HTML5 file dropper to create a fake drop event - scroll_to_element(target) + scroll_to_element(target) if scroll target.native end diff --git a/spec/support/components/wysiwyg/wysiwyg_editor.rb b/spec/support/components/wysiwyg/wysiwyg_editor.rb index 69faf6b15d8e..b249cfe15705 100644 --- a/spec/support/components/wysiwyg/wysiwyg_editor.rb +++ b/spec/support/components/wysiwyg/wysiwyg_editor.rb @@ -83,7 +83,7 @@ def within_enabled_preview ## # Create an image fixture with the optional caption from inside the ckeditor - def drag_attachment(image_fixture, caption = "Some caption") + def drag_attachment(image_fixture, caption = "Some caption", scroll: true) in_editor do |_container, editable| # Click the latest figure, if any # Do not wait more than 1 second to check if there is an image @@ -98,7 +98,7 @@ def drag_attachment(image_fixture, caption = "Some caption") editable.base.send_keys(:enter, "some text", :enter, :enter) - attachments.drag_and_drop_file(editable, image_fixture, :bottom) + attachments.drag_and_drop_file(editable, image_fixture, :bottom, scroll:) expect(page) .to have_css('img[src^="/api/v3/attachments/"]', count: images.length + 1, wait: 10)