summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-02-07 15:54:23 -0800
committerStan Hu <stanhu@gmail.com>2018-02-08 22:20:58 -0800
commit589f6b1907f1492396e02d12964984e0ed273a00 (patch)
tree03e7c394c148a2af35cdc5227f156ff87de10cc0 /qa
parentc5ad5a082f85d2bcb5bb709198ac70812ae6c378 (diff)
downloadgitlab-ce-589f6b1907f1492396e02d12964984e0ed273a00.tar.gz
Set initial password for instance in LDAP QA testsh-ldap-set-first-password-qa
For a new instance, the root password needs to be set, regardless of whether LDAP is enabled.
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/main/login.rb25
1 files changed, 16 insertions, 9 deletions
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index 0d1ffd9694a..fd49b27cb1a 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -31,22 +31,29 @@ module QA
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
- click_link 'LDAP'
+ using_wait_time 0 do
+ set_initial_password_if_present
- fill_in :username, with: Runtime::User.name
- fill_in :password, with: Runtime::User.password
+ click_link 'LDAP'
- click_button 'Sign in'
+ fill_in :username, with: Runtime::User.name
+ fill_in :password, with: Runtime::User.password
+ click_button 'Sign in'
+ end
end
def sign_in_using_credentials
using_wait_time 0 do
- 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
+ set_initial_password_if_present
click_link 'Standard' if page.has_content?('LDAP')