diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index a760d02c4c3..8275996b522 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -33,7 +33,7 @@ %span.d-block.d-sm-none Blank %li.nav-item{ role: 'presentation' } %a.nav-link{ href: '#create-from-template-pane', id: 'create-from-template-tab', data: { toggle: 'tab', track_label: 'create_from_template', track_event: "click_tab" }, role: 'tab' } - %span.d-none.d-sm-block Create from template + %span.d-none.d-sm-block.qa-project-create-from-template-tab Create from template %span.d-block.d-sm-none Template %li.nav-item{ role: 'presentation' } %a.nav-link{ href: '#import-project-pane', id: 'import-project-tab', data: { toggle: 'tab', track_label: 'import_project', track_event: "click_tab" }, role: 'tab' } diff --git a/qa/qa/page/component/select2.rb b/qa/qa/page/component/select2.rb index 6d07d5a10e6..98bcb96b92c 100644 --- a/qa/qa/page/component/select2.rb +++ b/qa/qa/page/component/select2.rb @@ -6,6 +6,12 @@ module QA find('.select2-result-label', text: item_text).click end + def clear_current_selection_if_present + if has_css?('a > abbr.select2-search-choice-close', wait: 1.0) + find('a > abbr.select2-search-choice-close').click + end + end + def search_and_select(item_text) find('.select2-input').set(item_text) select_item(item_text) diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index 6acc413b586..a588af07e4a 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -5,6 +5,7 @@ module QA include Page::Component::Select2 view 'app/views/projects/new.html.haml' do + element :project_create_from_template_tab element :import_project_tab, "Import project" # rubocop:disable QA/ElementWithPattern end @@ -44,6 +45,10 @@ module QA click_on 'Create project' end + def go_to_create_from_template + click_element(:project_create_from_template_tab) + end + def set_visibility(visibility) choose visibility end diff --git a/qa/qa/page/settings/common.rb b/qa/qa/page/settings/common.rb index f9f71aa4a72..9fea74eabc9 100644 --- a/qa/qa/page/settings/common.rb +++ b/qa/qa/page/settings/common.rb @@ -11,7 +11,7 @@ module QA wait(reload: false) do click_button 'Expand' unless first('button', text: 'Collapse') - page.has_content?('Collapse') + has_content?('Collapse') end yield if block_given?