Commit 131c3296 authored by Sanad Liaquat's avatar Sanad Liaquat

Add wait between retries of SSO settings

parent 13dfcf8e
...@@ -31,28 +31,28 @@ module QA ...@@ -31,28 +31,28 @@ module QA
end end
def enforce_sso def enforce_sso
Support::Retrier.retry_until do Support::Retrier.retry_until(sleep_interval: 1.0, exit_on_failure: true) do
click_element :enforced_sso_toggle_button unless find_element(:enforced_sso_toggle_button)[:class].include?('is-checked') click_element :enforced_sso_toggle_button unless find_element(:enforced_sso_toggle_button)[:class].include?('is-checked')
find_element(:enforced_sso_toggle_button)[:class].include?('is-checked') find_element(:enforced_sso_toggle_button)[:class].include?('is-checked')
end end
end end
def disable_enforce_sso def disable_enforce_sso
Support::Retrier.retry_until do Support::Retrier.retry_until(sleep_interval: 1.0, exit_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')
!find_element(:enforced_sso_toggle_button)[:class].include?('is-checked') !find_element(:enforced_sso_toggle_button)[:class].include?('is-checked')
end end
end end
def enable_group_managed_accounts def enable_group_managed_accounts
Support::Retrier.retry_until do Support::Retrier.retry_until(sleep_interval: 1.0, exit_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')
find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked') find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked')
end end
end end
def disable_group_managed_accounts def disable_group_managed_accounts
Support::Retrier.retry_until do Support::Retrier.retry_until(sleep_interval: 1.0, exit_on_failure: true) do
click_element :group_managed_accounts_toggle_button if find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked') click_element :group_managed_accounts_toggle_button if find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked')
!find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked') !find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked')
end end
......
...@@ -320,6 +320,8 @@ module QA ...@@ -320,6 +320,8 @@ module QA
end end
def remove_user_if_exists(username_or_email) def remove_user_if_exists(username_or_email)
QA::Runtime::Logger.debug("Removing user \"#{username_or_email}\" via API")
response = parse_body(get Runtime::API::Request.new(@api_client, "/users?search=#{username_or_email}").url) response = parse_body(get Runtime::API::Request.new(@api_client, "/users?search=#{username_or_email}").url)
delete Runtime::API::Request.new(@api_client, "/users/#{response.first[:id]}").url if response.any? delete Runtime::API::Request.new(@api_client, "/users/#{response.first[:id]}").url if response.any?
......
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