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
Switch `users/invite_user_modal/invite_user_modal_spec` to cuprite
Aaron Contreras030a7a05966e
diff --git a/spec/features/users/invite_user_modal/invite_user_modal_spec.rb b/spec/features/users/invite_user_modal/invite_user_modal_spec.rbindex 976ad5855d8..50af7adfde5 100644--- a/spec/features/users/invite_user_modal/invite_user_modal_spec.rb+++ b/spec/features/users/invite_user_modal/invite_user_modal_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-RSpec.describe 'Invite user modal', js: true do+RSpec.describe 'Invite user modal', js: true, with_cuprite: true doshared_let(:project) { create(:project) }shared_let(:work_package) { create(:work_package, project:) }@@ -204,7 +204,7 @@ RSpec.describe 'Invite user modal', js: true doroles: [role_no_permissions])end- it 'disables projects for which you do not have rights' do+ it 'disables projects for which you do not have rights', with_cuprite: false dongselect = modal.open_select_in_step '.ng-select-container'expect(ngselect).to have_text "#{project_no_permissions.name}\nYou are not allowed to invite members to this project"end@@ -215,7 +215,7 @@ RSpec.describe 'Invite user modal', js: true do# Use admin to ensure all projects are visiblelet(:current_user) { create(:admin) }- it 'disables projects for which you do not have rights' do+ it 'disables projects for which you do not have rights', with_cuprite: false dongselect = modal.open_select_in_step '.ng-select-container'expect(ngselect).not_to have_text archived_projectenddiff --git a/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb b/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rbindex a53fefb0a79..8841b577d8a 100644--- a/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb+++ b/spec/support/components/autocompleter/ng_select_autocomplete_helpers.rb@@ -53,9 +53,9 @@ module Components::Autocompleterinput.send_keys(query[0..-2])sleep 0.2input.send_keys(query[-1])- else- input.send_keys(query)end++ wait_for_network_idle if using_cuprite?end##diff --git a/spec/support/components/users/invite_user_modal.rb b/spec/support/components/users/invite_user_modal.rbindex 1ac7f0b4315..1341afe85d1 100644--- a/spec/support/components/users/invite_user_modal.rb+++ b/spec/support/components/users/invite_user_modal.rb@@ -89,7 +89,9 @@ module Componentsenddef open_select_in_step(selector, query = '')- search_autocomplete modal_element.find(selector),+ select_field = modal_element.find(selector)++ search_autocomplete select_field,query:,results_selector: 'body'enddiff --git a/spec/support/edit_fields/edit_field.rb b/spec/support/edit_fields/edit_field.rbindex 057cc3acf0c..55e748c693c 100644--- a/spec/support/edit_fields/edit_field.rb+++ b/spec/support/edit_fields/edit_field.rb@@ -73,9 +73,9 @@ class EditFielddef activate!(expect_open: true)retry_block dounless active?- SeleniumHubWaiter.wait+ SeleniumHubWaiter.wait unless using_cuprite?scroll_to_and_click(display_element)- SeleniumHubWaiter.wait+ SeleniumHubWaiter.wait unless using_cuprite?endif expect_open && !active?@@ -88,6 +88,7 @@ class EditFielddef openSelectFieldautocomplete_selector.click+ wait_for_network_idle if using_cuprite?enddef expect_state!(open:)@@ -145,6 +146,9 @@ class EditFieldscroll_to_element(input_element)if autocompleter_field?autocomplete(content)+ elsif using_cuprite?+ clear_input_field_contents(input_element)+ input_element.fill_in with: contentelse# A normal fill_in would cause the focus loss on the input for empty strings.# Thus the form would be submitted.diff --git a/spec/support/shared/scroll_into_view_helpers.rb b/spec/support/shared/scroll_into_view_helpers.rbindex 95d71ef6036..b62092c6d29 100644--- a/spec/support/shared/scroll_into_view_helpers.rb+++ b/spec/support/shared/scroll_into_view_helpers.rb@@ -43,6 +43,7 @@ def scroll_to_and_click(element)scroll_to_element(element)sleep 0.2element.click+ wait_for_network_idle if using_cuprite?endend