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 spec

Christophe Bliardf75b2d04b9ed
diff --git a/modules/meeting/spec/support/pages/meetings/show.rb b/modules/meeting/spec/support/pages/meetings/show.rb
index bd521e65b17..5f02b28625e 100644
--- a/modules/meeting/spec/support/pages/meetings/show.rb
+++ b/modules/meeting/spec/support/pages/meetings/show.rb
@@ -421,8 +421,12 @@ module Pages::Meetings
end
def expect_item_edit_field_error(item, text)
- page.within("#meeting-agenda-items-form-component-#{item.id}") do
- expect(page).to have_css(".FormControl-inlineValidation", text:)
+ # retry because the #meeting-agenda-items-form-component-<id> may not be
+ # updated yet and then becomes stale while checking for field error.
+ retry_block do
+ page.within("#meeting-agenda-items-form-component-#{item.id}") do
+ expect(page).to have_css(".FormControl-inlineValidation", text:)
+ end
end
end