Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-30 12:10:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-30 12:10:26 +0300
commite820415ceab5819ea8a29174543f9246b608b5fd (patch)
tree61b09e0bb6132ca630972f35a862b1a857387669 /qa
parent488c34c7ebb40740a7f15f26acfb4de9b12462a4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/dashboard/snippet/index.rb13
-rw-r--r--qa/qa/page/group/menu.rb3
-rw-r--r--qa/qa/page/group/sub_menus/super_sidebar/common.rb24
-rw-r--r--qa/qa/page/group/sub_menus/super_sidebar/settings.rb33
-rw-r--r--qa/qa/page/main/login.rb2
-rw-r--r--qa/qa/page/main/menu.rb28
-rw-r--r--qa/qa/page/profile/menu.rb8
-rw-r--r--qa/qa/page/profile/super_sidebar/menu.rb27
-rw-r--r--qa/qa/page/project/import/repo_by_url.rb9
-rw-r--r--qa/qa/resource/snippet.rb4
-rw-r--r--qa/qa/runtime/application_settings.rb3
11 files changed, 110 insertions, 44 deletions
diff --git a/qa/qa/page/dashboard/snippet/index.rb b/qa/qa/page/dashboard/snippet/index.rb
index 088fff17578..51d7bd3f20b 100644
--- a/qa/qa/page/dashboard/snippet/index.rb
+++ b/qa/qa/page/dashboard/snippet/index.rb
@@ -5,25 +5,12 @@ module QA
module Dashboard
module Snippet
class Index < Page::Base
- view 'app/views/layouts/header/_new_dropdown.html.haml' do
- element :new_menu_toggle
- end
-
- view 'app/helpers/nav/new_dropdown_helper.rb' do
- element :global_new_snippet_link
- end
-
view 'app/views/shared/snippets/_snippet.html.haml' do
element :snippet_link
element :snippet_visibility_content
element :snippet_file_count_content
end
- def go_to_new_snippet_page
- click_element :new_menu_toggle
- click_element :global_new_snippet_link
- end
-
def has_snippet_title?(snippet_title)
has_element?(:snippet_link, snippet_title: snippet_title)
end
diff --git a/qa/qa/page/group/menu.rb b/qa/qa/page/group/menu.rb
index 9418593133e..c0af4af464b 100644
--- a/qa/qa/page/group/menu.rb
+++ b/qa/qa/page/group/menu.rb
@@ -5,6 +5,7 @@ module QA
module Group
class Menu < Page::Base
include SubMenus::Common
+ include SubMenus::SuperSidebar::Settings if Runtime::Env.super_sidebar_enabled?
def click_group_members_item
hover_group_information do
@@ -29,6 +30,8 @@ module QA
end
def click_group_general_settings_item
+ return go_to_general_settings if Runtime::Env.super_sidebar_enabled?
+
hover_group_settings do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'General')
diff --git a/qa/qa/page/group/sub_menus/super_sidebar/common.rb b/qa/qa/page/group/sub_menus/super_sidebar/common.rb
new file mode 100644
index 00000000000..dc1975c0044
--- /dev/null
+++ b/qa/qa/page/group/sub_menus/super_sidebar/common.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Group
+ module SubMenus
+ module SuperSidebar
+ module Common
+ private
+
+ def open_submenu(parent_menu_name, parent_section_id, sub_menu)
+ click_element(:sidebar_menu_link, menu_item: parent_menu_name)
+
+ # TODO: it's not possible to add qa-selectors to sub-menu containers at the moment
+ within(parent_section_id) do
+ click_element(:sidebar_menu_link, menu_item: sub_menu)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/group/sub_menus/super_sidebar/settings.rb b/qa/qa/page/group/sub_menus/super_sidebar/settings.rb
new file mode 100644
index 00000000000..b0501454413
--- /dev/null
+++ b/qa/qa/page/group/sub_menus/super_sidebar/settings.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Group
+ module SubMenus
+ module SuperSidebar
+ module Settings
+ extend QA::Page::PageConcern
+
+ def self.included(base)
+ super
+
+ base.class_eval do
+ include Common
+ end
+ end
+
+ def go_to_general_settings
+ open_settings_submenu("General")
+ end
+
+ private
+
+ def open_settings_submenu(sub_menu)
+ open_submenu("Settings", "#settings", sub_menu)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index 7532154f0cc..4a5f9d90630 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -233,7 +233,7 @@ module QA
terms.accept_terms if terms.visible?
end
- Page::Main::Menu.perform(&:enable_new_navigation) if Runtime::Env.super_sidebar_enabled?
+ Page::Main::Menu.perform(&:enable_new_navigation) if Runtime::Env.super_sidebar_enabled? && !on_login_page?
Page::Main::Menu.validate_elements_present! unless skip_page_validation
end
diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb
index ac8162965bb..cb213aff31d 100644
--- a/qa/qa/page/main/menu.rb
+++ b/qa/qa/page/main/menu.rb
@@ -71,27 +71,19 @@ module QA
view 'app/helpers/nav/new_dropdown_helper.rb' do
element :global_new_group_link
element :global_new_project_link
+ element :global_new_snippet_link
end
view 'app/assets/javascripts/nav/components/new_nav_toggle.vue' do
element :new_navigation_toggle
end
- def go_to_groups
- within_groups_menu do
- click_element(:menu_item_link, title: 'View all groups')
- end
- end
-
- def go_to_create_group
- click_element(:new_menu_toggle)
- click_element(:global_new_group_link)
+ def go_to_projects
+ click_element(:sidebar_menu_link, menu_item: 'Projects')
end
- def go_to_projects
- within_projects_menu do
- click_element(:menu_item_link, title: 'View all projects')
- end
+ def go_to_groups
+ click_element(:sidebar_menu_link, menu_item: 'Groups')
end
def go_to_snippets
@@ -103,6 +95,16 @@ module QA
click_element(:global_new_project_link)
end
+ def go_to_create_group
+ click_element(:new_menu_toggle)
+ click_element(:global_new_group_link)
+ end
+
+ def go_to_create_snippet
+ click_element(:new_menu_toggle)
+ click_element(:global_new_snippet_link)
+ end
+
def go_to_menu_dropdown_option(option_name)
return click_element(option_name) if QA::Runtime::Env.super_sidebar_enabled?
diff --git a/qa/qa/page/profile/menu.rb b/qa/qa/page/profile/menu.rb
index 651603a77db..6750a4c847c 100644
--- a/qa/qa/page/profile/menu.rb
+++ b/qa/qa/page/profile/menu.rb
@@ -7,6 +7,8 @@ module QA
# We need to check remote_mobile_device_name instead of mobile_layout? here
# since tablets have the regular top navigation bar but still close the left nav
prepend QA::Mobile::Page::SubMenus::Common if QA::Runtime::Env.remote_mobile_device_name
+ # TODO: integrate back once super sidebar becomes default
+ prepend QA::Page::Profile::SuperSidebar::Menu if QA::Runtime::Env.super_sidebar_enabled?
view 'lib/sidebars/user_settings/menus/access_tokens_menu.rb' do
element :access_token_link
@@ -60,10 +62,8 @@ module QA
private
- def within_sidebar
- page.within('.sidebar-top-level-items') do
- yield
- end
+ def within_sidebar(&block)
+ page.within('.sidebar-top-level-items', &block)
end
end
end
diff --git a/qa/qa/page/profile/super_sidebar/menu.rb b/qa/qa/page/profile/super_sidebar/menu.rb
new file mode 100644
index 00000000000..e31f8bbec58
--- /dev/null
+++ b/qa/qa/page/profile/super_sidebar/menu.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Profile
+ module SuperSidebar
+ module Menu
+ def click_ssh_keys
+ click_element(:sidebar_menu_link, menu_item: 'SSH Keys')
+ end
+
+ def click_account
+ click_element(:sidebar_menu_link, menu_item: 'Account')
+ end
+
+ def click_emails
+ click_element(:sidebar_menu_link, menu_item: 'Emails')
+ end
+
+ def click_password
+ click_element(:sidebar_menu_link, menu_item: 'Password')
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/import/repo_by_url.rb b/qa/qa/page/project/import/repo_by_url.rb
index 4a8d08d6499..42e701bf882 100644
--- a/qa/qa/page/project/import/repo_by_url.rb
+++ b/qa/qa/page/project/import/repo_by_url.rb
@@ -17,8 +17,6 @@ module QA
click_create_button
wait_for_success
-
- go_to_project(name)
end
private
@@ -52,13 +50,6 @@ module QA
page.has_no_content?('Import in progress', wait: 3.0)
end
end
-
- def go_to_project(name)
- Page::Main::Menu.perform(&:go_to_projects)
- Page::Dashboard::Projects.perform do |dashboard|
- dashboard.go_to_project(name)
- end
- end
end
end
end
diff --git a/qa/qa/resource/snippet.rb b/qa/qa/resource/snippet.rb
index 84711075442..df9843bcfca 100644
--- a/qa/qa/resource/snippet.rb
+++ b/qa/qa/resource/snippet.rb
@@ -22,9 +22,7 @@ module QA
end
def fabricate!
- Page::Main::Menu.perform(&:go_to_snippets)
-
- Page::Dashboard::Snippet::Index.perform(&:go_to_new_snippet_page)
+ Page::Main::Menu.perform(&:go_to_create_snippet)
Page::Dashboard::Snippet::New.perform do |new_page|
new_page.fill_title(@title)
diff --git a/qa/qa/runtime/application_settings.rb b/qa/qa/runtime/application_settings.rb
index 53ed6a9266b..4cbce0972b6 100644
--- a/qa/qa/runtime/application_settings.rb
+++ b/qa/qa/runtime/application_settings.rb
@@ -22,7 +22,8 @@ module QA
r = put(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url, **application_settings)
return if r.code == QA::Support::API::HTTP_STATUS_OK
- raise "Couldn't set application settings #{application_settings.inspect}"
+ body = parse_body(r)
+ raise("Couldn't set application settings #{application_settings.inspect}, code: '#{r.code}', body: #{body}")
end
def get_application_settings(api_client: admin_api_client)