Commit 589f6b19 authored by Stan Hu's avatar Stan Hu

Set initial password for instance in LDAP QA test

For a new instance, the root password needs to be set, regardless of whether
LDAP is enabled.
parent c5ad5a08
...@@ -31,22 +31,29 @@ module QA ...@@ -31,22 +31,29 @@ module QA
end end
end end
def set_initial_password_if_present
if page.has_content?('Change your password')
fill_in :user_password, with: Runtime::User.password
fill_in :user_password_confirmation, with: Runtime::User.password
click_button 'Change your password'
end
end
def sign_in_using_ldap_credentials def sign_in_using_ldap_credentials
using_wait_time 0 do
set_initial_password_if_present
click_link 'LDAP' click_link 'LDAP'
fill_in :username, with: Runtime::User.name fill_in :username, with: Runtime::User.name
fill_in :password, with: Runtime::User.password fill_in :password, with: Runtime::User.password
click_button 'Sign in' click_button 'Sign in'
end end
end
def sign_in_using_credentials def sign_in_using_credentials
using_wait_time 0 do using_wait_time 0 do
if page.has_content?('Change your password') set_initial_password_if_present
fill_in :user_password, with: Runtime::User.password
fill_in :user_password_confirmation, with: Runtime::User.password
click_button 'Change your password'
end
click_link 'Standard' if page.has_content?('LDAP') click_link 'Standard' if page.has_content?('LDAP')
......
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