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

Stabilize flaky sharing specs

Aaron Contreras1377943ac509
diff --git a/spec/features/work_packages/share/multi_invite_spec.rb b/spec/features/work_packages/share/multi_invite_spec.rb
index 73b1fcd5f94..edbe7e8d46f 100644
--- a/spec/features/work_packages/share/multi_invite_spec.rb
+++ b/spec/features/work_packages/share/multi_invite_spec.rb
@@ -265,8 +265,6 @@ RSpec.describe 'Work package sharing',
end
it 'shows a warning as soon as you reach the user limit' do
- pending 'Spec fails/flickers regularly. Ticket: https://community.openproject.org/work_packages/51185'
-
share_modal.expect_open
share_modal.expect_shared_count_of(1)
diff --git a/spec/support/components/work_packages/share_modal.rb b/spec/support/components/work_packages/share_modal.rb
index c8269d37308..4f3f635ed72 100644
--- a/spec/support/components/work_packages/share_modal.rb
+++ b/spec/support/components/work_packages/share_modal.rb
@@ -34,12 +34,20 @@ module Components
class ShareModal < Components::Common::Modal
include Components::Autocompleter::NgSelectAutocompleteHelpers
- attr_reader :work_package
+ attr_reader :work_package, :title
def initialize(work_package)
super()
@work_package = work_package
+ @title = I18n.t('js.work_packages.sharing.title')
+ end
+
+ def expect_open
+ super
+
+ expect_title(title)
+ wait_for_network_idle(timeout: 10)
end
def select_shares(*principals)
@@ -352,7 +360,8 @@ module Components
def expect_no_user_limit_warning
within modal_element do
- expect(page).not_to have_css('[data-test-selector="op-share-wp-user-limit"]')
+ expect(page)
+ .not_to have_text(I18n.t('work_package.sharing.warning_user_limit_reached'), wait: 0)
end
end