diff options
Diffstat (limited to 'qa/qa/page/project/new.rb')
-rw-r--r-- | qa/qa/page/project/new.rb | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index 8ea0b57ef3e..d61f9cf0218 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -6,41 +6,42 @@ module QA class New < Page::Base include Page::Component::Project::Templates include Page::Component::VisibilitySetting + include QA::Page::Component::Dropdown include Layout::Flash include Page::Component::Import::Selection include Page::Component::Import::Gitlab view 'app/views/projects/_new_project_fields.html.haml' do - element :initialize_with_readme_checkbox - element :initialize_with_sast_checkbox - element :project_name - element :project_path - element :project_description - element :project_create_button - element :visibility_radios + element 'initialize-with-readme-checkbox' + element 'initialize-with-sast-checkbox' + element 'project-name' + element 'project-path' + element 'project-description' + element 'project-create-button' + element 'visibility-radios' end view 'app/views/projects/project_templates/_template.html.haml' do - element :use_template_button - element :template_option_container + element 'use-template-button' + element 'template-option-container' end view 'app/assets/javascripts/projects/new/components/new_project_url_select.vue' do - element :select_namespace_dropdown - element :select_namespace_dropdown_search_field + element 'select-namespace-dropdown' + element 'select-namespace-dropdown-search-field' end view 'app/assets/javascripts/vue_shared/new_namespace/components/welcome.vue' do - element :panel_link + element 'panel-link' end def click_blank_project_link - click_element(:panel_link, panel_name: 'blank_project') + click_element('panel-link', panel_name: 'blank_project') end def click_create_from_template_link - click_element(:panel_link, panel_name: 'create_from_template') + click_element('panel-link', panel_name: 'create_from_template') end def choose_test_namespace @@ -48,9 +49,12 @@ module QA end def choose_namespace(namespace) - click_element :select_namespace_dropdown - fill_element :select_namespace_dropdown_search_field, namespace - within_element(:select_namespace_dropdown) { click_button namespace } + # The current group is the default, we use end_with? in case we want to select the top level group + return if find_element('select-namespace-dropdown').text.end_with?(namespace) + + click_element 'select-namespace-dropdown' + fill_element 'select-namespace-dropdown-search-field', namespace + select_item(namespace, css: '.gl-dropdown-item') end def click_import_project @@ -62,7 +66,7 @@ module QA end def add_description(description) - return unless has_element?(:project_description, wait: 1) + return unless has_element?('project-description', wait: 1) fill_in 'project_description', with: description end @@ -81,9 +85,9 @@ module QA # Disable experiment for SAST at project creation https://gitlab.com/gitlab-org/gitlab/-/issues/333196 def disable_initialize_with_sast - return unless has_element?(:initialize_with_sast_checkbox, visible: false) + return unless has_element?('initialize-with-sast-checkbox', visible: false) - uncheck_element(:initialize_with_sast_checkbox, true) + uncheck_element('initialize-with-sast-checkbox', true) end def click_github_link @@ -99,7 +103,7 @@ module QA end def disable_initialize_with_readme - uncheck_element(:initialize_with_readme_checkbox, true) + uncheck_element('initialize-with-readme-checkbox', true) end end end |