diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-08 18:09:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-08 18:09:45 +0300 |
commit | 4f0f7d580907e598013ad4b445db60ceacaa4724 (patch) | |
tree | 96f8b3224f962ff7011611cfdfa65bdbe079c5cd /qa | |
parent | 148b75b329294f6b6ae409bbf8d70590e63c6bc9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
4 files changed, 17 insertions, 6 deletions
diff --git a/qa/qa/page/profile/two_factor_auth.rb b/qa/qa/page/profile/two_factor_auth.rb index 6794825769a..a0dd230d8ab 100644 --- a/qa/qa/page/profile/two_factor_auth.rb +++ b/qa/qa/page/profile/two_factor_auth.rb @@ -14,8 +14,9 @@ module QA element :register_2fa_app_button end - view 'app/views/profiles/two_factor_auths/_codes.html.haml' do + view 'app/assets/javascripts/authentication/two_factor_auth/components/recovery_codes.vue' do element :proceed_button + element :copy_button element :codes_content element :code_content end @@ -43,7 +44,8 @@ module QA code_elements.map { |code_content| code_content.text } end - def click_proceed_button + def click_copy_and_proceed + click_element :copy_button click_element :proceed_button end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb index 163469e1e88..a6b4a8108a3 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb @@ -29,6 +29,7 @@ module QA end before do + Runtime::Feature.enable('vue_2fa_recovery_codes', user: developer_user) group.add_member(developer_user, Resource::Members::AccessLevel::DEVELOPER) end @@ -57,6 +58,7 @@ module QA end after do + Runtime::Feature.disable('vue_2fa_recovery_codes', user: developer_user) group.set_require_two_factor_authentication(value: 'false') group.remove_via_api! sandbox_group.remove_via_api! @@ -81,7 +83,7 @@ module QA recovery_code = two_fa_auth.recovery_codes.sample - two_fa_auth.click_proceed_button + two_fa_auth.click_copy_and_proceed recovery_code end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb index 7f3c3049499..7ebbe7887b9 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb @@ -16,6 +16,7 @@ module QA end before do + Runtime::Feature.enable('vue_2fa_recovery_codes', user: user) enable_2fa_for_user(user) end @@ -46,6 +47,10 @@ module QA expect(page).to have_text('Invalid two-factor code') end + after do + Runtime::Feature.disable('vue_2fa_recovery_codes', user: user) + end + def enable_2fa_for_user(user) Flow::Login.while_signed_in(as: user) do Page::Main::Menu.perform(&:click_settings_link) @@ -56,7 +61,7 @@ module QA otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) two_fa_auth.set_pin_code(otp.fresh_otp) two_fa_auth.click_register_2fa_app_button - two_fa_auth.click_proceed_button + two_fa_auth.click_copy_and_proceed end end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb index 12a1b419f8b..1f0215cd929 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb @@ -31,6 +31,7 @@ module QA let(:two_fa_expected_text) { /The group settings for.*require you to enable Two-Factor Authentication for your account.*You need to do this before/ } before do + Runtime::Feature.enable('vue_2fa_recovery_codes', user: developer_user) group.add_member(developer_user, Resource::Members::AccessLevel::DEVELOPER) end @@ -57,6 +58,7 @@ module QA end after do + Runtime::Feature.disable('vue_2fa_recovery_codes', user: developer_user) group.set_require_two_factor_authentication(value: 'false') group.remove_via_api! do |resource| resource.api_client = admin_api_client @@ -99,9 +101,9 @@ module QA two_fa_auth.set_pin_code(@otp.fresh_otp) two_fa_auth.click_register_2fa_app_button - expect(two_fa_auth).to have_text('Congratulations! You have enabled Two-factor Authentication!') + two_fa_auth.click_copy_and_proceed - two_fa_auth.click_proceed_button + expect(two_fa_auth).to have_text('Congratulations! You have enabled Two-factor Authentication!') end end end |