Merge branch 'sh-add-ldap-qa' into 'master'
Add QA specs for LDAP login See merge request gitlab-org/gitlab-ce!16914
This commit is contained in:
commit
586ecbc5d3
1
qa/qa.rb
1
qa/qa.rb
|
@ -64,6 +64,7 @@ module QA
|
|||
autoload :Instance, 'qa/scenario/test/instance'
|
||||
|
||||
module Integration
|
||||
autoload :LDAP, 'qa/scenario/test/integration/ldap'
|
||||
autoload :Mattermost, 'qa/scenario/test/integration/mattermost'
|
||||
end
|
||||
|
||||
|
|
|
@ -14,12 +14,32 @@ module QA
|
|||
element :sign_in_button, 'submit "Sign in"'
|
||||
end
|
||||
|
||||
view 'app/views/devise/sessions/_new_ldap.html.haml' do
|
||||
element :username_field, 'text_field_tag :username'
|
||||
element :password_field, 'password_field_tag :password'
|
||||
element :sign_in_button, 'submit_tag "Sign in"'
|
||||
end
|
||||
|
||||
view 'app/views/devise/shared/_tabs_ldap.html.haml' do
|
||||
element :ldap_tab, "link_to server['label']"
|
||||
element :standard_tab, "link_to 'Standard'"
|
||||
end
|
||||
|
||||
def initialize
|
||||
wait(max: 500) do
|
||||
page.has_css?('.application')
|
||||
end
|
||||
end
|
||||
|
||||
def sign_in_using_ldap_credentials
|
||||
click_link 'LDAP'
|
||||
|
||||
fill_in :username, with: Runtime::User.name
|
||||
fill_in :password, with: Runtime::User.password
|
||||
|
||||
click_button 'Sign in'
|
||||
end
|
||||
|
||||
def sign_in_using_credentials
|
||||
using_wait_time 0 do
|
||||
if page.has_content?('Change your password')
|
||||
|
@ -28,6 +48,8 @@ module QA
|
|||
click_button 'Change your password'
|
||||
end
|
||||
|
||||
click_link 'Standard' if page.has_content?('LDAP')
|
||||
|
||||
fill_in :user_login, with: Runtime::User.name
|
||||
fill_in :user_password, with: Runtime::User.password
|
||||
click_button 'Sign in'
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
module QA
|
||||
module Scenario
|
||||
module Test
|
||||
module Integration
|
||||
class LDAP < Test::Instance
|
||||
tags :ldap
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
module QA
|
||||
feature 'LDAP user login', :ldap do
|
||||
scenario 'user logs in using LDAP credentials' do
|
||||
Runtime::Browser.visit(:gitlab, Page::Main::Login)
|
||||
Page::Main::Login.act { sign_in_using_ldap_credentials }
|
||||
|
||||
# TODO, since `Signed in successfully` message was removed
|
||||
# this is the only way to tell if user is signed in correctly.
|
||||
#
|
||||
Page::Menu::Main.perform do |menu|
|
||||
expect(menu).to have_personal_area
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue