Skip to content

Commit

Permalink
[#58337] disabled cuprite for image upload spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Kharonus committed Oct 25, 2024
1 parent cf5cbd0 commit 230263f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion spec/features/activities/work_package/activities_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
Expand All @@ -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
Expand Down
10 changes: 8 additions & 2 deletions spec/support/components/attachments/attachments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/support/components/wysiwyg/wysiwyg_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 230263f

Please sign in to comment.