diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 00:10:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 00:10:47 +0300 |
commit | 355a4a17ebbeb246e48954462163577ae77f45c0 (patch) | |
tree | 81aac8e172af511d87fcb9541508f69508bede84 /qa | |
parent | 7488eeff6fdf82ee7b926d684a201212b0509cbb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/main/login.rb | 12 | ||||
-rw-r--r-- | qa/qa/page/main/menu.rb | 15 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb | 7 | ||||
-rw-r--r-- | qa/qa/vendor/saml_idp/page/login.rb | 6 |
4 files changed, 38 insertions, 2 deletions
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb index d25b4efe85c..8812c792554 100644 --- a/qa/qa/page/main/login.rb +++ b/qa/qa/page/main/login.rb @@ -103,6 +103,12 @@ module QA click_element :sign_in_button end + if Runtime::Env.super_sidebar_enabled? + Page::Main::Menu.perform(&:enable_new_navigation) + else + Page::Main::Menu.perform(&:disable_new_navigation) + end + Page::Main::Menu.perform(&:signed_in?) end @@ -263,7 +269,11 @@ module QA wait_for_gitlab_to_respond - Page::Main::Menu.perform(&:enable_new_navigation) if Runtime::Env.super_sidebar_enabled? + if Runtime::Env.super_sidebar_enabled? + Page::Main::Menu.perform(&:enable_new_navigation) + else + Page::Main::Menu.perform(&:disable_new_navigation) + end wait_for_gitlab_to_respond diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb index bd2948ed39a..29c4360f814 100644 --- a/qa/qa/page/main/menu.rb +++ b/qa/qa/page/main/menu.rb @@ -33,6 +33,9 @@ module QA view 'app/assets/javascripts/super_sidebar/components/user_bar.vue' do element :super_sidebar_search_button element :stop_impersonation_btn + element :issues_shortcut_button, required: !Runtime::Env.phone_layout? + element :merge_requests_shortcut_button, required: !Runtime::Env.phone_layout? + element :todos_shortcut_button, required: !Runtime::Env.phone_layout? end view 'app/assets/javascripts/super_sidebar/components/global_search/components/global_search.vue' do @@ -278,11 +281,23 @@ module QA def enable_new_navigation Runtime::Logger.info("Enabling super sidebar!") return Runtime::Logger.info("User is not signed in, skipping") unless has_element?(:navbar, wait: 2) + return Runtime::Logger.info("Super sidebar is already enabled") if has_css?('[data-testid="super-sidebar"]') within_user_menu { click_element(:new_navigation_toggle) } end + def disable_new_navigation + Runtime::Logger.info("Disabling super sidebar!") + return Runtime::Logger.info("User is not signed in, skipping") unless has_element?(:navbar, wait: 2) + + unless has_css?('[data-testid="super-sidebar"]') + return Runtime::Logger.info("Super sidebar is already disabled") + end + + within_user_menu { click_element(:new_navigation_toggle) } + end + private def within_top_menu(&block) 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 cf9282c1149..84664cb8b94 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 @@ -43,7 +43,12 @@ module QA it( 'allows enforcing 2FA via UI and logging in with 2FA', - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347931' + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347931', + quarantine: { + type: :bug, + only: { condition: -> { !QA::Runtime::Env.super_sidebar_enabled? } }, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/409336' + } ) do enforce_two_factor_authentication_on_group(group) diff --git a/qa/qa/vendor/saml_idp/page/login.rb b/qa/qa/vendor/saml_idp/page/login.rb index dda9cd3758f..9b4fbe15366 100644 --- a/qa/qa/vendor/saml_idp/page/login.rb +++ b/qa/qa/vendor/saml_idp/page/login.rb @@ -11,6 +11,12 @@ module QA fill_in 'username', with: username fill_in 'password', with: password click_on 'Login' + + if Runtime::Env.super_sidebar_enabled? + QA::Page::Main::Menu.perform(&:enable_new_navigation) + else + QA::Page::Main::Menu.perform(&:disable_new_navigation) + end end def login_if_required(username, password) |