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

stabilize flickering spec

ulferts474df78fddd9
diff --git a/spec/features/work_packages/table/edit_work_packages_spec.rb b/spec/features/work_packages/table/edit_work_packages_spec.rb
index e7d21cb01f4..fd7c781361c 100644
--- a/spec/features/work_packages/table/edit_work_packages_spec.rb
+++ b/spec/features/work_packages/table/edit_work_packages_spec.rb
@@ -106,6 +106,9 @@ RSpec.describe "Inline editing work packages", :js do
subject_field.expect_invalid
subject_field.save!
+
+ wp_table.expect_and_dismiss_toaster(type: :error, message: "Subject can't be blank.")
+
expect(work_package.reload.subject).to eq "Foobar"
end
end
diff --git a/spec/support/shared/cuprite_helpers.rb b/spec/support/shared/cuprite_helpers.rb
index 43baccc6791..7ec379669f7 100644
--- a/spec/support/shared/cuprite_helpers.rb
+++ b/spec/support/shared/cuprite_helpers.rb
@@ -70,7 +70,10 @@ def clear_input_field_contents(input_element)
return unless input_element.value.length.positive?
+ # Move to the end of the input field and then backspace to clear the field.
+ rights = Array.new(input_element.value.length, :right)
backspaces = Array.new(input_element.value.length, :backspace)
+ input_element.native.node.type(*rights)
input_element.native.node.type(*backspaces)
end