Commit 4847ea2a authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'test-configure-issue-board-by-label' into 'master'

Add test that configures an issue board by label

Closes gitlab-org/quality/testcases#181

See merge request gitlab-org/gitlab!18273
parents a8926743 c2a8c804
......@@ -167,7 +167,7 @@ dropdown-menu-labels dropdown-menu-selectable"
<div class="dropdown-page-one">
<dropdown-header v-if="showCreate" />
<dropdown-search-input />
<div class="dropdown-content"></div>
<div class="dropdown-content" data-qa-selector="labels_dropdown_content"></div>
<div class="dropdown-loading"><gl-loading-icon /></div>
<dropdown-footer
v-if="showCreate"
......
......@@ -14,7 +14,11 @@ export default {
{{ __('Labels') }}
<template v-if="canEdit">
<i aria-hidden="true" class="fa fa-spinner fa-spin block-loading" data-hidden="true"> </i>
<button type="button" class="edit-link btn btn-blank float-right js-sidebar-dropdown-toggle">
<button
type="button"
class="edit-link btn btn-blank float-right js-sidebar-dropdown-toggle"
data-qa-selector="labels_edit_button"
>
{{ __('Edit') }}
</button>
</template>
......
......@@ -27,6 +27,14 @@ module QA
element :save_changes_button
end
view 'app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue' do
element :labels_dropdown_content
end
view 'app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue' do
element :labels_edit_button
end
view 'app/views/shared/boards/_show.html.haml' do
element :boards_list
end
......@@ -95,6 +103,14 @@ module QA
click_element(:focus_mode_button)
end
def configure_by_label(label)
click_boards_config_button
click_element(:labels_edit_button)
find_element(:labels_dropdown_content).find('li', text: label).click
click_element(:save_changes_button)
wait_boards_list_finish_loading
end
def has_modal_board_name_field?
has_element?(:board_name_field, wait: 1)
end
......@@ -109,8 +125,7 @@ module QA
def wait_boards_list_finish_loading
within_element(:boards_list) do
wait(reload: false, max: 5, interval: 1) do
finished_loading?
yield
finished_loading? && (block_given? ? yield : true)
end
end
end
......
# frozen_string_literal: true
module QA
context 'Plan' do
describe 'Configure issue board by label' do
let(:label_board_list) do
EE::Resource::Board::BoardList::Project::LabelBoardList.fabricate_via_api!
end
let(:doing) { 'Doing' }
let(:ready_for_dev) { 'Ready for development' }
let(:issue_1) { 'Issue 1' }
let(:issue_2) { 'Issue 2' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
fabricate_issue_with_label(label_board_list.project, issue_1, doing)
fabricate_issue_with_label(label_board_list.project, issue_2, ready_for_dev)
label_board_list.project.visit!
Page::Project::Menu.perform(&:go_to_boards)
end
it 'shows only issues that match the configured label' do
EE::Page::Project::Issue::Board::Show.perform do |show|
show.configure_by_label(doing)
expect(show).not_to have_content(issue_2)
expect(show.boards_list_cards_area_with_index(1)).to have_content(issue_1)
end
end
def fabricate_issue_with_label(project, title, label)
Resource::Issue.fabricate_via_api! do |issue|
issue.project = project
issue.title = title
issue.labels = [label]
end
end
end
end
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