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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0932417d
Commit
0932417d
authored
Nov 12, 2018
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now creating users via api
parent
77137a29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
18 deletions
+59
-18
qa/qa/resource/user.rb
qa/qa/resource/user.rb
+12
-2
qa/qa/specs/features/browser_ui/1_manage/ee_group/group_ldap_sync_spec.rb
...ures/browser_ui/1_manage/ee_group/group_ldap_sync_spec.rb
+47
-16
No files found.
qa/qa/resource/user.rb
View file @
0932417d
...
...
@@ -6,7 +6,8 @@ module QA
module
Resource
class
User
<
Base
attr_reader
:unique_id
attr_writer
:username
,
:password
attr_writer
:username
,
:password
,
:name
,
:email
attr_accessor
:provider
,
:extern_uid
def
initialize
@unique_id
=
SecureRandom
.
hex
(
8
)
...
...
@@ -73,7 +74,7 @@ module QA
username:
username
,
name:
name
,
skip_confirmation:
true
}
}
.
merge
(
ldap_post_body
)
end
def
self
.
fabricate_or_use
(
username
,
password
)
...
...
@@ -89,6 +90,15 @@ module QA
private
def
ldap_post_body
return
{}
unless
extern_uid
&&
provider
{
extern_uid:
extern_uid
,
provider:
provider
}
end
def
fetch_id
(
username
)
users
=
parse_body
(
api_get_from
(
"/users?username=
#{
username
}
"
))
...
...
qa/qa/specs/features/browser_ui/1_manage/ee_group/group_ldap_sync_spec.rb
View file @
0932417d
# frozen_string_literal: true
module
QA
context
'Manage'
do
context
'Manage'
,
:orchestrated
,
:ldap_tls
,
:ldap_no_tls
do
describe
'LDAP Group Sync'
do
it
'Has LDAP user synced using group cn method'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
# Login users to create them
login_logout_users
(
%w[enguser3 enguser2]
)
users
=
[
{
name:
'ENG User 2'
,
username:
'enguser2'
,
email:
'enguser2@example.org'
,
provider:
'ldapmain'
,
extern_uid:
'uid=enguser2,ou=people,ou=global groups,dc=example,dc=org'
},
{
name:
'ENG User 3'
,
username:
'enguser3'
,
email:
'enguser3@example.org'
,
provider:
'ldapmain'
,
extern_uid:
'uid=enguser3,ou=people,ou=global groups,dc=example,dc=org'
}
]
create_users_via_api
(
users
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
create_sandbox_group_with_user
(
user:
'enguser1'
,
group_name:
'Synched-engineering-group'
)
EE
::
Page
::
Group
::
Menu
.
perform
(
&
:go_to_ldap_sync_settings
)
...
...
@@ -25,10 +40,26 @@ module QA
end
it
'Has LDAP user synced using user filter method'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
users
=
[
{
name:
'HR User 2'
,
username:
'hruser2'
,
email:
'hruser2@example.org'
,
provider:
'ldapmain'
,
extern_uid:
'uid=hruser2,ou=people,ou=global groups,dc=example,dc=org'
},
{
name:
'HR User 3'
,
username:
'hruser3'
,
email:
'hruser3@example.org'
,
provider:
'ldapmain'
,
extern_uid:
'uid=hruser3,ou=people,ou=global groups,dc=example,dc=org'
}
]
create_users_via_api
(
users
)
# Login users to create them
login_logout_users
(
%w[hruser3 hruser2]
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
create_sandbox_group_with_user
(
user:
'hruser1'
,
group_name:
'Synched-human-resources-group'
)
...
...
@@ -44,18 +75,18 @@ module QA
verify_users_synched
([
'HR User 2'
,
'HR User 3'
])
end
def
login_logout_users
(
users
)
def
create_users_via_api
(
users
)
users
.
each
do
|
user
|
Page
::
Main
::
Login
.
perform
do
|
login_page
|
login_page
.
sign_in_using_ldap_credentials
(
username:
user
,
password:
'password'
)
Resource
::
User
.
fabricate_via_api!
do
|
resource
|
resource
.
username
=
user
[
:username
]
resource
.
name
=
user
[
:name
]
resource
.
email
=
user
[
:email
]
resource
.
extern_uid
=
user
[
:extern_uid
]
resource
.
provider
=
user
[
:provider
]
end
end
Page
::
Main
::
Menu
.
perform
do
|
menu
|
expect
(
menu
).
to
have_personal_area
end
Page
::
Main
::
Menu
.
perform
(
&
:sign_out
)
end
end
def
create_sandbox_group_with_user
(
user:
nil
,
group_name:
nil
)
...
...
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