Commit 040ef899 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'qa-update-epic-creation-spec' into 'master'

Update epic creation spec with new epic form

See merge request gitlab-org/gitlab!48513
parents 07274bf4 9c5ecd3e
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
id="epic-title" id="epic-title"
v-model="title" v-model="title"
data-testid="epic-title" data-testid="epic-title"
data-qa-selector="epic_title_field"
:placeholder="s__('Epics|Enter a title for your epic')" :placeholder="s__('Epics|Enter a title for your epic')"
autocomplete="off" autocomplete="off"
autofocus autofocus
...@@ -162,6 +163,7 @@ export default { ...@@ -162,6 +163,7 @@ export default {
id="epic-confidentiality" id="epic-confidentiality"
v-model="confidential" v-model="confidential"
data-testid="epic-confidentiality" data-testid="epic-confidentiality"
data-qa-selector="confidential_epic_checkbox"
> >
{{ $options.i18n.confidentialityLabel }} {{ $options.i18n.confidentialityLabel }}
</gl-form-checkbox> </gl-form-checkbox>
...@@ -226,6 +228,7 @@ export default { ...@@ -226,6 +228,7 @@ export default {
:loading="loading" :loading="loading"
:disabled="!title" :disabled="!title"
data-testid="save-epic" data-testid="save-epic"
data-qa-selector="create_epic_button"
> >
{{ __('Create epic') }} {{ __('Create epic') }}
</gl-button> </gl-button>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- if @can_bulk_update - if @can_bulk_update
= render_if_exists 'shared/issuable/bulk_update_button', type: :epics = render_if_exists 'shared/issuable/bulk_update_button', type: :epics
- if can?(current_user, :create_epic, @group) - 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 = render 'shared/epic/search_bar', type: :epics
......
...@@ -192,6 +192,7 @@ module QA ...@@ -192,6 +192,7 @@ module QA
module Epic module Epic
autoload :Index, 'qa/ee/page/group/epic/index' autoload :Index, 'qa/ee/page/group/epic/index'
autoload :New, 'qa/ee/page/group/epic/new'
autoload :Show, 'qa/ee/page/group/epic/show' autoload :Show, 'qa/ee/page/group/epic/show'
end end
......
...@@ -6,23 +6,16 @@ module QA ...@@ -6,23 +6,16 @@ module QA
module Group module Group
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
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 view 'ee/app/views/groups/epics/_epic.html.haml' do
element :epic_title_text element :epic_title_text
end end
def click_new_epic view 'ee/app/views/groups/epics/index.html.haml' do
click_element :new_epic_button element :new_epic_button
end end
def create_new_epic def click_new_epic
click_element :create_epic_button click_element :new_epic_button, EE::Page::Group::Epic::New
end end
def click_first_epic(page = nil) def click_first_epic(page = nil)
...@@ -30,19 +23,11 @@ module QA ...@@ -30,19 +23,11 @@ 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
......
# 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 ...@@ -31,12 +31,12 @@ module QA
QA::Page::Group::Menu.perform(&:click_group_epics_link) QA::Page::Group::Menu.perform(&:click_group_epics_link)
QA::EE::Page::Group::Epic::Index.perform do |index| QA::EE::Page::Group::Epic::Index.perform(&:click_new_epic)
index.click_new_epic
index.set_title(@title) QA::EE::Page::Group::Epic::New.perform do |new|
index.enable_confidential_epic if @confidential new.set_title(@title)
index.create_new_epic new.enable_confidential_epic if @confidential
index.has_text?(@title, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) new.create_new_epic
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