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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Extract opening the share modal into the WorkPackage page object
Aaron Contreras721b26baf1cf
diff --git a/spec/features/work_packages/share/bulk_sharing_spec.rb b/spec/features/work_packages/share/bulk_sharing_spec.rbindex 9ebf4ff8cfa..b25eb14eada 100644--- a/spec/features/work_packages/share/bulk_sharing_spec.rb+++ b/spec/features/work_packages/share/bulk_sharing_spec.rb@@ -77,7 +77,8 @@ RSpec.describe 'Work Packages', 'Bulk Sharing',it 'allows administrating shares in bulk' dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_button+share_modal.expect_openshare_modal.expect_shared_count_of(3)@@ -257,7 +258,8 @@ RSpec.describe 'Work Packages', 'Bulk Sharing',share_modal.closeshare_modal.expect_closed- click_button 'Share'++ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.expect_shared_count_of(3)@@ -287,7 +289,7 @@ RSpec.describe 'Work Packages', 'Bulk Sharing',it 'does not allow bulk sharing' dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.expect_shared_count_of(3)diff --git a/spec/features/work_packages/share/enterprise_restriction_spec.rb b/spec/features/work_packages/share/enterprise_restriction_spec.rbindex 76b1cfccd1d..497f866a6ed 100644--- a/spec/features/work_packages/share/enterprise_restriction_spec.rb+++ b/spec/features/work_packages/share/enterprise_restriction_spec.rb@@ -55,7 +55,8 @@ RSpec.describe 'Work Package Sharing Enterprise Restriction',before dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_button+share_modal.expect_openenddiff --git a/spec/features/work_packages/share/filter_spec.rb b/spec/features/work_packages/share/filter_spec.rbindex 8e4cec39b13..f2225070822 100644--- a/spec/features/work_packages/share/filter_spec.rb+++ b/spec/features/work_packages/share/filter_spec.rb@@ -79,7 +79,7 @@ RSpec.describe 'Work package sharing',context 'when having share permission' dobefore dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonendit 'allows to filter for the type' dodiff --git a/spec/features/work_packages/share/multi_invite_spec.rb b/spec/features/work_packages/share/multi_invite_spec.rbindex e7f804fd34e..0a4088d09a7 100644--- a/spec/features/work_packages/share/multi_invite_spec.rb+++ b/spec/features/work_packages/share/multi_invite_spec.rb@@ -82,7 +82,7 @@ RSpec.describe 'Work package sharing',# Clicking on the share button opens a modal which lists all of the users a work package# is explicitly shared with.# Project members are not listed unless the work package is also shared with them explicitly.- click_button 'Share'+ work_package_page.click_share_buttonaggregate_failures "Inviting multiple users or groups at once" doshare_modal.expect_shared_count_of(1)@@ -135,7 +135,7 @@ RSpec.describe 'Work package sharing',endshare_modal.close- click_button 'Share'+ work_package_page.click_share_buttonaggregate_failures "Re-opening the modal after changes performed" do# This user preserved@@ -161,7 +161,7 @@ RSpec.describe 'Work package sharing',before dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonendit 'allows adding multiple users and updates the modal correctly' do@@ -193,7 +193,7 @@ RSpec.describe 'Work package sharing',it 'allows creating multiple users at once' dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.expect_shared_count_of(1)@@ -233,7 +233,7 @@ RSpec.describe 'Work package sharing',it 'allows sharing with an existing user and creating a new one at the same time' dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.expect_shared_count_of(1)@@ -267,7 +267,7 @@ RSpec.describe 'Work package sharing',it 'shows a warning as soon as you reach the user limit' dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.expect_shared_count_of(1)diff --git a/spec/features/work_packages/share_spec.rb b/spec/features/work_packages/share_spec.rbindex 63cf4b8e8ba..40bc61eed14 100644--- a/spec/features/work_packages/share_spec.rb+++ b/spec/features/work_packages/share_spec.rb@@ -94,7 +94,7 @@ RSpec.describe 'Work package sharing',# Clicking on the share button opens a modal which lists all of the users a work package# is explicitly shared with.# Project members are not listed unless the work package is also shared with them explicitly.- click_button 'Share'+ work_package_page.click_share_buttonaggregate_failures "Initial shares list" doshare_modal.expect_title(I18n.t('js.work_packages.sharing.title'))@@ -225,7 +225,7 @@ RSpec.describe 'Work package sharing',endshare_modal.close- click_button 'Share'+ work_package_page.click_share_buttonaggregate_failures "Re-opening the modal after changes performed" do# This user preserved its group independent share@@ -255,8 +255,7 @@ RSpec.describe 'Work package sharing',it "lets the sharer know a user needs to be selected to share the work package with them" dowork_package_page.visit!-- click_button 'Share'+ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.click_share@@ -342,7 +341,7 @@ RSpec.describe 'Work package sharing',before dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonendit 'allows inviting and directly sharing with a user who is not part of the instance yet' do@@ -390,7 +389,7 @@ RSpec.describe 'Work package sharing',context 'when lacking global invite permission' doit 'does not allow creating a user who is not part of the instance yet' dowork_package_page.visit!- click_button 'Share'+ work_package_page.click_share_buttonshare_modal.expect_openshare_modal.expect_shared_count_of(6)diff --git a/spec/support/pages/work_packages/full_work_package.rb b/spec/support/pages/work_packages/full_work_package.rbindex e07e391c90d..4a89b79536d 100644--- a/spec/support/pages/work_packages/full_work_package.rb+++ b/spec/support/pages/work_packages/full_work_package.rb@@ -38,6 +38,18 @@ module Pagesfind_by_id('toolbar-items')end+ def click_share_button+ within toolbar do+ # The request to the capabilities endpoint determines+ # whether the "Share" button is rendered or not.+ # Instead of waiting for an idle network (which may+ # include waiting for other network requests unrelated to+ # sharing), waiting for the button to be present makes+ # the spec a tad faster.+ click_button('Share', wait: 10)+ end+ end+privatedef container