diff --git a/spec/support/pages/admin/custom_actions/form.rb b/spec/support/pages/admin/custom_actions/form.rb index b31104c44b6a..9b5460af14f8 100644 --- a/spec/support/pages/admin/custom_actions/form.rb +++ b/spec/support/pages/admin/custom_actions/form.rb @@ -85,21 +85,11 @@ def set_action(name, value) 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 @@ def set_condition(name, value) 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|