Commit 8c30e069 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'qa-shl-fix-group-saml-sso-quarantine' into 'master'

Fix issue with unstable UI state when disabling SSO features

See merge request gitlab-org/gitlab!22751
parents 5c25fa80 9eaffcbd
......@@ -37,6 +37,10 @@ module QA
end
end
def has_enforce_sso_button?
has_element?(:enforced_sso_toggle_button, wait: 1.0)
end
def disable_enforce_sso
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')
......@@ -44,6 +48,10 @@ module QA
end
end
def has_group_managed_accounts_button?
has_element?(:group_managed_accounts_toggle_button, wait: 1.0)
end
def enable_group_managed_accounts
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')
......
......@@ -348,24 +348,25 @@ module QA
end
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
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.visit Runtime::Scenario.gitlab_address
@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)
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')
@group.visit!
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
......
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