Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
e704f682
Commit
e704f682
authored
Jun 20, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[QA] Fix qa/qa/specs/features/login/ldap_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
27dea9aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+5
-1
qa/qa/specs/features/login/ldap_spec.rb
qa/qa/specs/features/login/ldap_spec.rb
+5
-1
No files found.
qa/qa/runtime/env.rb
View file @
e704f682
...
@@ -3,6 +3,8 @@ module QA
...
@@ -3,6 +3,8 @@ module QA
module
Env
module
Env
extend
self
extend
self
attr_writer
:user_type
# set to 'false' to have Chrome run visibly instead of headless
# set to 'false' to have Chrome run visibly instead of headless
def
chrome_headless?
def
chrome_headless?
(
ENV
[
'CHROME_HEADLESS'
]
=~
/^(false|no|0)$/i
)
!=
0
(
ENV
[
'CHROME_HEADLESS'
]
=~
/^(false|no|0)$/i
)
!=
0
...
@@ -20,7 +22,9 @@ module QA
...
@@ -20,7 +22,9 @@ module QA
# By default, "standard" denotes a standard GitLab user login.
# By default, "standard" denotes a standard GitLab user login.
# Set this to "ldap" if the user should be logged in via LDAP.
# Set this to "ldap" if the user should be logged in via LDAP.
def
user_type
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
)
unless
%w(ldap standard)
.
include?
(
type
)
raise
ArgumentError
.
new
(
"Invalid user type '
#{
type
}
': must be 'ldap' or 'standard'"
)
raise
ArgumentError
.
new
(
"Invalid user type '
#{
type
}
': must be 'ldap' or 'standard'"
)
end
end
...
...
qa/qa/specs/features/login/ldap_spec.rb
View file @
e704f682
module
QA
module
QA
feature
'LDAP user login'
,
:ldap
do
feature
'LDAP user login'
,
:ldap
do
before
do
Runtime
::
Env
.
user_type
=
'ldap'
end
scenario
'user logs in using LDAP credentials'
do
scenario
'user logs in using LDAP credentials'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
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
# TODO, since `Signed in successfully` message was removed
# this is the only way to tell if user is signed in correctly.
# this is the only way to tell if user is signed in correctly.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment