From 95e36c79adbfbf43ee7d7e8d9ee3a147fbbda423 Mon Sep 17 00:00:00 2001 From: Desiree Chevalier Date: Wed, 24 Nov 2021 16:37:51 -0500 Subject: [PATCH] Update e2e tests for vue_issues_list ff Updates e2e tests to use vue_issues_list ff --- .../list/components/issuable_list_root.vue | 3 +++ .../list/components/issuable_tabs.vue | 4 +++- .../components/issue_card_time_info.vue | 6 ++++- qa/qa/ee/page/project/issue/index.rb | 11 +++------ qa/qa/page/project/issue/index.rb | 24 ++++++++++++------- .../2_plan/issue/create_issue_spec.rb | 21 ++++++++++++---- .../geo/attachment_replication_spec.rb | 8 ++++++- 7 files changed, 52 insertions(+), 25 deletions(-) diff --git a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_list_root.vue b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_list_root.vue index c1082987146c3a..1916287e2da21f 100644 --- a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_list_root.vue +++ b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_list_root.vue @@ -272,6 +272,7 @@ export default { :show-checkbox="showBulkEditSidebar" :checkbox-checked="allIssuablesChecked" class="gl-flex-grow-1 gl-border-t-none row-content-block" + data-qa-selector="issuable_search_container" @checked-input="handleAllIssuablesCheckedInput" @onFilter="$emit('filter', $event)" @onSort="$emit('sort', $event)" @@ -302,6 +303,8 @@ export default { v-for="issuable in issuables" :key="issuableId(issuable)" :class="{ 'gl-cursor-grab': isManualOrdering }" + data-qa-selector="issuable_container" + :data-qa-issuable-title="issuable.title" :issuable-symbol="issuableSymbol" :issuable="issuable" :enable-label-permalinks="enableLabelPermalinks" diff --git a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue index 96b07031a115cf..3ff87ba3c4f739 100644 --- a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue +++ b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue @@ -46,7 +46,9 @@ export default { @click="$emit('click', tab.name)" > diff --git a/qa/qa/ee/page/project/issue/index.rb b/qa/qa/ee/page/project/issue/index.rb index fed213c1a0d57a..bf5d13b91fac38 100644 --- a/qa/qa/ee/page/project/issue/index.rb +++ b/qa/qa/ee/page/project/issue/index.rb @@ -12,12 +12,7 @@ def self.prepended(base) super base.class_eval do - view 'app/views/shared/issuable/_search_bar.html.haml' do - element :issue_filter_form, /form_tag.+class: 'filter-form / # rubocop:disable QA/ElementWithPattern - element :issue_filter_input, /%input.form-control.filtered-search/ # rubocop:disable QA/ElementWithPattern - end - - view 'app/assets/javascripts/issues_list/components/issuable.vue' do + view 'ee/app/assets/javascripts/issues_list/components/issue_card_time_info.vue' do element :issuable_weight_content end end @@ -38,8 +33,8 @@ def wait_for_issue_replication(issue) end def filter_by_title(title) - page.within('form.filter-form') do - fill_in class: 'filtered-search', with: title + within_element(:issuable_search_container) do + fill_in class: 'gl-filtered-search-term-input', with: title end end end diff --git a/qa/qa/page/project/issue/index.rb b/qa/qa/page/project/issue/index.rb index fc46f7a2936346..45f8cf2ccd34f8 100644 --- a/qa/qa/page/project/issue/index.rb +++ b/qa/qa/page/project/issue/index.rb @@ -5,9 +5,9 @@ module Page module Project module Issue class Index < Page::Base - view 'app/assets/javascripts/issues_list/components/issuable.vue' do - element :issue_container - element :issue_link + view 'app/assets/javascripts/vue_shared/issuable/list/components/issuable_list_root.vue' do + element :issuable_container + element :issuable_search_container end view 'app/assets/javascripts/vue_shared/components/issue/issue_assignees.vue' do @@ -25,8 +25,8 @@ class Index < Page::Base element :import_issues_dropdown end - view 'app/views/shared/issuable/_nav.html.haml' do - element :closed_issues_link + view 'app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue' do + element :closed_issuables_tab, ':data-qa-selector="`${tab.name}_issuables_tab`"' # rubocop:disable QA/ElementWithPattern end def avatar_counter @@ -37,8 +37,8 @@ def click_issue_link(title) click_link(title) end - def click_closed_issues_link - click_element :closed_issues_link + def click_closed_issues_tab + click_element(:closed_issuables_tab) end def click_export_as_csv_button @@ -73,11 +73,17 @@ def has_assignee_link_count?(count) end def has_issue?(issue) - has_element? :issue_container, issue_title: issue.title + has_element? :issuable_container, issuable_title: issue.title end def has_no_issue?(issue) - has_no_element? :issue_container, issue_title: issue.title + has_no_element? :issuable_container, issuable_title: issue.title + end + + def wait_for_vue_issues_list_ff + Support::Retrier.retry_until(max_duration: 60, reload_page: page, retry_on_exception: true, sleep_interval: 5) do + find_element(:closed_issuables_tab) + end end end end diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb index 81ae8b82ef648a..eae0aa521706db 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb @@ -1,19 +1,26 @@ # frozen_string_literal: true module QA - RSpec.describe 'Plan', :smoke do + # TODO: Remove :requires_admin when the `Runtime::Feature.enable` method call is removed + RSpec.describe 'Plan', :smoke, :requires_admin do describe 'Issue creation' do - let(:closed_issue) { Resource::Issue.fabricate_via_api! } + let(:project) { Resource::Project.fabricate_via_api! } + let(:closed_issue) { Resource::Issue.fabricate_via_api! { |issue| issue.project = project } } before do + Runtime::Feature.enable(:vue_issues_list, group: project.group) + Flow::Login.sign_in end it 'creates an issue', :mobile, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1185' do - issue = Resource::Issue.fabricate_via_browser_ui! + issue = Resource::Issue.fabricate_via_browser_ui! { |issue| issue.project = project } Page::Project::Menu.perform(&:click_issues) + # TODO: Remove this method when the `Runtime::Feature.enable` method call is removed + Page::Project::Issue::Index.perform(&:wait_for_vue_issues_list_ff) + Page::Project::Issue::Index.perform do |index| expect(index).to have_issue(issue) end @@ -29,10 +36,14 @@ module QA end Page::Project::Menu.perform(&:click_issues) + + # TODO: Remove this method when the `Runtime::Feature.enable` method call is removed + Page::Project::Issue::Index.perform(&:wait_for_vue_issues_list_ff) + Page::Project::Issue::Index.perform do |index| expect(index).not_to have_issue(closed_issue) - index.click_closed_issues_link + index.click_closed_issues_tab expect(index).to have_issue(closed_issue) end @@ -45,7 +56,7 @@ module QA end before do - Resource::Issue.fabricate_via_api!.visit! + Resource::Issue.fabricate_via_api! { |issue| issue.project = project }.visit! end # The following example is excluded from running in `review-qa-smoke` job diff --git a/qa/qa/specs/features/ee/browser_ui/geo/attachment_replication_spec.rb b/qa/qa/specs/features/ee/browser_ui/geo/attachment_replication_spec.rb index 7a8f72cfc8b42e..6abebfcfba320a 100644 --- a/qa/qa/specs/features/ee/browser_ui/geo/attachment_replication_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/geo/attachment_replication_spec.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true module QA - RSpec.describe 'Geo', :orchestrated, :geo do + # TODO: Remove :requires_admin when the `Runtime::Feature.enable` method call is removed + RSpec.describe 'Geo', :orchestrated, :geo, :requires_admin do describe 'GitLab Geo attachment replication' do let(:file_to_attach) { File.absolute_path(File.join('qa', 'fixtures', 'designs', 'banana_sample.gif')) } @@ -12,6 +13,8 @@ module QA project.description = 'project for adding issues' end + Runtime::Feature.enable(:vue_issues_list, group: @project.group) + @issue = Resource::Issue.fabricate_via_api! do |issue| issue.title = 'My geo issue' issue.project = @project @@ -44,6 +47,9 @@ module QA Page::Project::Menu.act { click_issues } Page::Project::Issue::Index.perform do |index| + # TODO: Remove this method when the `Runtime::Feature.enable` method call is removed + index.wait_for_vue_issues_list_ff + index.wait_for_issue_replication(@issue) end -- GitLab