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
Wait for idle between login requests
Oliver Günther6eb478228793
diff --git a/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rb b/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rbindex 3d97bc10120..72e86cd92ac 100644--- a/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rb+++ b/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rb@@ -1,9 +1,12 @@require_relative "../../spec_helper"require_relative "../shared_2fa_examples"-RSpec.describe "Login with 2FA backup code", :js, with_settings: {- plugin_openproject_two_factor_authentication: { "active_strategies" => [:developer] }-} do+RSpec.describe "Login with 2FA backup code",+ :js,+ :with_cuprite,+ with_settings: {+ plugin_openproject_two_factor_authentication: { "active_strategies" => [:developer] }+ } dolet(:user_password) { "bob!" * 4 }let(:user) docreate(:user,diff --git a/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rbindex effabe6acc2..6701fd82b24 100644--- a/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rb@@ -1,12 +1,15 @@require_relative "../../spec_helper"require_relative "../shared_2fa_examples"-RSpec.describe "Login with enforced 2FA", :js, with_settings: {- plugin_openproject_two_factor_authentication: {- "active_strategies" => [:developer],- "enforced" => true- }-} do+RSpec.describe "Login with enforced 2FA",+ :js,+ :with_cuprite,+ with_settings: {+ plugin_openproject_two_factor_authentication: {+ "active_strategies" => [:developer],+ "enforced" => true+ }+ } dolet(:user_password) { "bob!" * 4 }let(:user) docreate(:user,diff --git a/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rbindex c1ea5473179..8eff3e7d0be 100644--- a/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rb@@ -1,11 +1,14 @@require_relative "../../spec_helper"require_relative "../shared_2fa_examples"-RSpec.describe "Login with 2FA device", :js, with_settings: {- plugin_openproject_two_factor_authentication: {- "active_strategies" => [:developer]- }-} do+RSpec.describe "Login with 2FA device",+ :js,+ :with_cuprite,+ with_settings: {+ plugin_openproject_two_factor_authentication: {+ "active_strategies" => [:developer]+ }+ } dolet(:user_password) { "bob!" * 4 }let(:user) docreate(:user,diff --git a/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rbindex 0ee982a3e07..34565fca2a2 100644--- a/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb@@ -1,7 +1,10 @@require_relative "../../spec_helper"require_relative "../shared_2fa_examples"-RSpec.describe "Login with no required OTP", :js, with_config: { "2fa": { active_strategies: [:developer] } } do+RSpec.describe "Login with no required OTP",+ :js,+ :with_cuprite,+ with_config: { "2fa": { active_strategies: [:developer] } } dolet(:user_password) { "bob!" * 4 }let(:user) docreate(:user,diff --git a/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rb b/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rbindex 015a621fc6a..086daa515d8 100644--- a/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rb@@ -1,9 +1,12 @@require_relative "../../spec_helper"require_relative "../shared_2fa_examples"-RSpec.describe "Login by switching 2FA device", :js, with_settings: {- plugin_openproject_two_factor_authentication: { "active_strategies" => %i[developer totp] }-} do+RSpec.describe "Login by switching 2FA device",+ :js,+ :with_cuprite,+ with_settings: {+ plugin_openproject_two_factor_authentication: { "active_strategies" => %i[developer totp] }+ } dolet(:user_password) { "bob!" * 4 }let(:user) docreate(:user,@@ -21,12 +24,11 @@ RSpec.describe "Login by switching 2FA device", :js, with_settings: {expect(page).to have_css("input#otp")- SeleniumHubWaiter.wait# Toggle device to TOTPfind_by_id("toggle_resend_form").click- SeleniumHubWaiter.waitfind(".button--link[value='#{device2.redacted_identifier}']").click+ wait_for_network_idleexpect(page).to have_css("input#otp")expect(page).to have_css("#submit_otp p", text: device2.redacted_identifier)diff --git a/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb b/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rbindex c7bb9cd65f3..b76eded6d0b 100644--- a/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb+++ b/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb@@ -1,8 +1,11 @@require_relative "../spec_helper"-RSpec.describe "My Account 2FA configuration", :js, with_settings: {- plugin_openproject_two_factor_authentication: { "active_strategies" => %i[developer totp] }-} do+RSpec.describe "My Account 2FA configuration",+ :js,+ :with_cuprite,+ with_settings: {+ plugin_openproject_two_factor_authentication: { "active_strategies" => %i[developer totp] }+ } dolet(:dialog) { Components::PasswordConfirmationDialog.new }let(:user_password) { "boB!4" * 4 }let(:user) dodiff --git a/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb b/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rbindex 159404baa86..5a02d143809 100644--- a/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb+++ b/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb@@ -1,12 +1,15 @@require_relative "../../spec_helper"require_relative "../shared_2fa_examples"-RSpec.describe "Login with 2FA remember cookie", :js, with_settings: {- plugin_openproject_two_factor_authentication: {- active_strategies: [:developer],- allow_remember_for_days: 30- }-} do+RSpec.describe "Login with 2FA remember cookie",+ :js,+ :with_cuprite,+ with_settings: {+ plugin_openproject_two_factor_authentication: {+ active_strategies: [:developer],+ allow_remember_for_days: 30+ }+ } dolet(:user_password) do"user!user!"end@@ -16,7 +19,7 @@ RSpec.describe "Login with 2FA remember cookie", :js, with_settings: {let!(:device) { create(:two_factor_authentication_device_sms, user:, active: true, default: true) }def login_with_cookie- page.driver.browser.manage.delete_all_cookies+ page.driver.clear_cookiessms_token = nilallow_any_instance_of(OpenProject::TwoFactorAuthentication::TokenStrategy::Developer)diff --git a/modules/two_factor_authentication/spec/features/shared_2fa_examples.rb b/modules/two_factor_authentication/spec/features/shared_2fa_examples.rbindex 65443b9b57c..3042abf82fa 100644--- a/modules/two_factor_authentication/spec/features/shared_2fa_examples.rb+++ b/modules/two_factor_authentication/spec/features/shared_2fa_examples.rb@@ -1,23 +1,23 @@def first_login_stepvisit signin_path- SeleniumHubWaiter.waitwithin("#login-form") dofill_in("username", with: user.login)fill_in("password", with: user_password)click_link_or_button I18n.t(:button_login)end+ wait_for_network_idleenddef two_factor_step(token)expect(page).to have_css("input#otp")- SeleniumHubWaiter.waitfill_in "otp", with: tokenclick_button I18n.t(:button_login)+ wait_for_network_idleenddef expect_logged_invisit my_account_path- SeleniumHubWaiter.wait+ wait_for_network_idleexpect(page).to have_css(".form--field-container", text: user.login)enddiff --git a/spec/features/auth/consent_auth_stage_spec.rb b/spec/features/auth/consent_auth_stage_spec.rbindex 5839c19f495..4888e7e7699 100644--- a/spec/features/auth/consent_auth_stage_spec.rb+++ b/spec/features/auth/consent_auth_stage_spec.rb@@ -50,11 +50,13 @@ RSpec.describe "Authentication Stages" dodef expect_logged_in(path = my_page_path)expect(page).to have_current_path(path)visit my_account_path+ wait_for_network_idleexpect(page).to have_css(".form--field-container", text: user.login)enddef expect_not_logged_invisit my_account_path+ wait_for_netowrk_idleexpect(page).to have_no_css(".form--field-container", text: user.login)end