diff options
author | Mark Lapierre <mlapierre@gitlab.com> | 2018-10-01 16:31:12 -0400 |
---|---|---|
committer | Mark Lapierre <mlapierre@gitlab.com> | 2018-10-10 10:13:54 -0400 |
commit | a9f6d55e79ccab1e1f54cb9a605b32d5f15e7465 (patch) | |
tree | 6b4ff0f399d98b7856963eb664a35c1afcf1a8d2 /qa/qa/page/main/sign_up.rb | |
parent | 1c51a6bed7e32c5379c475779288fc7f957093f8 (diff) | |
download | gitlab-ce-a9f6d55e79ccab1e1f54cb9a605b32d5f15e7465.tar.gz |
Retry registration 3 times before failing
Registration intermittently fails without an obvious cause.
The action to click the button seems to move focus to the right button
but nothing happens.
This change attempts to retry the action under the assumption that
Capybara or Chrome is misbehaving.
It also updates the selectors for the sign up page.
Diffstat (limited to 'qa/qa/page/main/sign_up.rb')
-rw-r--r-- | qa/qa/page/main/sign_up.rb | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/qa/qa/page/main/sign_up.rb b/qa/qa/page/main/sign_up.rb index dddda4f2bdf..b33ea03fc55 100644 --- a/qa/qa/page/main/sign_up.rb +++ b/qa/qa/page/main/sign_up.rb @@ -1,25 +1,32 @@ +# frozen_string_literal: true + module QA module Page module Main class SignUp < Page::Base view 'app/views/devise/shared/_signup_box.html.haml' do - element :name, 'text_field :name' - element :username, 'text_field :username' - element :email_field, 'email_field :email' - element :email_confirmation, 'email_field :email_confirmation' - element :password, 'password_field :password' - element :register_button, 'submit "Register"' + element :new_user_name + element :new_user_username + element :new_user_email + element :new_user_email_confirmation + element :new_user_password + element :new_user_register_button end def sign_up!(user) - fill_in :new_user_name, with: user.name - fill_in :new_user_username, with: user.username - fill_in :new_user_email, with: user.email - fill_in :new_user_email_confirmation, with: user.email - fill_in :new_user_password, with: user.password - click_button 'Register' + fill_element :new_user_name, user.name + fill_element :new_user_username, user.username + fill_element :new_user_email, user.email + fill_element :new_user_email_confirmation, user.email + fill_element :new_user_password, user.password + + signed_in = with_retry do + click_element :new_user_register_button + + Page::Main::Menu.act { has_personal_area? } + end - Page::Main::Menu.act { assert_has_personal_area } + raise "Failed to register and sign in" unless signed_in end end end |