Commit 0fac8411 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Add methods to get to group import

parent f3ce55e9
......@@ -13,10 +13,10 @@
= link_to explore_groups_path, data: { track_label: "groups_dropdown_explore_groups", track_event: "click_link" } do
= _('Explore groups')
= nav_link(path: 'groups/new#create-group-pane', html_options: { class: 'gl-border-0 gl-border-t-1 gl-border-solid gl-border-gray-100' }) do
= link_to new_group_path(anchor: 'create-group-pane'), data: { track_label: "groups_dropdown_create_group", track_event: "click_link" } do
= link_to new_group_path(anchor: 'create-group-pane'), data: { track_label: "groups_dropdown_create_group", track_event: "click_link", qa_selector: 'create_group_link' } do
= _('Create group')
= nav_link(path: 'groups/new#import-group-pane') do
= link_to new_group_path(anchor: 'import-group-pane'), data: { track_label: "groups_dropdown_import_group", track_event: "click_link" } do
= link_to new_group_path(anchor: 'import-group-pane'), data: { track_label: "groups_dropdown_import_group", track_event: "click_link", qa_selector: 'import_group_link' } do
= _('Import group')
.frequent-items-dropdown-content
#js-groups-dropdown{ data: { user_name: current_user.username, group: group_meta } }
......@@ -15,6 +15,12 @@ module QA
element :create_group_button, "submit _('Create group')" # rubocop:disable QA/ElementWithPattern
end
view 'app/views/groups/_import_group_from_another_instance_panel.html.haml' do
element :import_gitlab_url
element :import_gitlab_token
element :connect_instance_button
end
def set_path(path)
fill_element(:group_path_field, path)
fill_element(:group_name_field, path)
......@@ -23,6 +29,26 @@ module QA
def create
click_button 'Create group'
end
def set_gitlab_url(url)
fill_element(:import_gitlab_url, url)
end
def set_gitlab_token(token)
fill_element(:import_gitlab_token, token)
end
# Connect gitlab instance
#
# @param [String] gitlab_url
# @param [String] gitlab_token
# @return [void]
def connect_gitlab_instance(gitlab_url, gitlab_token)
set_gitlab_url(gitlab_url)
set_gitlab_token(gitlab_token)
click_element(:connect_instance_button)
end
end
end
end
......
......@@ -35,17 +35,24 @@ module QA
element :your_projects_link
end
view 'app/views/layouts/nav/groups_dropdown/_show.html.haml' do
element :create_group_link
element :import_group_link
end
view 'app/views/layouts/_search.html.haml' do
element :search_term_field
end
def go_to_groups
within_top_menu do
click_element :groups_dropdown
within_groups_menu do
click_element :your_groups_link
end
end
page.within('.qa-groups-dropdown-sidebar') do
click_element :your_groups_link
def go_to_import_group
within_groups_menu do
click_element :import_group_link
end
end
......@@ -173,6 +180,14 @@ module QA
end
end
def within_groups_menu(&block)
within_top_menu do
click_element :groups_dropdown
end
page.within('.qa-groups-dropdown-sidebar', &block)
end
def click_admin_area
within_top_menu { click_element :admin_area_link }
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