Commit 9eaffcbd authored by Sanad Liaquat's avatar Sanad Liaquat

Fix issue with unstable UI state when disabling SSO features

parent 6e88bebc
...@@ -37,6 +37,10 @@ module QA ...@@ -37,6 +37,10 @@ module QA
end end
end end
def has_enforce_sso_button?
has_element?(:enforced_sso_toggle_button, wait: 1.0)
end
def disable_enforce_sso def disable_enforce_sso
Support::Retrier.retry_until(sleep_interval: 1.0, raise_on_failure: true) do Support::Retrier.retry_until(sleep_interval: 1.0, raise_on_failure: true) do
click_element :enforced_sso_toggle_button if find_element(:enforced_sso_toggle_button)[:class].include?('is-checked') click_element :enforced_sso_toggle_button if find_element(:enforced_sso_toggle_button)[:class].include?('is-checked')
...@@ -44,6 +48,10 @@ module QA ...@@ -44,6 +48,10 @@ module QA
end end
end end
def has_group_managed_accounts_button?
has_element?(:group_managed_accounts_toggle_button, wait: 1.0)
end
def enable_group_managed_accounts def enable_group_managed_accounts
Support::Retrier.retry_until(sleep_interval: 1.0, raise_on_failure: true) do Support::Retrier.retry_until(sleep_interval: 1.0, raise_on_failure: true) do
click_element :group_managed_accounts_toggle_button unless find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked') click_element :group_managed_accounts_toggle_button unless find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked')
......
...@@ -348,24 +348,25 @@ module QA ...@@ -348,24 +348,25 @@ module QA
end end
def disable_enforce_sso_and_group_managed_account def disable_enforce_sso_and_group_managed_account
Runtime::Logger.info('Disabling enforce sso and group managed account') if Runtime::Feature.enabled?('enforced_sso') || Runtime::Feature.enabled?('group_managed_accounts')
Runtime::Logger.info('Disabling enforce sso and/or group managed account')
page.visit Runtime::Scenario.gitlab_address page.visit Runtime::Scenario.gitlab_address
Support::Retrier.retry_until(raise_on_failure: true) do
Page::Main::Menu.perform(&:sign_out_if_signed_in)
!Page::Main::Menu.perform(&:signed_in?)
end
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
@group.visit! Support::Retrier.retry_until(raise_on_failure: true) do
Page::Main::Menu.perform(&:sign_out_if_signed_in)
!Page::Main::Menu.perform(&:signed_in?)
end
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
Page::Group::Menu.perform(&:go_to_saml_sso_group_settings) @group.visit!
EE::Page::Group::Settings::SamlSSO.perform do |saml_sso|
saml_sso.disable_enforce_sso if Runtime::Feature.enabled?('enforced_sso')
saml_sso.disable_group_managed_accounts if Runtime::Feature.enabled?('group_managed_accounts')
saml_sso.click_save_changes Page::Group::Menu.perform(&:go_to_saml_sso_group_settings)
EE::Page::Group::Settings::SamlSSO.perform do |saml_sso|
saml_sso.disable_enforce_sso if saml_sso.has_enforce_sso_button?
saml_sso.disable_group_managed_accounts if saml_sso.has_group_managed_accounts_button?
saml_sso.click_save_changes
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment