From 2b3dab6f837b28ce4fd741d0e3e100e3a6a6e98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 15 Oct 2018 17:06:18 +0200 Subject: [PATCH] [QA] Handle sign-up when terms must be accepted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/views/devise/shared/_signup_box.html.haml | 2 +- qa/qa/page/main/sign_up.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 9a827523ed4..004a3528d4b 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -24,7 +24,7 @@ %p.gl-field-hint.text-secondary Minimum length is #{@minimum_password_length} characters - if Gitlab::CurrentSettings.current_application_settings.enforce_terms? .form-group - = check_box_tag :terms_opt_in, '1', false, required: true + = check_box_tag :terms_opt_in, '1', false, required: true, class: 'qa-new-user-accept-terms' = label_tag :terms_opt_in do - terms_link = link_to s_("I accept the|Terms of Service and Privacy Policy"), terms_path, target: "_blank" - accept_terms_label = _("I accept the %{terms_link}") % { terms_link: terms_link } diff --git a/qa/qa/page/main/sign_up.rb b/qa/qa/page/main/sign_up.rb index b33ea03fc55..9ca498012eb 100644 --- a/qa/qa/page/main/sign_up.rb +++ b/qa/qa/page/main/sign_up.rb @@ -11,6 +11,7 @@ module QA element :new_user_email_confirmation element :new_user_password element :new_user_register_button + element :new_user_accept_terms end def sign_up!(user) @@ -20,6 +21,8 @@ module QA fill_element :new_user_email_confirmation, user.email fill_element :new_user_password, user.password + check_element :new_user_accept_terms if has_element?(:new_user_accept_terms) + signed_in = with_retry do click_element :new_user_register_button