Commit f827f58a authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho Committed by Dan Davison

Add test for read-only board config

This covers one of the three test cases described in the
following issue:
https://gitlab.com/gitlab-org/quality/testcases/issues/181
parent 86f22223
...@@ -194,6 +194,7 @@ export default { ...@@ -194,6 +194,7 @@ export default {
ref="name" ref="name"
v-model="board.name" v-model="board.name"
class="form-control" class="form-control"
data-qa-selector="board_name_field"
type="text" type="text"
:placeholder="__('Enter board name')" :placeholder="__('Enter board name')"
@keyup.enter="submit" @keyup.enter="submit"
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
</script> </script>
<template> <template>
<div> <div data-qa-selector="board_scope_modal">
<div v-if="canAdminBoard" class="media append-bottom-10"> <div v-if="canAdminBoard" class="media append-bottom-10">
<label class="form-section-title label-bold media-body">{{ __('Board scope') }}</label> <label class="form-section-title label-bold media-body">{{ __('Board scope') }}</label>
<button v-if="collapseScope" type="button" class="btn" @click="expanded = !expanded"> <button v-if="collapseScope" type="button" class="btn" @click="expanded = !expanded">
......
...@@ -37,6 +37,7 @@ export default boardsStore => { ...@@ -37,6 +37,7 @@ export default boardsStore => {
class="btn btn-inverted" class="btn btn-inverted"
:class="{ 'dot-highlight': hasScope }" :class="{ 'dot-highlight': hasScope }"
type="button" type="button"
data-qa-selector="boards_config_button"
@click.prevent="showPage('edit')" @click.prevent="showPage('edit')"
> >
{{ buttonText }} {{ buttonText }}
......
...@@ -11,6 +11,10 @@ module QA ...@@ -11,6 +11,10 @@ module QA
element :board_card element :board_card
end end
view 'app/assets/javascripts/boards/components/board_form.vue' do
element :board_name_field
end
view 'app/assets/javascripts/boards/components/board_list.vue' do view 'app/assets/javascripts/boards/components/board_list.vue' do
element :board_list_cards_area element :board_list_cards_area
end end
...@@ -28,6 +32,14 @@ module QA ...@@ -28,6 +32,14 @@ module QA
element :board_list_header element :board_list_header
end end
view 'ee/app/assets/javascripts/boards/components/board_scope.vue' do
element :board_scope_modal
end
view 'ee/app/assets/javascripts/boards/config_toggle.js' do
element :boards_config_button
end
view 'ee/app/assets/javascripts/boards/toggle_focus.js' do view 'ee/app/assets/javascripts/boards/toggle_focus.js' do
element :focus_mode_button element :focus_mode_button
end end
...@@ -39,6 +51,10 @@ module QA ...@@ -39,6 +51,10 @@ module QA
find('.issue-boards-content.js-focus-mode-board.is-focused') find('.issue-boards-content.js-focus-mode-board.is-focused')
end end
def board_scope_modal
find_element(:board_scope_modal)
end
def boards_dropdown def boards_dropdown
find_element(:boards_dropdown) find_element(:boards_dropdown)
end end
...@@ -67,10 +83,18 @@ module QA ...@@ -67,10 +83,18 @@ module QA
end end
end end
def click_boards_config_button
click_element(:boards_config_button)
end
def click_focus_mode_button def click_focus_mode_button
click_element(:focus_mode_button) click_element(:focus_mode_button)
end end
def has_modal_board_name_field?
has_element?(:board_name_field, wait: 1)
end
private private
def wait_boards_list_finish_loading def wait_boards_list_finish_loading
......
# frozen_string_literal: true
module QA
context 'Plan' do
describe 'Read-only board configuration' do
let(:qa_user) do
Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
end
let(:label_board_list) do
EE::Resource::Board::BoardList::Project::LabelBoardList.fabricate_via_api!
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
label_board_list.project.add_member(qa_user, Resource::Members::AccessLevel::GUEST)
Page::Main::Login.perform do |login|
login.sign_out_and_sign_in_as user: qa_user
end
label_board_list.project.visit!
Page::Project::Menu.perform(&:go_to_boards)
end
it 'shows board configuration to user without edit permission' do
EE::Page::Project::Issue::Board::Show.perform do |show|
show.click_boards_config_button
expect(show.board_scope_modal).to be_visible
expect(show).not_to have_modal_board_name_field
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