diff options
Diffstat (limited to 'qa/qa/page/group/new.rb')
-rw-r--r-- | qa/qa/page/group/new.rb | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/qa/qa/page/group/new.rb b/qa/qa/page/group/new.rb index 5f43cfb49c0..5a908266597 100644 --- a/qa/qa/page/group/new.rb +++ b/qa/qa/page/group/new.rb @@ -4,28 +4,51 @@ module QA module Page module Group class New < Page::Base + include Page::Component::VisibilitySetting + view 'app/views/shared/_group_form.html.haml' do - element :group_path_field, 'text_field :path' # rubocop:disable QA/ElementWithPattern - element :group_name_field, 'text_field :name' # rubocop:disable QA/ElementWithPattern + element :group_path_field + element :group_name_field end view 'app/views/groups/_new_group_fields.html.haml' do element :create_group_button, "submit _('Create group')" # rubocop:disable QA/ElementWithPattern - element :visibility_radios, 'visibility_level:' # rubocop:disable QA/ElementWithPattern end - def set_path(path) - fill_in 'group_path', with: path - fill_in 'group_name', with: path + 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_visibility(visibility) - choose visibility + def set_path(path) + fill_element(:group_path_field, path) + fill_element(:group_name_field, path) end 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 |