Commit 50646a85 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'disable-sign-ups-tunnel' into 'master'

Allow disabling of new sign ups for tunnel admin user

See merge request gitlab-org/gitlab!50035
parents 2bdee626 9f83865f
......@@ -4,7 +4,7 @@
%fieldset
.form-group
.form-check
= f.check_box :signup_enabled, class: 'form-check-input'
= f.check_box :signup_enabled, class: 'form-check-input', data: { qa_selector: 'signup_enabled_checkbox' }
= f.label :signup_enabled, class: 'form-check-label' do
Sign-up enabled
.form-text.text-muted
......
......@@ -37,6 +37,19 @@ module QA
raise "Failed to register the user" unless success
end
def disable_sign_ups
Flow::Login.sign_in_as_admin
Page::Main::Menu.perform(&:go_to_admin_area)
Page::Admin::Menu.perform(&:go_to_general_settings)
Page::Admin::Settings::General.perform do |general_settings|
general_settings.expand_sign_up_restrictions do |signup_settings|
signup_settings.disable_signups
signup_settings.save_changes
end
end
end
end
end
end
......@@ -8,6 +8,7 @@ module QA
class SignUpRestrictions < Page::Base
view 'app/views/admin/application_settings/_signup.html.haml' do
element :require_admin_approval_after_user_signup_checkbox
element :signup_enabled_checkbox
element :save_changes_button
end
......@@ -15,6 +16,11 @@ module QA
check_element :require_admin_approval_after_user_signup_checkbox
click_element :save_changes_button
end
def disable_signups
uncheck_element :signup_enabled_checkbox
click_element :save_changes_button
end
end
end
end
......
# frozen_string_literal: true
module QA
module Scenario
module Test
module Integration
class SSHTunnel < Test::Instance::All
tags :ssh_tunnel
end
end
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