diff options
Diffstat (limited to 'qa/qa/page/project')
-rw-r--r-- | qa/qa/page/project/branches/show.rb | 38 | ||||
-rw-r--r-- | qa/qa/page/project/import/github.rb | 9 | ||||
-rw-r--r-- | qa/qa/page/project/new.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline/show.rb | 10 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline_editor/show.rb | 10 | ||||
-rw-r--r-- | qa/qa/page/project/settings/advanced.rb | 44 | ||||
-rw-r--r-- | qa/qa/page/project/settings/ci_variables.rb | 7 | ||||
-rw-r--r-- | qa/qa/page/project/settings/default_branch.rb | 6 | ||||
-rw-r--r-- | qa/qa/page/project/settings/mirroring_repositories.rb | 47 | ||||
-rw-r--r-- | qa/qa/page/project/settings/protected_branches.rb | 6 | ||||
-rw-r--r-- | qa/qa/page/project/settings/repository.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/project/show.rb | 14 | ||||
-rw-r--r-- | qa/qa/page/project/sub_menus/ci_cd.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/project/sub_menus/issues.rb | 2 |
14 files changed, 117 insertions, 82 deletions
diff --git a/qa/qa/page/project/branches/show.rb b/qa/qa/page/project/branches/show.rb index 4bf8abb555b..7163bc7464d 100644 --- a/qa/qa/page/project/branches/show.rb +++ b/qa/qa/page/project/branches/show.rb @@ -5,8 +5,6 @@ module QA module Project module Branches class Show < Page::Base - include Page::Component::ConfirmModal - view 'app/assets/javascripts/branches/components/delete_branch_button.vue' do element :delete_branch_button end @@ -16,22 +14,24 @@ module QA end view 'app/views/projects/branches/_branch.html.haml' do - element :branch_name + element :badge_content + element :branch_container + element :branch_link end view 'app/views/projects/branches/_panel.html.haml' do - element :all_branches + element :all_branches_container end - view 'app/views/projects/branches/index.html.haml' do - element :delete_merged_branches + view 'app/assets/javascripts/branches/components/delete_merged_branches.vue' do + element :delete_merged_branches_button + element :delete_merged_branches_input + element :delete_merged_branches_confirmation_button end def delete_branch(branch_name) - within_element(:all_branches) do - within(".js-branch-#{branch_name}") do - click_element(:delete_branch_button) - end + within_element(:branch_container, name: branch_name) do + click_element(:delete_branch_button) end click_element(:delete_branch_confirmation_button) @@ -41,23 +41,23 @@ module QA def has_no_branch?(branch_name, reload: false) wait_until(reload: reload) do - within_element(:all_branches) do - has_no_element?(:branch_name, text: branch_name) + within_element(:all_branches_container) do + has_no_element?(:branch_link, text: branch_name) end end end def has_branch_with_badge?(branch_name, badge) - within_element(:all_branches) do - within(".js-branch-#{branch_name} .badge") do - has_text?(badge) - end + within_element(:branch_container, name: branch_name) do + has_element?(:badge_content, text: badge) end end - def delete_merged_branches - click_element(:delete_merged_branches) - click_confirmation_ok_button + def delete_merged_branches(branches_length) + click_element(:delete_merged_branches_button) + fill_element(:delete_merged_branches_input, branches_length) + click_element(:delete_merged_branches_confirmation_button) + finished_loading? end end end diff --git a/qa/qa/page/project/import/github.rb b/qa/qa/page/project/import/github.rb index 89d044bac8d..75468c74814 100644 --- a/qa/qa/page/project/import/github.rb +++ b/qa/qa/page/project/import/github.rb @@ -85,8 +85,15 @@ module QA end end end - alias_method :wait_for_success, :has_imported_project? + + # Select advanced github import option + # + # @param [Symbol] option_name + # @return [void] + def select_advanced_option(option_name) + check_element(:advanced_settings_checkbox, true, option_name: option_name) + end end end end diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index fd650d8ca20..f7434656be3 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -64,6 +64,8 @@ module QA end def add_description(description) + return unless has_element?(:project_description, wait: 1) + fill_in 'project_description', with: description end diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb index 06d154f5178..33ba27a788a 100644 --- a/qa/qa/page/project/pipeline/show.rb +++ b/qa/qa/page/project/pipeline/show.rb @@ -35,10 +35,6 @@ module QA element :status_icon, 'ci-status-icon-${status}' # rubocop:disable QA/ElementWithPattern end - view 'app/views/projects/pipelines/_info.html.haml' do - element :pipeline_badges - end - view 'app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue' do element :job_dropdown_container element :jobs_dropdown_menu @@ -68,12 +64,6 @@ module QA has_no_element?(:job_link, text: job_name) end - def has_tag?(tag_name) - within_element(:pipeline_badges) do - has_selector?('.badge', text: tag_name) - end - end - def linked_pipelines all_elements(:linked_pipeline_container, minimum: 1) end diff --git a/qa/qa/page/project/pipeline_editor/show.rb b/qa/qa/page/project/pipeline_editor/show.rb index 70c0c5abb52..8fa20aa57cf 100644 --- a/qa/qa/page/project/pipeline_editor/show.rb +++ b/qa/qa/page/project/pipeline_editor/show.rb @@ -91,6 +91,8 @@ module QA def write_to_editor(text) find_element(:source_editor_container).fill_in(with: text) + + wait_for_requests end def submit_changes @@ -140,6 +142,10 @@ module QA all_elements(:job_container, minimum: 1).any? { |item| item.text.match(/#{name}/i) } end + def has_no_alert? + has_no_css?('.gl-alert-body') + end + def tab_alert_message within_element(:file_editor_container) do find('.gl-alert-body').text @@ -174,9 +180,13 @@ module QA within_element(:file_editor_container) do find('.nav-item', text: name).click end + + wait_for_requests end end end end end end + +QA::Page::Project::PipelineEditor::Show.prepend_mod_with('Page::Project::PipelineEditor::Show', namespace: QA) diff --git a/qa/qa/page/project/settings/advanced.rb b/qa/qa/page/project/settings/advanced.rb index 9d8ed132ffd..fcfcecdc183 100644 --- a/qa/qa/page/project/settings/advanced.rb +++ b/qa/qa/page/project/settings/advanced.rb @@ -6,10 +6,11 @@ module QA module Settings class Advanced < Page::Base include QA::Page::Component::ConfirmModal + include QA::Page::Component::DeleteModal include Component::NamespaceSelect - view 'app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger.vue' do - element :confirm_danger_button + view 'app/assets/javascripts/projects/components/shared/delete_button.vue' do + element :delete_button end view 'app/views/projects/edit.html.haml' do @@ -20,7 +21,6 @@ module QA view 'app/views/projects/settings/_archive.html.haml' do element :archive_project_link element :unarchive_project_link - element :archive_project_content end view 'app/views/projects/_export.html.haml' do @@ -29,6 +29,14 @@ module QA element :export_project_content end + view 'app/views/projects/_transfer.html.haml' do + element :transfer_project_content + end + + view 'app/assets/javascripts/projects/settings/components/transfer_project_form.vue' do + element :transfer_project_button + end + def update_project_path_to(path) fill_project_path(path) click_change_path_button @@ -45,13 +53,16 @@ module QA def transfer_project!(project_name, namespace) QA::Runtime::Logger.info "Transferring project: #{project_name} to namespace: #{namespace}" - click_element_coordinates(:archive_project_content) + scroll_to_transfer_project_content # Workaround for a failure to search when there are no spaces around the / # https://gitlab.com/gitlab-org/gitlab/-/issues/218965 select_namespace(namespace.gsub(%r{([^\s])/([^\s])}, '\1 / \2')) - click_element(:confirm_danger_button) + wait_for_enabled_transfer_project_button + + click_element :transfer_project_button + fill_confirmation_text(project_name) confirm_transfer end @@ -77,6 +88,29 @@ module QA click_element :unarchive_project_link click_confirmation_ok_button end + + def delete_project!(project_name) + click_element :delete_button + fill_confirmation_path(project_name) + wait_for_delete_button_enabled + confirm_delete + end + + private + + def scroll_to_transfer_project_content + retry_until(sleep_interval: 1, message: 'Waiting for transfer project content to display') do + has_element?(:transfer_project_content, wait: 3) + end + + scroll_to_element :transfer_project_content + end + + def wait_for_enabled_transfer_project_button + retry_until(sleep_interval: 1, message: 'Waiting for transfer project button to be enabled') do + has_element?(:transfer_project_button, disabled: false, wait: 3) + end + end end end end diff --git a/qa/qa/page/project/settings/ci_variables.rb b/qa/qa/page/project/settings/ci_variables.rb index 7ee015ceb98..316920ffa90 100644 --- a/qa/qa/page/project/settings/ci_variables.rb +++ b/qa/qa/page/project/settings/ci_variables.rb @@ -14,13 +14,6 @@ module QA element :ci_variable_delete_button end - view 'app/assets/javascripts/ci_variable_list/components/legacy_ci_variable_table.vue' do - element :ci_variable_table_content - element :add_ci_variable_button - element :edit_ci_variable_button - element :reveal_ci_variable_value_button - end - def fill_variable(key, value, masked = false) within_element(:ci_variable_key_field) { find('input').set key } fill_element :ci_variable_value_field, value diff --git a/qa/qa/page/project/settings/default_branch.rb b/qa/qa/page/project/settings/default_branch.rb index 575f9006c84..69ac45ce72d 100644 --- a/qa/qa/page/project/settings/default_branch.rb +++ b/qa/qa/page/project/settings/default_branch.rb @@ -5,7 +5,7 @@ module QA module Project module Settings class DefaultBranch < Page::Base - view 'app/views/projects/default_branch/_show.html.haml' do + view 'app/views/projects/branch_defaults/_show.html.haml' do element :save_changes_button end @@ -18,8 +18,8 @@ module QA end def set_default_branch(branch) - click_button :default_branch_dropdown - fill_in :ref_selector_searchbox, with: branch + find_element(:default_branch_dropdown, visible: false).click + find_element(:ref_selector_searchbox, visible: false).fill_in(with: branch) click_button branch end diff --git a/qa/qa/page/project/settings/mirroring_repositories.rb b/qa/qa/page/project/settings/mirroring_repositories.rb index f55faff19e7..61ee3e4f03c 100644 --- a/qa/qa/page/project/settings/mirroring_repositories.rb +++ b/qa/qa/page/project/settings/mirroring_repositories.rb @@ -6,25 +6,25 @@ module QA module Settings class MirroringRepositories < Page::Base view 'app/views/projects/mirrors/_authentication_method.html.haml' do - element :authentication_method - element :password + element :authentication_method_field + element :password_field end view 'app/views/projects/mirrors/_mirror_repos.html.haml' do - element :mirror_repository_url_input + element :mirror_repository_url_field element :mirror_repository_button end view 'app/views/projects/mirrors/_mirror_repos_list.html.haml' do - element :mirror_repository_url_cell - element :mirror_last_update_at_cell - element :mirror_error_badge - element :mirrored_repository_row + element :mirror_repository_url_content + element :mirror_last_update_at_content + element :mirror_error_badge_content + element :mirrored_repository_row_container element :copy_public_key_button end view 'app/views/projects/mirrors/_mirror_repos_form.html.haml' do - element :mirror_direction + element :mirror_direction_field end view 'app/views/shared/_remote_mirror_update_button.html.haml' do @@ -37,28 +37,23 @@ module QA element :fingerprints_list end - view 'app/views/projects/mirrors/_authentication_method.html.haml' do - element :authentication_method - element :password - end - def repository_url=(value) - fill_element :mirror_repository_url_input, value + fill_element :mirror_repository_url_field, value end def password=(value) - fill_element :password, value + fill_element :password_field, value end def mirror_direction=(value) raise ArgumentError, "Mirror direction must be 'Push' or 'Pull'" unless %w[Push Pull].include?(value) - select_element(:mirror_direction, value) + select_element(:mirror_direction_field, value) # Changing the mirror direction causes the fields below to change, # and that change is animated, so we need to wait for the animation # to complete otherwise changes to those fields could fail - wait_for_animated_element :authentication_method + wait_for_animated_element :authentication_method_field end def authentication_method=(value) @@ -66,13 +61,13 @@ module QA raise ArgumentError, "Authentication method must be 'SSH public key', 'Password', or 'None'" end - select_element(:authentication_method, value) + select_element(:authentication_method_field, value) end def public_key(url) row_index = find_repository_row_index url - within_element_by_index(:mirrored_repository_row, row_index) do + within_element_by_index(:mirrored_repository_row_container, row_index) do find_element(:copy_public_key_button)['data-clipboard-text'] end end @@ -92,7 +87,7 @@ module QA def update(url) row_index = find_repository_row_index(url) - within_element_by_index(:mirrored_repository_row, row_index) do + within_element_by_index(:mirrored_repository_row_container, row_index) do # When a repository is first mirrored, the update process might # already be started, so the button is already "clicked" click_element :update_now_button unless has_element? :updating_button @@ -105,16 +100,16 @@ module QA row_index = find_repository_row_index(url) wait_until(sleep_interval: 1) do - within_element_by_index(:mirrored_repository_row, row_index) do - last_update = find_element(:mirror_last_update_at_cell, wait: 0) + within_element_by_index(:mirrored_repository_row_container, row_index) do + last_update = find_element(:mirror_last_update_at_content, wait: 0) last_update.has_text?('just now') || last_update.has_text?('seconds') end end # Fail early if the page still shows that there has been no update - within_element_by_index(:mirrored_repository_row, row_index) do - find_element(:mirror_last_update_at_cell, wait: 0).assert_no_text('Never') - assert_no_element(:mirror_error_badge) + within_element_by_index(:mirrored_repository_row_container, row_index) do + find_element(:mirror_last_update_at_content, wait: 0).assert_no_text('Never') + assert_no_element(:mirror_error_badge_content) end end @@ -122,7 +117,7 @@ module QA def find_repository_row_index(target_url) wait_until(max_duration: 5, reload: false) do - all_elements(:mirror_repository_url_cell, minimum: 1).index do |url| + all_elements(:mirror_repository_url_content, minimum: 1).index do |url| # The url might be a sanitized url but the target_url won't be so # we compare just the paths instead of the full url URI.parse(url.text).path == target_url.path diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb index a78d8a6ccf4..4fbf656210f 100644 --- a/qa/qa/page/project/settings/protected_branches.rb +++ b/qa/qa/page/project/settings/protected_branches.rb @@ -6,8 +6,8 @@ module QA module Settings class ProtectedBranches < Page::Base view 'app/views/projects/protected_branches/shared/_dropdown.html.haml' do - element :protected_branch_select element :protected_branch_dropdown + element :protected_branch_dropdown_content end view 'app/views/projects/protected_branches/_create_protected_branch.html.haml' do @@ -22,9 +22,9 @@ module QA end def select_branch(branch_name) - click_element :protected_branch_select + click_element :protected_branch_dropdown - within_element(:protected_branch_dropdown) do + within_element(:protected_branch_dropdown_content) do click_on branch_name end end diff --git a/qa/qa/page/project/settings/repository.rb b/qa/qa/page/project/settings/repository.rb index de5b4f37076..bf1c3130485 100644 --- a/qa/qa/page/project/settings/repository.rb +++ b/qa/qa/page/project/settings/repository.rb @@ -58,7 +58,7 @@ module QA end def expand_default_branch(&block) - within('#default-branch-settings') do + within('#branch-defaults-settings') do find('.btn-default').click do DefaultBranch.perform(&block) end diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb index 26c2da07b34..a82fa7f5cf3 100644 --- a/qa/qa/page/project/show.rb +++ b/qa/qa/page/project/show.rb @@ -32,7 +32,7 @@ module QA end view 'app/views/projects/_last_push.html.haml' do - element :create_merge_request + element :create_merge_request_button end view 'app/views/projects/_home_panel.html.haml' do @@ -54,7 +54,7 @@ module QA end view 'app/views/projects/empty.html.haml' do - element :quick_actions + element :quick_actions_container end view 'app/assets/javascripts/repository/components/breadcrumbs.vue' do @@ -72,7 +72,7 @@ module QA end view 'app/views/projects/blob/viewers/_loading.html.haml' do - element :spinner + element :spinner_placeholder end view 'app/views/projects/buttons/_download.html.haml' do @@ -80,11 +80,11 @@ module QA end def wait_for_viewers_to_load - has_no_element?(:spinner, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) + has_no_element?(:spinner_placeholder, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) end def create_first_new_file! - within_element(:quick_actions) do + within_element(:quick_actions_container) do click_link_with_text 'New file' end end @@ -122,7 +122,7 @@ module QA end def has_create_merge_request_button? - has_css?(element_selector_css(:create_merge_request)) + has_css?(element_selector_css(:create_merge_request_button)) end def has_file?(name) @@ -152,7 +152,7 @@ module QA has_create_merge_request_button? end - click_element :create_merge_request + click_element :create_merge_request_button end def open_web_ide! diff --git a/qa/qa/page/project/sub_menus/ci_cd.rb b/qa/qa/page/project/sub_menus/ci_cd.rb index c8c90df2c1f..4ae51798e54 100644 --- a/qa/qa/page/project/sub_menus/ci_cd.rb +++ b/qa/qa/page/project/sub_menus/ci_cd.rb @@ -43,3 +43,5 @@ module QA end end end + +QA::Page::Project::SubMenus::CiCd.prepend_mod_with('Page::Project::SubMenus::CiCd', namespace: QA) diff --git a/qa/qa/page/project/sub_menus/issues.rb b/qa/qa/page/project/sub_menus/issues.rb index 48cdf9791f8..7fa19063653 100644 --- a/qa/qa/page/project/sub_menus/issues.rb +++ b/qa/qa/page/project/sub_menus/issues.rb @@ -74,3 +74,5 @@ module QA end end end + +QA::Page::Project::SubMenus::Issues.prepend_mod_with('Page::Project::SubMenus::Issues', namespace: QA) |