Commit dac484dd authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'qa/e2e-tests-for-multiple-boards-on-group-level' into 'master'

End-to-end test for multiple issue boards on group level

Closes gitlab-org/quality/testcases#225

See merge request gitlab-org/gitlab-ee!16068
parents 46f9cfbd 847ed73f
......@@ -245,6 +245,7 @@ export default {
<div
v-if="!loading"
ref="content"
data-qa-selector="boards_dropdown_content"
class="dropdown-content flex-fill"
@scroll.passive="throttledSetScrollFade"
>
......
......@@ -48,14 +48,14 @@
- if group_sidebar_link?(:issues)
= nav_link(path: group_issues_sub_menu_items) do
= link_to issues_group_path(@group) do
= link_to issues_group_path(@group), data: { qa_selector: 'group_issues_item' } do
.nav-icon-container
= sprite_icon('issues')
%span.nav-item-name
= _('Issues')
%span.badge.badge-pill.count= number_with_delimiter(issues_count)
%ul.sidebar-sub-level-items
%ul.sidebar-sub-level-items{ data: { qa_selector: 'group_issues_sidebar_submenu'} }
= nav_link(path: ['groups#issues', 'labels#index', 'milestones#index'], html_options: { class: "fly-out-top-item" } ) do
= link_to issues_group_path(@group) do
%strong.fly-out-top-item-name
......@@ -70,7 +70,7 @@
- if group_sidebar_link?(:boards)
= nav_link(path: ['boards#index', 'boards#show']) do
= link_to group_boards_path(@group), title: boards_link_text do
= link_to group_boards_path(@group), title: boards_link_text, data: { qa_selector: 'group_issue_boards_link' } do
%span
= boards_link_text
......
......@@ -27,6 +27,12 @@ module QA
autoload :SamlSSOSignIn, 'qa/ee/page/group/saml_sso_sign_in'
autoload :Members, 'qa/ee/page/group/members'
module Issue
module Board
autoload :Show, 'qa/ee/page/group/issue/board/show'
end
end
module Settings
autoload :SamlSSO, 'qa/ee/page/group/settings/saml_sso'
autoload :LDAPSync, 'qa/ee/page/group/settings/ldap_sync'
......@@ -136,15 +142,27 @@ module QA
end
module Resource
autoload :Board, 'qa/ee/resource/board'
autoload :License, 'qa/ee/resource/license'
autoload :Epic, 'qa/ee/resource/epic'
autoload :ProjectMilestone, 'qa/ee/resource/project_milestone'
autoload :GroupLabel, 'qa/ee/resource/group_label.rb'
module BoardList
autoload :BaseBoardList, 'qa/ee/resource/board_list/base_board_list'
autoload :LabelBoardList, 'qa/ee/resource/board_list/label_board_list'
autoload :MilestoneBoardList, 'qa/ee/resource/board_list/milestone_board_list'
module Board
autoload :BaseBoard, 'qa/ee/resource/board/base_board'
autoload :GroupBoard, 'qa/ee/resource/board/group_board'
autoload :ProjectBoard, 'qa/ee/resource/board/project_board'
module BoardList
module Group
autoload :BoardList, 'qa/ee/resource/board/board_list/group/board_list'
end
module Project
autoload :BaseBoardList, 'qa/ee/resource/board/board_list/project/base_board_list'
autoload :LabelBoardList, 'qa/ee/resource/board/board_list/project/label_board_list'
autoload :MilestoneBoardList, 'qa/ee/resource/board/board_list/project/milestone_board_list'
end
end
end
module Geo
......
# frozen_string_literal: true
module QA
module EE
module Page
module Group
module Issue
module Board
class Show < QA::Page::Base
view 'app/assets/javascripts/boards/components/boards_selector.vue' do
element :boards_dropdown
element :boards_dropdown_content
end
def boards_dropdown
find_element(:boards_dropdown)
end
def boards_dropdown_content
find_element(:boards_dropdown_content)
end
def click_boards_dropdown_button
# The dropdown button comes from the `GlDropdown` component of `@gitlab/ui`,
# so it wasn't possible to add a `data-qa-selector` to it.
find_element(:boards_dropdown).find('button').click
end
end
end
end
end
end
end
end
......@@ -30,17 +30,30 @@ module QA
element :group_insights_link
end
view 'app/views/layouts/nav/sidebar/_group.html.haml' do
element :group_issue_boards_link
element :group_issues_item
end
def go_to_issue_boards
hover_element(:group_issues_item) do
within_submenu(:group_issues_sidebar_submenu) do
click_element(:group_issue_boards_link)
end
end
end
def go_to_saml_sso_group_settings
hover_settings do
within_submenu do
hover_element(:group_settings_item) do
within_submenu(:group_sidebar_submenu) do
click_element(:group_saml_sso_link)
end
end
end
def go_to_ldap_sync_settings
hover_settings do
within_submenu do
hover_element(:group_settings_item) do
within_submenu(:group_sidebar_submenu) do
click_element(:ldap_synchronization_link)
end
end
......@@ -59,8 +72,8 @@ module QA
end
def click_group_general_settings_item
hover_settings do
within_submenu do
hover_element(:group_settings_item) do
within_submenu(:group_sidebar_submenu) do
click_element(:general_settings_link)
end
end
......@@ -80,9 +93,9 @@ module QA
private
def hover_settings
def hover_element(element)
within_sidebar do
find_element(:group_settings_item).hover
find_element(element).hover
yield
end
end
......@@ -93,8 +106,8 @@ module QA
end
end
def within_submenu
within_element(:group_sidebar_submenu) do
def within_submenu(element)
within_element(element) do
yield
end
end
......
......@@ -3,19 +3,20 @@
module QA
module EE
module Resource
module BoardList
class LabelBoardList < BaseBoardList
attribute :label do
QA::Resource::Label.fabricate_via_api! do |l|
l.project = board.project
l.title = 'Doing'
end
module Board
class BaseBoard < QA::Resource::Base
attribute :id
attribute :name
def resource_web_url(resource)
super
rescue ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def api_post_body
{
board_id: board.id,
label_id: label.id
name: name
}
end
end
......
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
module BoardList
module Group
class BoardList < QA::Resource::Base
attribute :id
attribute :label_title
attribute :group do
QA::Resource::Group.fabricate_via_api!
end
attribute :board do
QA::EE::Resource::Board::GroupBoard.fabricate_via_api! do |group_board|
group_board.group = group
group_board.name = 'Upstream'
end
end
attribute :label do
QA::EE::Resource::GroupLabel.fabricate_via_api! do |group_label|
group_label.group = board.group
group_label.title = label_title
end
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def api_get_path
"/groups/#{board.group.id}/boards/#{board.id}/lists/#{id}"
end
def api_post_path
"/groups/#{board.group.id}/boards/#{board.id}/lists"
end
def api_post_body
{
board_id: board.id,
label_id: label.id
}
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
module BoardList
module Project
class BaseBoardList < QA::Resource::Base
attribute :id
attribute :project do
QA::Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-board-list'
end
end
attribute :board do
QA::EE::Resource::Board::ProjectBoard.fabricate_via_api! do |project_board|
project_board.project = project
project_board.name = 'Downstream'
end
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def api_get_path
"/projects/#{board.project.id}/boards/#{board.id}/lists/#{id}"
end
def api_post_path
"/projects/#{board.project.id}/boards/#{board.id}/lists"
end
def api_post_body
{
board_id: board.id
}
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
module BoardList
module Project
class LabelBoardList < BaseBoardList
attribute :label do
QA::Resource::Label.fabricate_via_api! do |label|
label.project = board.project
label.title = 'Doing'
end
end
def api_post_body
{
board_id: board.id,
label_id: label.id
}
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
module BoardList
module Project
class MilestoneBoardList < BaseBoardList
attribute :project_milestone do
QA::EE::Resource::ProjectMilestone.fabricate_via_api! do |project_milestone|
project_milestone.project = board.project
project_milestone.title = '1.0'
end
end
def api_post_body
{
board_id: board.id,
milestone_id: project_milestone.id
}
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
class GroupBoard < BaseBoard
attribute :group do
QA::Resource::Group.fabricate_via_api! do |group|
group.name = 'group-with-board'
end
end
def api_get_path
"/groups/#{group.id}/boards/#{id}"
end
def api_post_path
"/groups/#{group.id}/boards"
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
class ProjectBoard < BaseBoard
attribute :project do
QA::Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-board'
end
end
def api_get_path
"/projects/#{project.id}/boards/#{id}"
end
def api_post_path
"/projects/#{project.id}/boards"
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module BoardList
class BaseBoardList < QA::Resource::Base
attribute :id
attribute :project do
QA::Resource::Project.fabricate_via_api! do |resource|
resource.name = 'project-with-board-list'
end
end
attribute :board do
QA::EE::Resource::Board.fabricate_via_api! do |b|
b.project = project
b.name = 'Downstream'
end
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def api_get_path
"/projects/#{board.project.id}/boards/#{board.id}/lists/#{id}"
end
def api_post_path
"/projects/#{board.project.id}/boards/#{board.id}/lists"
end
def api_post_body
{
board_id: board.id
}
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
module BoardList
class MilestoneBoardList < BaseBoardList
attribute :project_milestone do
QA::EE::Resource::ProjectMilestone.fabricate_via_api! do |m|
m.project = board.project
m.title = '1.0'
end
end
def api_post_body
{
board_id: board.id,
milestone_id: project_milestone.id
}
end
end
end
end
end
end
# frozen_string_literal: true
require 'securerandom'
module QA
module EE
module Resource
class Board < QA::Resource::Base
class GroupLabel < Base
attr_accessor :description, :color
attribute :id
attribute :name
attribute :title
attribute :project do
QA::Resource::Project.fabricate_via_api! do |resource|
resource.name = 'project-with-board'
attribute :group do
Group.fabricate_via_api! do |resource|
resource.name = 'group-with-label'
end
end
def initialize
@title = "qa-test-#{SecureRandom.hex(8)}"
@description = 'This is a test group label'
@color = '#6655FF'
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
......@@ -20,16 +30,18 @@ module QA
end
def api_get_path
"/projects/#{project.id}/boards/#{id}"
raise NotImplementedError, "The Labels API doesn't expose a single-resource endpoint so this method cannot be properly implemented."
end
def api_post_path
"/projects/#{project.id}/boards"
"/groups/#{group.id}/labels"
end
def api_post_body
{
name: name
color: @color,
name: @title,
description: @description
}
end
end
......
# frozen_string_literal: true
module QA
context 'Plan' do
describe 'Group issue boards' do
let(:board_1) { 'Upstream 1' }
let(:board_2) { 'Upstream 2' }
let(:board_3) { 'Upstream 3' }
let(:group) do
QA::Resource::Group.fabricate_via_api!
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
create_group_board(board_1)
create_group_board(board_2)
create_group_board(board_3)
Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform do |groups|
groups.click_group(group.path)
end
EE::Page::Group::Menu.perform(&:go_to_issue_boards)
end
it 'shows multiple group boards in the boards dropdown menu' do
EE::Page::Group::Issue::Board::Show.perform do |show|
show.click_boards_dropdown_button
expect(show.boards_dropdown_content).to have_content(board_1)
expect(show.boards_dropdown_content).to have_content(board_2)
expect(show.boards_dropdown_content).to have_content(board_3)
end
end
def create_group_board(name)
QA::EE::Resource::Board::GroupBoard.fabricate_via_api! do |group_board|
group_board.group = group
group_board.name = name
end
end
end
end
end
......@@ -2,19 +2,19 @@
module QA
context 'Plan' do
describe 'Issue boards' do
let(:issue_title) { 'Issue to test board list' }
describe 'Project issue boards' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
let(:issue_title) { 'Issue to test board list' }
context 'Label issue board' do
let(:label) { 'Doing' }
let(:label_board_list) do
EE::Resource::BoardList::LabelBoardList.fabricate_via_api!
EE::Resource::Board::BoardList::Project::LabelBoardList.fabricate_via_api!
end
before do
......@@ -40,7 +40,7 @@ module QA
context 'Milestone issue board' do
let(:milestone_board_list) do
EE::Resource::BoardList::MilestoneBoardList.fabricate_via_api!
EE::Resource::Board::BoardList::Project::MilestoneBoardList.fabricate_via_api!
end
before do
......
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