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
2523d2be
Commit
2523d2be
authored
Oct 03, 2018
by
Sanad Liaquat
Committed by
Rémy Coutable
Oct 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Group SAML SSO qa e2e test
parent
c3e71bbc
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
246 additions
and
4 deletions
+246
-4
.rubocop.yml
.rubocop.yml
+2
-0
app/views/layouts/nav/sidebar/_group.html.haml
app/views/layouts/nav/sidebar/_group.html.haml
+3
-3
ee/app/views/groups/ee/_settings_nav.html.haml
ee/app/views/groups/ee/_settings_nav.html.haml
+1
-1
qa/qa.rb
qa/qa.rb
+12
-0
qa/qa/ee.rb
qa/qa/ee.rb
+12
-0
qa/qa/ee/page/group/saml_sso_sign_in.rb
qa/qa/ee/page/group/saml_sso_sign_in.rb
+19
-0
qa/qa/ee/page/group/settings/saml_sso.rb
qa/qa/ee/page/group/settings/saml_sso.rb
+39
-0
qa/qa/ee/page/menu/side.rb
qa/qa/ee/page/menu/side.rb
+50
-0
qa/qa/ee/runtime/env.rb
qa/qa/ee/runtime/env.rb
+4
-0
qa/qa/ee/scenario/test/integration/group_saml.rb
qa/qa/ee/scenario/test/integration/group_saml.rb
+16
-0
qa/qa/runtime/browser.rb
qa/qa/runtime/browser.rb
+4
-0
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+4
-0
qa/qa/specs/features/browser_ui/1_manage/ee_group/group_saml_sso_spec.rb
...tures/browser_ui/1_manage/ee_group/group_saml_sso_spec.rb
+38
-0
qa/qa/vendor/saml_idp/page/base.rb
qa/qa/vendor/saml_idp/page/base.rb
+14
-0
qa/qa/vendor/saml_idp/page/login.rb
qa/qa/vendor/saml_idp/page/login.rb
+19
-0
qa/spec/ee/scenario/test/integration/group_saml_spec.rb
qa/spec/ee/scenario/test/integration/group_saml_spec.rb
+9
-0
No files found.
.rubocop.yml
View file @
2523d2be
...
...
@@ -75,6 +75,8 @@ Naming/FileName:
-
EE
-
JSON
-
LDAP
-
SAML
-
SSO
-
IO
-
HMAC
-
QA
...
...
app/views/layouts/nav/sidebar/_group.html.haml
View file @
2523d2be
...
...
@@ -10,7 +10,7 @@
=
group_icon
(
@group
,
class:
"avatar s40 avatar-tile"
)
.sidebar-context-title
=
@group
.
name
%ul
.sidebar-top-level-items
%ul
.sidebar-top-level-items
.qa-group-sidebar
-
if
group_sidebar_link?
(
:overview
)
=
nav_link
(
path:
[
'groups#show'
,
'groups#activity'
,
'groups#subgroups'
,
'analytics#show'
],
html_options:
{
class:
'home'
})
do
=
link_to
group_path
(
@group
)
do
...
...
@@ -117,9 +117,9 @@
=
link_to
edit_group_path
(
@group
)
do
.nav-icon-container
=
sprite_icon
(
'settings'
)
%span
.nav-item-name.qa-settings-item
%span
.nav-item-name.qa-
group-
settings-item
=
_
(
'Settings'
)
%ul
.sidebar-sub-level-items
%ul
.sidebar-sub-level-items
.qa-group-sidebar-submenu
=
nav_link
(
path:
%w[groups#projects groups#edit badges#index ci_cd#show]
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
edit_group_path
(
@group
)
do
%strong
.fly-out-top-item-name
...
...
ee/app/views/groups/ee/_settings_nav.html.haml
View file @
2523d2be
...
...
@@ -6,7 +6,7 @@
-
if
show_saml_in_sidebar?
(
@group
)
=
nav_link
(
path:
'saml_providers#show'
)
do
=
link_to
group_saml_providers_path
(
@group
),
title:
'SAML SSO'
do
=
link_to
group_saml_providers_path
(
@group
),
title:
'SAML SSO'
,
class:
'qa-group-saml-sso-link'
do
%span
SAML SSO
...
...
qa/qa.rb
View file @
2523d2be
...
...
@@ -286,6 +286,18 @@ module QA
autoload
:Config
,
'qa/specs/config'
autoload
:Runner
,
'qa/specs/runner'
end
##
# Classes that describe the structure of vendor/third party application pages
#
module
Vendor
module
SAMLIdp
module
Page
autoload
:Base
,
'qa/vendor/saml_idp/page/base'
autoload
:Login
,
'qa/vendor/saml_idp/page/login'
end
end
end
end
QA
::
Runtime
::
Release
.
extend_autoloads!
qa/qa/ee.rb
View file @
2523d2be
...
...
@@ -13,12 +13,21 @@ module QA
autoload
:Projects
,
'qa/ee/page/dashboard/projects'
end
module
Group
autoload
:SamlSSOSignIn
,
'qa/ee/page/group/saml_sso_sign_in'
module
Settings
autoload
:SamlSSO
,
'qa/ee/page/group/settings/saml_sso'
end
end
module
Main
autoload
:Banner
,
'qa/ee/page/main/banner'
end
module
Menu
autoload
:Admin
,
'qa/ee/page/menu/admin'
autoload
:Side
,
'qa/ee/page/menu/side'
end
module
Admin
...
...
@@ -60,6 +69,9 @@ module QA
module
Scenario
module
Test
autoload
:Geo
,
'qa/ee/scenario/test/geo'
module
Integration
autoload
:GroupSAML
,
'qa/ee/scenario/test/integration/group_saml'
end
end
end
end
...
...
qa/qa/ee/page/group/saml_sso_sign_in.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Group
class
SamlSSOSignIn
<
QA
::
Page
::
Base
view
'ee/app/views/groups/sso/saml.html.haml'
do
element
:saml_sso_signin_button
end
def
click_signin
click_element
:saml_sso_signin_button
end
end
end
end
end
end
qa/qa/ee/page/group/settings/saml_sso.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Group
module
Settings
class
SamlSSO
<
::
QA
::
Page
::
Base
view
'ee/app/views/groups/saml_providers/_form.html.haml'
do
element
:identity_provider_sso_field
element
:certificate_fingerprint_field
element
:save_changes_button
end
view
'ee/app/views/groups/saml_providers/_info.html.haml'
do
element
:user_login_url_link
end
def
set_id_provider_sso_url
(
url
)
fill_element
:identity_provider_sso_field
,
url
end
def
set_cert_fingerprint
(
fingerprint
)
fill_element
:certificate_fingerprint_field
,
fingerprint
end
def
click_save_changes
click_element
:save_changes_button
end
def
click_user_login_url_link
click_element
:user_login_url_link
end
end
end
end
end
end
end
qa/qa/ee/page/menu/side.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Menu
class
Side
<
::
QA
::
Page
::
Base
view
'ee/app/views/groups/ee/_settings_nav.html.haml'
do
element
:group_saml_sso_link
end
view
'app/views/layouts/nav/sidebar/_group.html.haml'
do
element
:group_sidebar
element
:group_sidebar_submenu
element
:group_settings_item
end
def
go_to_saml_sso_group_settings
hover_settings
do
within_submenu
do
click_element
:group_saml_sso_link
end
end
end
private
def
hover_settings
within_sidebar
do
find_element
(
:group_settings_item
).
hover
yield
end
end
def
within_sidebar
within_element
(
:group_sidebar
)
do
yield
end
end
def
within_submenu
within_element
(
:group_sidebar_submenu
)
do
yield
end
end
end
end
end
end
end
qa/qa/ee/runtime/env.rb
View file @
2523d2be
...
...
@@ -10,6 +10,10 @@ module QA
def
geo_max_file_replication_time
ENV
[
'GEO_MAX_FILE_REPLICATION_TIME'
]
end
def
simple_saml_hostname
ENV
[
'SIMPLE_SAML_HOSTNAME'
]
end
end
end
end
...
...
qa/qa/ee/scenario/test/integration/group_saml.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
module
QA
module
EE
module
Scenario
module
Test
module
Integration
class
GroupSAML
<
QA
::
Scenario
::
Template
include
QA
::
Scenario
::
Bootable
tags
:group_saml
end
end
end
end
end
end
qa/qa/runtime/browser.rb
View file @
2523d2be
...
...
@@ -51,6 +51,10 @@ module QA
}
)
if
QA
::
Runtime
::
Env
.
accept_insecure_certs?
capabilities
[
'acceptInsecureCerts'
]
=
true
end
options
=
Selenium
::
WebDriver
::
Chrome
::
Options
.
new
options
.
add_argument
(
"window-size=1240,1680"
)
...
...
qa/qa/runtime/env.rb
View file @
2523d2be
...
...
@@ -10,6 +10,10 @@ module QA
(
ENV
[
'CHROME_HEADLESS'
]
=~
/^(false|no|0)$/i
)
!=
0
end
def
accept_insecure_certs?
(
ENV
[
'ACCEPT_INSECURE_CERTS'
]
=~
/^(false|no|0)$/i
)
!=
0
end
def
running_in_ci?
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
]
end
...
...
qa/qa/specs/features/browser_ui/1_manage/ee_group/group_saml_sso_spec.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
module
QA
context
:manage
,
:orchestrated
,
:group_saml
do
describe
'Group SAML SSO'
do
it
'User logs in to group with SAML SSO'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Factory
::
Resource
::
Sandbox
.
fabricate!
EE
::
Page
::
Menu
::
Side
.
act
{
go_to_saml_sso_group_settings
}
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
act
do
set_id_provider_sso_url
(
"https://
#{
QA
::
Runtime
::
Env
.
simple_saml_hostname
||
'localhost'
}
:8443/simplesaml/saml2/idp/SSOService.php"
)
set_cert_fingerprint
(
'119b9e027959cdb7c662cfd075d9e2ef384e445f'
)
click_save_changes
click_user_login_url_link
end
EE
::
Page
::
Group
::
SamlSSOSignIn
.
act
{
click_signin
}
Vendor
::
SAMLIdp
::
Page
::
Login
.
act
{
login
}
expect
(
page
).
to
have_content
(
"SAML for
#{
Runtime
::
Env
.
sandbox_name
}
was added to your connected accounts"
)
EE
::
Page
::
Menu
::
Side
.
act
{
go_to_saml_sso_group_settings
}
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
act
{
click_user_login_url_link
}
EE
::
Page
::
Group
::
SamlSSOSignIn
.
act
{
click_signin
}
expect
(
page
).
to
have_content
(
"Signed in with SAML for
#{
Runtime
::
Env
.
sandbox_name
}
"
)
end
end
end
end
qa/qa/vendor/saml_idp/page/base.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
module
QA
module
Vendor
module
SAMLIdp
module
Page
class
Base
include
Capybara
::
DSL
include
Scenario
::
Actable
end
end
end
end
end
qa/qa/vendor/saml_idp/page/login.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
require
'capybara/dsl'
module
QA
module
Vendor
module
SAMLIdp
module
Page
class
Login
<
Page
::
Base
def
login
fill_in
'username'
,
with:
'user1'
fill_in
'password'
,
with:
'user1pass'
click_on
'Login'
end
end
end
end
end
end
qa/spec/ee/scenario/test/integration/group_saml_spec.rb
0 → 100644
View file @
2523d2be
# frozen_string_literal: true
describe
QA
::
EE
::
Scenario
::
Test
::
Integration
::
GroupSAML
do
context
'#perform'
do
it_behaves_like
'a QA scenario class'
do
let
(
:tags
)
{
[
:group_saml
]
}
end
end
end
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