Commit ae532993 authored by Sanad Liaquat's avatar Sanad Liaquat

Added admin test

parent a225a849
......@@ -68,6 +68,12 @@ module QA
end
end
def has_admin_area_link?(wait: Capybara.default_max_wait_time)
using_wait_time(wait) do
page.has_selector?(element_selector_css(:admin_area_link))
end
end
private
def within_top_menu
......
# frozen_string_literal: true
module QA
# context 'Manage', :orchestrated, :ldap_tls do
context 'Manage' do
describe 'LDAP Group Sync' do
context 'Manage', :orchestrated, :ldap_tls, :ldap_no_tls do
describe 'LDAP Sync' do
it 'syncs admin users' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform do |login_page|
login_page.sign_in_using_ldap_credentials(username: 'adminuser1', password: 'password')
end
Page::Main::Menu.perform do |menu|
expect(menu).to have_personal_area
# The ldap_sync_worker_cron job is set to run every minute
admin_synchronised = menu.wait(max: 65, time: 1, reload: true) do
menu.has_admin_area_link?
end
expect(admin_synchronised).to be_truthy
end
end
it 'Has LDAP user synced using group cn method' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
......@@ -74,15 +93,14 @@ module QA
end
def verify_users_synched(expected_users)
users_synchronised = false
EE::Page::Group::Members.perform do |page|
page.click_sync_now
users_synchronised = page.with_retry(reload: true) do
expected_users.map { |user| page.has_content?(user) }.reduce(true) { |a, b| a && b }
end
expect(users_synchronised).to be_truthy
end
expect(users_synchronised).to be_truthy
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