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

Treat the condition dropdowns just as action selections are treated

Aaron Contreras3cbe2ecc7cdb
diff --git a/spec/support/pages/admin/custom_actions/form.rb b/spec/support/pages/admin/custom_actions/form.rb
index b31104c44b6..9b5460af14f 100644
--- a/spec/support/pages/admin/custom_actions/form.rb
+++ b/spec/support/pages/admin/custom_actions/form.rb
@@ -85,21 +85,11 @@ module Pages
end
def set_condition(name, value)
- page.within('#custom-actions-form--conditions') do
- page.find_field(name)
- end
-
Array(value).each do |val|
- within '#custom-actions-form--conditions' do
- fill_in name, with: val
- end
-
- retry_block do
- find('.ng-option', wait: 5, text: val).click
+ set_condition_value(name, val)
- within '#custom-actions-form--conditions' do
- expect_selected_option val
- end
+ within '#custom-actions-form--conditions' do
+ expect_selected_option val
end
end
end
@@ -109,6 +99,16 @@ module Pages
def set_action_value(name, value)
field = find('#custom-actions-form--active-actions .form--field', text: name, wait: 5)
+ set_field_value(field, name, value)
+ end
+
+ def set_condition_value(name, value)
+ field = find('#custom-actions-form--conditions .form--field', text: name, wait: 5)
+
+ set_field_value(field, name, value)
+ end
+
+ def set_field_value(field, name, value)
autocomplete = false
Array(value).each do |val|