CE port of EE MR

This commit is contained in:
Sanad Liaquat 2019-01-07 16:57:03 +05:00
parent 1d2ef4c655
commit a1ca9ad0f1
4 changed files with 13 additions and 2 deletions

View file

@ -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' }

View file

@ -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)

View file

@ -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

View file

@ -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?