summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-20 13:55:32 +0200
committerRémy Coutable <remy@rymai.me>2018-06-20 17:51:35 +0200
commite704f682f8856f28ed919d67d0ddbb78e767a151 (patch)
tree7d0a5bcb836e2546aa9fbc95ca8c72ca4ca111ad
parent27dea9aa24ab97bcc075b3aa2bc45f62131138c5 (diff)
downloadgitlab-ce-48159-qa-specs-features-login-ldap_spec-rb-is-failing-after-https-gitlab-com-gitlab-org-gitlab-ce-merge_requests-19964.tar.gz
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--qa/qa/runtime/env.rb6
-rw-r--r--qa/qa/specs/features/login/ldap_spec.rb6
2 files changed, 10 insertions, 2 deletions
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index 81d00d45753..2126ce6b234 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -3,6 +3,8 @@ module QA
module Env
extend self
+ attr_writer :user_type
+
# set to 'false' to have Chrome run visibly instead of headless
def chrome_headless?
(ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i) != 0
@@ -20,7 +22,9 @@ module QA
# By default, "standard" denotes a standard GitLab user login.
# Set this to "ldap" if the user should be logged in via LDAP.
def user_type
- (ENV['GITLAB_USER_TYPE'] || 'standard').tap do |type|
+ return @user_type if defined?(@user_type) # rubocop:disable Gitlab/ModuleWithInstanceVariables
+
+ ENV.fetch('GITLAB_USER_TYPE', 'standard').tap do |type|
unless %w(ldap standard).include?(type)
raise ArgumentError.new("Invalid user type '#{type}': must be 'ldap' or 'standard'")
end
diff --git a/qa/qa/specs/features/login/ldap_spec.rb b/qa/qa/specs/features/login/ldap_spec.rb
index ac2bd5a3c39..737f4d10053 100644
--- a/qa/qa/specs/features/login/ldap_spec.rb
+++ b/qa/qa/specs/features/login/ldap_spec.rb
@@ -1,8 +1,12 @@
module QA
feature 'LDAP user login', :ldap do
+ before do
+ Runtime::Env.user_type = 'ldap'
+ end
+
scenario 'user logs in using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_ldap_credentials }
+ Page::Main::Login.act { sign_in_using_credentials }
# TODO, since `Signed in successfully` message was removed
# this is the only way to tell if user is signed in correctly.