Commit 9c5ecd3e authored by Desiree Chevalier's avatar Desiree Chevalier

Update epic creation spec with new epic form

parent c11a32bc
......@@ -124,6 +124,7 @@ export default {
id="epic-title"
v-model="title"
data-testid="epic-title"
data-qa-selector="epic_title_field"
:placeholder="s__('Epics|Enter a title for your epic')"
autocomplete="off"
autofocus
......@@ -162,6 +163,7 @@ export default {
id="epic-confidentiality"
v-model="confidential"
data-testid="epic-confidentiality"
data-qa-selector="confidential_epic_checkbox"
>
{{ $options.i18n.confidentialityLabel }}
</gl-form-checkbox>
......@@ -226,6 +228,7 @@ export default {
:loading="loading"
:disabled="!title"
data-testid="save-epic"
data-qa-selector="create_epic_button"
>
{{ __('Create epic') }}
</gl-button>
......
......@@ -8,7 +8,7 @@
- if @can_bulk_update
= render_if_exists 'shared/issuable/bulk_update_button', type: :epics
- if can?(current_user, :create_epic, @group)
= link_to _('New epic'), new_group_epic_path(@group), class: 'btn btn-success gl-button'
= link_to _('New epic'), new_group_epic_path(@group), class: 'btn btn-success gl-button', data: { qa_selector: 'new_epic_button' }
= render 'shared/epic/search_bar', type: :epics
......
......@@ -192,6 +192,7 @@ module QA
module Epic
autoload :Index, 'qa/ee/page/group/epic/index'
autoload :New, 'qa/ee/page/group/epic/new'
autoload :Show, 'qa/ee/page/group/epic/show'
end
......
......@@ -6,23 +6,16 @@ module QA
module Group
module Epic
class Index < QA::Page::Base
view 'ee/app/assets/javascripts/epic/components/epic_create.vue' do
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
element :epic_title_text
end
def click_new_epic
click_element :new_epic_button
view 'ee/app/views/groups/epics/index.html.haml' do
element :new_epic_button
end
def create_new_epic
click_element :create_epic_button
def click_new_epic
click_element :new_epic_button, EE::Page::Group::Epic::New
end
def click_first_epic(page = nil)
......@@ -30,19 +23,11 @@ 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
......
# frozen_string_literal: true
module QA
module EE
module Page
module Group
module Epic
class New < QA::Page::Base
view 'ee/app/assets/javascripts/epic/components/epic_form.vue' do
element :confidential_epic_checkbox
element :create_epic_button
element :epic_title_field, required: true
end
def create_new_epic
click_element :create_epic_button, EE::Page::Group::Epic::Show
end
def enable_confidential_epic
click_element :confidential_epic_checkbox
end
def set_title(title)
fill_element :epic_title_field, title
end
end
end
end
end
end
end
......@@ -31,12 +31,12 @@ module QA
QA::Page::Group::Menu.perform(&:click_group_epics_link)
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)
QA::EE::Page::Group::Epic::Index.perform(&:click_new_epic)
QA::EE::Page::Group::Epic::New.perform do |new|
new.set_title(@title)
new.enable_confidential_epic if @confidential
new.create_new_epic
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