Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#58337] disabled cuprite for image upload spec

Eric Schubert230263ffb57d
diff --git a/spec/features/activities/work_package/activities_spec.rb b/spec/features/activities/work_package/activities_spec.rb
index 56d1a900a86..2ef9fdb1161 100644
--- a/spec/features/activities/work_package/activities_spec.rb
+++ b/spec/features/activities/work_package/activities_spec.rb
@@ -902,6 +902,7 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primeri
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 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primeri
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 02dbd709b9f..5acf6b5e19f 100644
--- a/spec/support/components/attachments/attachments.rb
+++ b/spec/support/components/attachments/attachments.rb
@@ -7,7 +7,13 @@ module Components
##
# 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 @@ module Components
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 69faf6b15d8..b249cfe1570 100644
--- a/spec/support/components/wysiwyg/wysiwyg_editor.rb
+++ b/spec/support/components/wysiwyg/wysiwyg_editor.rb
@@ -83,7 +83,7 @@ module Components
##
# 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 @@ module Components
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)