Commit e704f682 authored by Rémy Coutable's avatar Rémy Coutable

[QA] Fix qa/qa/specs/features/login/ldap_spec.rb

Signed-off-by: default avatarRémy Coutable <>
parent 27dea9aa
......@@ -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"Invalid user type '#{type}': must be 'ldap' or 'standard'")
module QA
feature 'LDAP user login', :ldap do
before do
Runtime::Env.user_type = 'ldap'
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.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment