Commit edd83af0 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Merge branch 'shl-fix-2fa-e2e-tests' into 'master'

Fix 2FA e2e tests by setting user password

See merge request gitlab-org/gitlab!71528
parents 5cdebc47 04565a60
...@@ -11,6 +11,7 @@ module QA ...@@ -11,6 +11,7 @@ module QA
view 'app/views/profiles/two_factor_auths/show.html.haml' do view 'app/views/profiles/two_factor_auths/show.html.haml' do
element :otp_secret_content element :otp_secret_content
element :pin_code_field element :pin_code_field
element :current_password_field
element :register_2fa_app_button element :register_2fa_app_button
end end
...@@ -33,6 +34,10 @@ module QA ...@@ -33,6 +34,10 @@ module QA
fill_element(:pin_code_field, pin_code) fill_element(:pin_code_field, pin_code)
end end
def set_current_password(password)
fill_element(:current_password_field, password)
end
def click_register_2fa_app_button def click_register_2fa_app_button
click_element :register_2fa_app_button click_element :register_2fa_app_button
end end
......
...@@ -78,6 +78,7 @@ module QA ...@@ -78,6 +78,7 @@ module QA
@otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) @otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content)
two_fa_auth.set_pin_code(@otp.fresh_otp) two_fa_auth.set_pin_code(@otp.fresh_otp)
two_fa_auth.set_current_password(user.password)
two_fa_auth.click_register_2fa_app_button two_fa_auth.click_register_2fa_app_button
recovery_code = two_fa_auth.recovery_codes.sample recovery_code = two_fa_auth.recovery_codes.sample
......
...@@ -55,6 +55,7 @@ module QA ...@@ -55,6 +55,7 @@ module QA
Page::Profile::TwoFactorAuth.perform do |two_fa_auth| Page::Profile::TwoFactorAuth.perform do |two_fa_auth|
otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content)
two_fa_auth.set_pin_code(otp.fresh_otp) two_fa_auth.set_pin_code(otp.fresh_otp)
two_fa_auth.set_current_password(user.password)
two_fa_auth.click_register_2fa_app_button two_fa_auth.click_register_2fa_app_button
two_fa_auth.click_copy_and_proceed two_fa_auth.click_copy_and_proceed
end end
......
...@@ -98,6 +98,7 @@ module QA ...@@ -98,6 +98,7 @@ module QA
@otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) @otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content)
two_fa_auth.set_pin_code(@otp.fresh_otp) two_fa_auth.set_pin_code(@otp.fresh_otp)
two_fa_auth.set_current_password(user.password)
two_fa_auth.click_register_2fa_app_button two_fa_auth.click_register_2fa_app_button
two_fa_auth.click_copy_and_proceed two_fa_auth.click_copy_and_proceed
......
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