Commit 8ca477b2 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-add-confidential-epic-spec' into 'master'

Add E2E spec for creating confidential epics

See merge request gitlab-org/gitlab!38823
parents 41b12044 4b5697d7
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
<gl-button <gl-button
category="primary" category="primary"
variant="success" variant="success"
class="qa-new-epic-button" data-qa-selector="new_epic_button"
data-toggle="dropdown" data-toggle="dropdown"
> >
{{ __('New epic') }} {{ __('New epic') }}
...@@ -96,6 +96,7 @@ export default { ...@@ -96,6 +96,7 @@ export default {
v-if="glFeatures.confidentialEpics" v-if="glFeatures.confidentialEpics"
v-model="epicConfidential" v-model="epicConfidential"
class="mt-3 mb-3 mr-0" class="mt-3 mb-3 mr-0"
data-qa-selector="confidential_epic_checkbox"
><span> {{ __('Make this epic confidential') }} </span> ><span> {{ __('Make this epic confidential') }} </span>
<span <span
v-gl-tooltip.viewport.top.hover v-gl-tooltip.viewport.top.hover
...@@ -118,7 +119,8 @@ export default { ...@@ -118,7 +119,8 @@ export default {
:loading="epicCreateInProgress" :loading="epicCreateInProgress"
category="primary" category="primary"
variant="success" variant="success"
class="gl-mt-3 qa-create-epic-button" class="gl-mt-3"
data-qa-selector="create_epic_button"
@click.stop="createEpic" @click.stop="createEpic"
>{{ buttonLabel }}</gl-button >{{ buttonLabel }}</gl-button
> >
......
...@@ -7,9 +7,10 @@ module QA ...@@ -7,9 +7,10 @@ module QA
module Epic module Epic
class Index < QA::Page::Base class Index < QA::Page::Base
view 'ee/app/assets/javascripts/epic/components/epic_create.vue' do view 'ee/app/assets/javascripts/epic/components/epic_create.vue' do
element :new_epic_button element :confidential_epic_checkbox
element :epic_title_field
element :create_epic_button element :create_epic_button
element :epic_title_field
element :new_epic_button
end end
view 'ee/app/views/groups/epics/_epic.html.haml' do view 'ee/app/views/groups/epics/_epic.html.haml' do
...@@ -20,10 +21,6 @@ module QA ...@@ -20,10 +21,6 @@ module QA
click_element :new_epic_button click_element :new_epic_button
end end
def set_title(title)
fill_element :epic_title_field, title
end
def create_new_epic def create_new_epic
click_element :create_epic_button click_element :create_epic_button
end end
...@@ -33,11 +30,19 @@ module QA ...@@ -33,11 +30,19 @@ module QA
page.validate_elements_present! if page page.validate_elements_present! if page
end end
def enable_confidential_epic
click_element :confidential_epic_checkbox
end
def has_epic_title?(title) def has_epic_title?(title)
wait_until do wait_until do
has_element?(:epic_title_text, text: title) has_element?(:epic_title_text, text: title)
end end
end end
def set_title(title)
fill_element :epic_title_field, title
end
end end
end end
end end
......
...@@ -16,12 +16,14 @@ module QA ...@@ -16,12 +16,14 @@ module QA
attribute :start_date_fixed attribute :start_date_fixed
attribute :due_date_is_fixed attribute :due_date_is_fixed
attribute :due_date_fixed attribute :due_date_fixed
attribute :confidential
def initialize def initialize
@start_date_is_fixed = false @start_date_is_fixed = false
@start_date_fixed = nil @start_date_fixed = nil
@due_date_is_fixed = false @due_date_is_fixed = false
@due_date_fixed = nil @due_date_fixed = nil
@confidential = false
end end
def fabricate! def fabricate!
...@@ -32,6 +34,7 @@ module QA ...@@ -32,6 +34,7 @@ module QA
QA::EE::Page::Group::Epic::Index.perform do |index| QA::EE::Page::Group::Epic::Index.perform do |index|
index.click_new_epic index.click_new_epic
index.set_title(@title) index.set_title(@title)
index.enable_confidential_epic if @confidential
index.create_new_epic index.create_new_epic
index.has_text?(@title, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) index.has_text?(@title, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME)
end end
...@@ -51,7 +54,8 @@ module QA ...@@ -51,7 +54,8 @@ module QA
start_date_is_fixed: @start_date_is_fixed, start_date_is_fixed: @start_date_is_fixed,
start_date_fixed: @start_date_fixed, start_date_fixed: @start_date_fixed,
due_date_is_fixed: @due_date_is_fixed, due_date_is_fixed: @due_date_is_fixed,
due_date_fixed: @due_date_fixed due_date_fixed: @due_date_fixed,
confidential: @confidential
} }
end end
end end
......
...@@ -16,6 +16,17 @@ module QA ...@@ -16,6 +16,17 @@ module QA
expect(page).to have_content(epic_title) expect(page).to have_content(epic_title)
end end
it 'creates a confidential epic' do
epic_title = 'Confidential epic created via GUI'
EE::Resource::Epic.fabricate_via_browser_ui! do |epic|
epic.title = epic_title
epic.confidential = true
end
expect(page).to have_content(epic_title)
expect(page).to have_content("This is a confidential epic.")
end
context 'Resources created via API' do context 'Resources created via API' do
let(:issue) { create_issue_resource } let(:issue) { create_issue_resource }
let(:epic) { create_epic_resource(issue.project.group) } let(:epic) { create_epic_resource(issue.project.group) }
......
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