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

Fix flaky test invite_user_modal/permission_lacking_current_project_spec.rb

Christophe Bliard1e5cad9fb2f8
diff --git a/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb b/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb
index ee4b66d47ce..ee5425ef0c6 100644
--- a/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb
+++ b/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb
@@ -16,6 +16,11 @@ module Components::Autocompleter
within(element) do
ng_enter_query(element, query)
end
+
+ # Wait for options to be refreshed after having entered some text.
+ expect(element).not_to have_selector('.ng-spinner-loader')
+
+ # probably not necessary anymore
sleep(0.5) unless using_cuprite?
# Find the open dropdown