Commit 4b5697d7 authored by Desiree Chevalier's avatar Desiree Chevalier

Add E2E spec for creating confidential epics

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