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

flaky: retry clicking on ng-option if not selected

Christophe Bliardfe8ec8ee6a47
diff --git a/spec/support/pages/admin/custom_actions/form.rb b/spec/support/pages/admin/custom_actions/form.rb
index 3ad545ace4f..b31104c44b6 100644
--- a/spec/support/pages/admin/custom_actions/form.rb
+++ b/spec/support/pages/admin/custom_actions/form.rb
@@ -49,7 +49,7 @@ module Pages
end
set_action_value(name, value)
within '#custom-actions-form--active-actions' do
- expect(page).to have_selector('.form--label', text: name)
+ expect(page).to have_css('.form--label', text: name)
end
end
@@ -62,7 +62,7 @@ module Pages
end
def expect_selected_option(value)
- expect(page).to have_selector('.ng-value-label', text: value)
+ expect(page).to have_css('.ng-value-label', text: value)
end
def expect_action(name, value)
@@ -94,10 +94,12 @@ module Pages
fill_in name, with: val
end
- find('.ng-option', wait: 5, text: val).click
+ retry_block do
+ find('.ng-option', wait: 5, text: val).click
- within '#custom-actions-form--conditions' do
- expect_selected_option val
+ within '#custom-actions-form--conditions' do
+ expect_selected_option val
+ end
end
end
end