summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-02-14 21:27:06 -0800
committerStan Hu <stanhu@gmail.com>2018-02-14 21:27:06 -0800
commit07b6ad351a966eed6ed4ae60145def2d8ab60ac7 (patch)
tree7c1f9d642a40a604fa8cb69788f6a51f2cee8de6 /qa
parentdd633bc1888453a07474d045eca91a9e66302ce0 (diff)
downloadgitlab-ce-07b6ad351a966eed6ed4ae60145def2d8ab60ac7.tar.gz
Add LDAP_USERNAME and LDAP_PASSWORD user environment variables for QAsh-add-env-variables-for-ldap-qa
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/main/login.rb4
-rw-r--r--qa/qa/runtime/env.rb8
-rw-r--r--qa/qa/runtime/user.rb8
3 files changed, 18 insertions, 2 deletions
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index a8a5601dbe6..596205fe540 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -53,8 +53,8 @@ module QA
click_link 'LDAP'
- fill_in :username, with: Runtime::User.name
- fill_in :password, with: Runtime::User.password
+ fill_in :username, with: Runtime::User.ldap_username
+ fill_in :password, with: Runtime::User.ldap_password
click_button 'Sign in'
end
end
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index 5401372e225..fe432edfa2a 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -35,6 +35,14 @@ module QA
ENV['GITLAB_PASSWORD']
end
+ def ldap_username
+ ENV['GITLAB_LDAP_USERNAME']
+ end
+
+ def ldap_password
+ ENV['GITLAB_LDAP_PASSWORD']
+ end
+
def sandbox_name
ENV['GITLAB_SANDBOX_NAME']
end
diff --git a/qa/qa/runtime/user.rb b/qa/qa/runtime/user.rb
index ecc9ab321ba..c80ee6d4d96 100644
--- a/qa/qa/runtime/user.rb
+++ b/qa/qa/runtime/user.rb
@@ -18,6 +18,14 @@ module QA
def ldap_user?
Runtime::Env.user_type == 'ldap'
end
+
+ def ldap_username
+ Runtime::Env.ldap_username || name
+ end
+
+ def ldap_password
+ Runtime::Env.ldap_password || password
+ end
end
end
end