Commit 1a3a1977 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'qa-257-instance-wide-saml-sso-ee' into 'master'

Port of qa-257-instance-wide-saml-sso to EE

See merge request gitlab-org/gitlab-ee!7881
parents e7d0eec1 f159040f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.d-flex.justify-content-between.flex-wrap .d-flex.justify-content-between.flex-wrap
- providers.each do |provider| - providers.each do |provider|
- has_icon = provider_has_icon?(provider) - has_icon = provider_has_icon?(provider)
= link_to omniauth_authorize_path(:user, provider), method: :post, class: 'btn d-flex align-items-center omniauth-btn text-left oauth-login', id: "oauth-login-#{provider}" do = link_to omniauth_authorize_path(:user, provider), method: :post, class: 'btn d-flex align-items-center omniauth-btn text-left oauth-login qa-saml-login-button', id: "oauth-login-#{provider}" do
- if has_icon - if has_icon
= provider_image_tag(provider) = provider_image_tag(provider)
%span %span
......
...@@ -97,6 +97,7 @@ module QA ...@@ -97,6 +97,7 @@ module QA
module Integration module Integration
autoload :Github, 'qa/scenario/test/integration/github' autoload :Github, 'qa/scenario/test/integration/github'
autoload :LDAP, 'qa/scenario/test/integration/ldap' autoload :LDAP, 'qa/scenario/test/integration/ldap'
autoload :InstanceSAML, 'qa/scenario/test/integration/instance_saml'
autoload :Kubernetes, 'qa/scenario/test/integration/kubernetes' autoload :Kubernetes, 'qa/scenario/test/integration/kubernetes'
autoload :Mattermost, 'qa/scenario/test/integration/mattermost' autoload :Mattermost, 'qa/scenario/test/integration/mattermost'
autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage' autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage'
......
...@@ -31,6 +31,10 @@ module QA ...@@ -31,6 +31,10 @@ module QA
element :register_tab element :register_tab
end end
view 'app/views/devise/shared/_omniauth_box.html.haml' do
element :saml_login_button
end
def initialize def initialize
# The login page is usually the entry point for all the scenarios so # The login page is usually the entry point for all the scenarios so
# we need to wait for the instance to start. That said, in some cases # we need to wait for the instance to start. That said, in some cases
...@@ -130,6 +134,11 @@ module QA ...@@ -130,6 +134,11 @@ module QA
click_element :sign_in_button click_element :sign_in_button
end end
def sign_in_with_saml
set_initial_password_if_present
click_element :saml_login_button
end
def sign_in_using_gitlab_credentials(user) def sign_in_using_gitlab_credentials(user)
switch_to_sign_in_tab if has_sign_in_tab? switch_to_sign_in_tab if has_sign_in_tab?
switch_to_standard_tab if has_standard_tab? switch_to_standard_tab if has_standard_tab?
......
...@@ -11,7 +11,7 @@ module QA ...@@ -11,7 +11,7 @@ module QA
end end
def accept_insecure_certs? def accept_insecure_certs?
(ENV['ACCEPT_INSECURE_CERTS'] =~ /^(false|no|0)$/i) != 0 enabled?(ENV['ACCEPT_INSECURE_CERTS'])
end end
def running_in_ci? def running_in_ci?
......
# frozen_string_literal: true
module QA
module Scenario
module Test
module Integration
class InstanceSAML < Test::Instance::All
tags :instance_saml
end
end
end
end
end
# frozen_string_literal: true
module QA
context :manage, :orchestrated, :instance_saml do
describe 'Instance wide SAML SSO' do
it 'User logs in to gitlab with SAML SSO' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_with_saml }
Vendor::SAMLIdp::Page::Login.act { login }
expect(page).to have_content('Welcome to GitLab')
end
end
end
end
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::InstanceSAML do
context '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:instance_saml] }
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment