Commit e09872c2 authored by Markus Koller's avatar Markus Koller

Merge branch 'fj-enable-sidebar-refactor-ff' into 'master'

Enable sidebar refactor ff [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!61679
parents 7380a1af 8fefd5b5
......@@ -2,7 +2,7 @@
- avatar_classes = ['avatar-container', 'rect-avatar', 'group-avatar']
- avatar_classes << avatar_size_class
= link_to group_path(@group), title: @group.name do
= link_to group_path(@group), title: @group.name, data: { qa_selector: 'group_scope_link' } do
%span{ class: avatar_classes }
= group_icon(@group, class: ['avatar', 'avatar-tile', avatar_size_class])
%span.sidebar-context-title
......
......@@ -19,14 +19,14 @@
- paths = group_overview_nav_link_paths
= nav_link(path: paths, unless: -> { current_path?('groups/contribution_analytics#show') }, html_options: { class: 'home' }) do
- information_link = sidebar_refactor_enabled? ? activity_group_path(@group) : group_path(@group)
= link_to information_link, class: 'has-sub-items' do
= link_to information_link, class: 'has-sub-items', data: { qa_selector: 'group_information_link' } do
.nav-icon-container
- sprite = sidebar_refactor_enabled? ? 'group' : 'home'
= sprite_icon(sprite)
%span.nav-item-name
= group_information_title(@group)
%ul.sidebar-sub-level-items
%ul.sidebar-sub-level-items{ data: { qa_selector: 'group_information_submenu'} }
= nav_link(path: paths, html_options: { class: "fly-out-top-item" } ) do
= link_to information_link do
%strong.fly-out-top-item-name
......
- avatar_size = sidebar_refactor_disabled? ? 40 : 32
- avatar_size_class = sidebar_refactor_disabled? ? 's40' : 's32'
= link_to scope_menu.link, **scope_menu.container_html_options do
= link_to scope_menu.link, **scope_menu.container_html_options, data: { qa_selector: 'project_scope_link' } do
%span{ class: ['avatar-container', 'rect-avatar', 'project-avatar', avatar_size_class] }
= source_icon(scope_menu.container, alt: scope_menu.title, class: ['avatar', 'avatar-tile', avatar_size_class], width: avatar_size, height: avatar_size)
%span.sidebar-context-title
......
......@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326111
milestone: '13.11'
type: development
group: group::editor
default_enabled: false
default_enabled: true
......@@ -338,7 +338,7 @@ module QA
autoload :Jenkins, 'qa/page/project/settings/services/jenkins'
autoload :Prometheus, 'qa/page/project/settings/services/prometheus'
end
autoload :Operations, 'qa/page/project/settings/operations'
autoload :Monitor, 'qa/page/project/settings/monitor'
autoload :Alerts, 'qa/page/project/settings/alerts'
autoload :Integrations, 'qa/page/project/settings/integrations'
end
......@@ -347,7 +347,9 @@ module QA
autoload :CiCd, 'qa/page/project/sub_menus/ci_cd'
autoload :Common, 'qa/page/project/sub_menus/common'
autoload :Issues, 'qa/page/project/sub_menus/issues'
autoload :Operations, 'qa/page/project/sub_menus/operations'
autoload :Monitor, 'qa/page/project/sub_menus/monitor'
autoload :Deployments, 'qa/page/project/sub_menus/deployments'
autoload :Infrastructure, 'qa/page/project/sub_menus/infrastructure'
autoload :Repository, 'qa/page/project/sub_menus/repository'
autoload :Settings, 'qa/page/project/sub_menus/settings'
autoload :Project, 'qa/page/project/sub_menus/project'
......@@ -370,25 +372,29 @@ module QA
autoload :Index, 'qa/page/project/milestone/index'
end
module Operations
module Deployments
module Environments
autoload :Index, 'qa/page/project/operations/environments/index'
autoload :Show, 'qa/page/project/operations/environments/show'
autoload :Index, 'qa/page/project/deployments/environments/index'
autoload :Show, 'qa/page/project/deployments/environments/show'
end
end
module Infrastructure
module Kubernetes
autoload :Index, 'qa/page/project/operations/kubernetes/index'
autoload :Add, 'qa/page/project/operations/kubernetes/add'
autoload :AddExisting, 'qa/page/project/operations/kubernetes/add_existing'
autoload :Show, 'qa/page/project/operations/kubernetes/show'
autoload :Index, 'qa/page/project/infrastructure/kubernetes/index'
autoload :Add, 'qa/page/project/infrastructure/kubernetes/add'
autoload :AddExisting, 'qa/page/project/infrastructure/kubernetes/add_existing'
autoload :Show, 'qa/page/project/infrastructure/kubernetes/show'
end
end
module Monitor
module Metrics
autoload :Show, 'qa/page/project/operations/metrics/show'
autoload :Show, 'qa/page/project/monitor/metrics/show'
end
module Incidents
autoload :Index, 'qa/page/project/operations/incidents/index'
autoload :Index, 'qa/page/project/monitor/incidents/index'
end
end
......
......@@ -146,9 +146,9 @@ module QA
autoload :PipelineSubscriptions, 'qa/ee/page/project/settings/pipeline_subscriptions'
end
module Operations
module Monitor
module Metrics
autoload :Show, 'qa/ee/page/project/operations/metrics/show'
autoload :Show, 'qa/ee/page/project/monitor/metrics/show'
end
end
......
......@@ -112,10 +112,12 @@ module QA
end
def click_group_members_item
within_sidebar do
hover_element(:group_information_link) do
within_submenu(:group_information_submenu) do
click_element(:group_members_item)
end
end
end
def click_group_general_settings_item
hover_element(:group_settings) do
......
......@@ -4,7 +4,7 @@ module QA
module EE
module Page
module Project
module Operations
module Monitor
module Metrics
module Show
extend QA::Page::PageConcern
......
......@@ -12,6 +12,8 @@ module QA
element :group_members_item
element :group_milestones_link
element :group_settings
element :group_information_link
element :group_information_submenu
end
view 'app/views/groups/sidebar/_packages_settings.html.haml' do
......@@ -24,10 +26,12 @@ module QA
end
def click_group_members_item
within_sidebar do
hover_element(:group_information_link) do
within_submenu(:group_information_submenu) do
click_element(:group_members_item)
end
end
end
def click_settings
within_sidebar do
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Deployments
module Environments
class Index < Page::Base
view 'app/assets/javascripts/environments/components/environment_item.vue' do
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Deployments
module Environments
class Show < Page::Base
view 'app/views/projects/environments/_external_url.html.haml' do
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Infrastructure
module Kubernetes
class Add < Page::Base
view 'app/views/clusters/clusters/new.html.haml' do
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Infrastructure
module Kubernetes
class AddExisting < Page::Base
view 'app/views/clusters/clusters/user/_form.html.haml' do
......@@ -32,7 +32,7 @@ module QA
end
def add_cluster!
click_element :add_kubernetes_cluster_button, Page::Project::Operations::Kubernetes::Show
click_element :add_kubernetes_cluster_button, Page::Project::Infrastructure::Kubernetes::Show
end
def uncheck_rbac!
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Infrastructure
module Kubernetes
class Index < Page::Base
view 'app/views/clusters/clusters/_empty_state.html.haml' do
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Infrastructure
module Kubernetes
class Show < Page::Base
view 'app/assets/javascripts/clusters/components/applications.vue' do
......@@ -77,7 +77,7 @@ module QA
end
def save_domain
click_element :save_changes_button, Page::Project::Operations::Kubernetes::Show
click_element :save_changes_button, Page::Project::Infrastructure::Kubernetes::Show
end
def wait_for_cluster_health
......
......@@ -8,7 +8,9 @@ module QA
include SubMenus::Project
include SubMenus::CiCd
include SubMenus::Issues
include SubMenus::Operations
include SubMenus::Deployments
include SubMenus::Monitor
include SubMenus::Infrastructure
include SubMenus::Repository
include SubMenus::Settings
include SubMenus::Packages
......@@ -26,10 +28,12 @@ module QA
end
def click_activity
within_sidebar do
hover_project_information do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Activity')
end
end
end
def click_snippets
within_sidebar do
......@@ -38,8 +42,21 @@ module QA
end
def click_members
hover_project_information do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Members')
end
end
end
private
def hover_project_information
within_sidebar do
click_element(:sidebar_menu_link, menu_item: 'Members')
scroll_to_element(:sidebar_menu_link, menu_item: 'Project information')
find_element(:sidebar_menu_link, menu_item: 'Project information').hover
yield
end
end
end
......
......@@ -3,7 +3,7 @@
module QA
module Page
module Project
module Operations
module Monitor
module Incidents
class Index < Page::Base
view 'app/assets/javascripts/incidents/components/incidents_list.vue' do
......
......@@ -5,7 +5,7 @@ require 'securerandom'
module QA
module Page
module Project
module Operations
module Monitor
module Metrics
class Show < Page::Base
EXPECTED_TITLE = 'Memory Usage (Total)'
......@@ -134,4 +134,4 @@ module QA
end
end
QA::Page::Project::Operations::Metrics::Show.prepend_mod_with('Page::Project::Operations::Metrics::Show', namespace: QA)
QA::Page::Project::Monitor::Metrics::Show.prepend_mod_with('Page::Project::Monitor::Metrics::Show', namespace: QA)
......@@ -4,7 +4,7 @@ module QA
module Page
module Project
module Settings
class Operations < Page::Base
class Monitor < Page::Base
include QA::Page::Settings::Common
view 'app/assets/javascripts/incidents_settings/components/incidents_settings_tabs.vue' do
......
# frozen_string_literal: true
module QA
module Page
module Project
module SubMenus
module Deployments
extend QA::Page::PageConcern
def self.included(base)
super
base.class_eval do
include QA::Page::Project::SubMenus::Common
end
end
def go_to_deployments_environments
hover_deployments do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Environments')
end
end
end
private
def hover_deployments
within_sidebar do
scroll_to_element(:sidebar_menu_link, menu_item: 'Deployments')
find_element(:sidebar_menu_link, menu_item: 'Deployments').hover
yield
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module Page
module Project
module SubMenus
module Infrastructure
extend QA::Page::PageConcern
def self.included(base)
super
base.class_eval do
include QA::Page::Project::SubMenus::Common
end
end
def go_to_infrastructure_kubernetes
hover_infrastructure do
within_submenu do
click_link('Kubernetes clusters')
end
end
end
private
def hover_infrastructure
within_sidebar do
scroll_to_element(:sidebar_menu_link, menu_item: 'Infrastructure')
find_element(:sidebar_menu_link, menu_item: 'Infrastructure').hover
yield
end
end
end
end
end
end
end
......@@ -4,7 +4,7 @@ module QA
module Page
module Project
module SubMenus
module Operations
module Monitor
extend QA::Page::PageConcern
def self.included(base)
......@@ -15,32 +15,16 @@ module QA
end
end
def go_to_operations_environments
hover_operations do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Environments')
end
end
end
def go_to_operations_metrics
hover_operations do
def go_to_monitor_metrics
hover_monitor do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Metrics')
end
end
end
def go_to_operations_kubernetes
hover_operations do
within_submenu do
click_link('Kubernetes')
end
end
end
def go_to_operations_incidents
hover_operations do
def go_to_monitor_incidents
hover_monitor do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Incidents')
end
......@@ -49,10 +33,10 @@ module QA
private
def hover_operations
def hover_monitor
within_sidebar do
scroll_to_element(:sidebar_menu_link, menu_item: 'Operations')
find_element(:sidebar_menu_link, menu_item: 'Operations').hover
scroll_to_element(:sidebar_menu_link, menu_item: 'Monitor')
find_element(:sidebar_menu_link, menu_item: 'Monitor').hover
yield
end
......
......@@ -12,13 +12,17 @@ module QA
base.class_eval do
include QA::Page::Project::SubMenus::Common
view 'app/views/shared/nav/_scope_menu_body.html.haml' do
element :project_scope_link
end
end
end
def click_project
retry_on_exception do
within_sidebar do
click_element(:sidebar_menu_link, menu_item: 'Project overview')
click_element(:project_scope_link)
end
end
end
......
......@@ -53,10 +53,10 @@ module QA
end
end
def go_to_operations_settings
def go_to_monitor_settings
hover_settings do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Operations')
click_element(:sidebar_menu_item_link, menu_item: 'Monitor')
end
end
end
......
......@@ -12,22 +12,22 @@ module QA
end
attribute :ingress_ip do
Page::Project::Operations::Kubernetes::Show.perform(&:ingress_ip)
Page::Project::Infrastructure::Kubernetes::Show.perform(&:ingress_ip)
end
def fabricate!
project.visit!
Page::Project::Menu.perform(
&:go_to_operations_kubernetes)
&:go_to_infrastructure_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform(
Page::Project::Infrastructure::Kubernetes::Index.perform(
&:add_kubernetes_cluster)
Page::Project::Operations::Kubernetes::Add.perform(
Page::Project::Infrastructure::Kubernetes::Add.perform(
&:add_existing_cluster)
Page::Project::Operations::Kubernetes::AddExisting.perform do |cluster_page|
Page::Project::Infrastructure::Kubernetes::AddExisting.perform do |cluster_page|
cluster_page.set_cluster_name(@cluster.cluster_name)
cluster_page.set_api_url(@cluster.api_url)
cluster_page.set_ca_certificate(@cluster.ca_certificate)
......@@ -36,7 +36,7 @@ module QA
cluster_page.add_cluster!
end
Page::Project::Operations::Kubernetes::Show.perform do |show|
Page::Project::Infrastructure::Kubernetes::Show.perform do |show|
# We must wait a few seconds for permissions to be set up correctly for new cluster
sleep 25
......
......@@ -81,11 +81,11 @@ module QA
job.click_element(:pipeline_path)
end
Page::Project::Menu.perform(&:go_to_operations_environments)
Page::Project::Operations::Environments::Index.perform do |index|
Page::Project::Menu.perform(&:go_to_deployments_environments)
Page::Project::Deployments::Environments::Index.perform do |index|
index.click_environment_link('production')
end
Page::Project::Operations::Environments::Show.perform do |show|
Page::Project::Deployments::Environments::Show.perform do |show|
show.view_deployment do
expect(page).to have_content('Hello World!')
expect(page).to have_content('you_can_see_this_variable')
......
......@@ -26,9 +26,9 @@ module QA
k8s_cluster.cluster = cluster
end.project.visit!
Page::Project::Menu.perform(&:go_to_operations_kubernetes)
Page::Project::Menu.perform(&:go_to_infrastructure_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform do |index|
Page::Project::Infrastructure::Kubernetes::Index.perform do |index|
expect(index).to have_cluster(cluster)
end
end
......
......@@ -17,9 +17,9 @@ module QA
end
it 'duplicates to create dashboard to custom', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/871' do
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
on_dashboard.duplicate_dashboard
expect(on_dashboard).to have_metrics
......@@ -28,9 +28,9 @@ module QA
end
it 'verifies data on filtered deployed environment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/874' do
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
on_dashboard.filter_environment
expect(on_dashboard).to have_metrics
......@@ -38,9 +38,9 @@ module QA
end
it 'filters using the quick range', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/873' do
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
on_dashboard.show_last('30 minutes')
expect(on_dashboard).to have_metrics
......@@ -53,13 +53,13 @@ module QA
end
it 'observes cluster health graph', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/920' do
Page::Project::Menu.perform(&:go_to_operations_kubernetes)
Page::Project::Menu.perform(&:go_to_infrastructure_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform do |cluster_list|
Page::Project::Infrastructure::Kubernetes::Index.perform do |cluster_list|
cluster_list.click_on_cluster(@cluster)
end
Page::Project::Operations::Kubernetes::Show.perform do |cluster_panel|
Page::Project::Infrastructure::Kubernetes::Show.perform do |cluster_panel|
cluster_panel.open_health
cluster_panel.wait_for_cluster_health
end
......@@ -78,9 +78,9 @@ module QA
push.new_branch = false
end
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |dashboard|
Page::Project::Monitor::Metrics::Show.perform do |dashboard|
dashboard.select_dashboard('templating.yml')
expect(dashboard).to have_template_metric('CPU usage GitLab Runner')
......@@ -101,9 +101,9 @@ module QA
metrics_panel.add_custom_metric
end
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
expect(on_dashboard).to have_custom_metric('HTTP Requests Total')
end
end
......@@ -116,9 +116,9 @@ module QA
metrics_panel.edit_custom_metric
end
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
expect(on_dashboard).to have_custom_metric('Throughput')
end
end
......@@ -132,9 +132,9 @@ module QA
metrics_panel.delete_custom_metric
end
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
expect(on_dashboard).not_to have_custom_metric('Throughput')
end
end
......
......@@ -12,9 +12,9 @@ module QA
end
it 'allows configuration of alerts', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/869' do
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
verify_metrics(on_dashboard)
verify_add_alert(on_dashboard)
verify_edit_alert(on_dashboard)
......@@ -26,9 +26,9 @@ module QA
it 'creates an incident template and opens an incident with template applied', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/981' do
create_incident_template
Page::Project::Menu.perform(&:go_to_operations_settings)
Page::Project::Menu.perform(&:go_to_monitor_settings)
Page::Project::Settings::Operations.perform do |settings|
Page::Project::Settings::Monitor.perform do |settings|
settings.expand_incidents do |incident_settings|
incident_settings.enable_issues_for_incidents
incident_settings.select_issue_template('incident')
......@@ -79,9 +79,9 @@ module QA
end
def create_incident_template
Page::Project::Menu.perform(&:go_to_operations_metrics)
Page::Project::Menu.perform(&:go_to_monitor_metrics)
chart_link = Page::Project::Operations::Metrics::Show.perform do |on_dashboard|
chart_link = Page::Project::Monitor::Metrics::Show.perform do |on_dashboard|
on_dashboard.wait_for_metrics
on_dashboard.copy_link_to_first_chart
end
......@@ -104,9 +104,9 @@ module QA
end
def create_incident_issue
Page::Project::Menu.perform(&:go_to_operations_incidents)
Page::Project::Menu.perform(&:go_to_monitor_incidents)
Page::Project::Operations::Incidents::Index.perform do |incidents_page|
Page::Project::Monitor::Incidents::Index.perform do |incidents_page|
incidents_page.create_incident
end
......
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