From 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Sep 2021 13:18:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-3-stable-ee --- qa/qa/ce/strategy.rb | 4 - qa/qa/flow/login.rb | 18 +- qa/qa/flow/saml.rb | 2 +- qa/qa/git/repository.rb | 1 - qa/qa/page/admin/settings/component/ip_limits.rb | 10 +- qa/qa/page/component/note.rb | 5 +- qa/qa/page/component/wiki_page_form.rb | 1 + qa/qa/page/dashboard/snippet/index.rb | 6 +- qa/qa/page/group/bulk_import.rb | 5 +- qa/qa/page/group/menu.rb | 17 ++ qa/qa/page/group/settings/group_deploy_tokens.rb | 68 ++++++ qa/qa/page/group/settings/repository.rb | 23 ++ qa/qa/page/main/login.rb | 2 +- qa/qa/page/main/menu.rb | 11 + qa/qa/page/merge_request/show.rb | 19 +- qa/qa/page/project/monitor/metrics/show.rb | 2 - qa/qa/page/project/settings/ci_cd.rb | 4 +- qa/qa/page/project/settings/deploy_tokens.rb | 4 +- qa/qa/page/view.rb | 2 - qa/qa/resource/api_fabricator.rb | 2 +- qa/qa/resource/ci_variable.rb | 2 +- qa/qa/resource/deploy_token.rb | 2 +- qa/qa/resource/group_base.rb | 16 ++ qa/qa/resource/group_deploy_token.rb | 51 ++++ qa/qa/resource/group_milestone.rb | 67 ++++-- qa/qa/resource/issue.rb | 9 +- qa/qa/resource/kubernetes_cluster/base.rb | 2 - qa/qa/resource/label_base.rb | 6 +- qa/qa/resource/members.rb | 4 +- qa/qa/resource/merge_request.rb | 4 +- qa/qa/resource/merge_request_from_fork.rb | 2 - qa/qa/resource/package.rb | 2 - qa/qa/resource/project.rb | 2 - qa/qa/resource/project_imported_from_github.rb | 4 +- qa/qa/resource/project_imported_from_url.rb | 2 - qa/qa/resource/project_issue_note.rb | 2 - qa/qa/resource/protected_branch.rb | 2 - qa/qa/resource/registry_repository.rb | 2 - qa/qa/resource/repository/project_push.rb | 2 - qa/qa/resource/repository/push.rb | 3 - qa/qa/resource/runner.rb | 2 - qa/qa/resource/ssh_key.rb | 2 +- qa/qa/resource/user.rb | 19 +- qa/qa/resource/wiki/group_page.rb | 2 - qa/qa/runtime/allure_report.rb | 11 +- qa/qa/runtime/api/client.rb | 28 ++- qa/qa/runtime/api/repository_storage_moves.rb | 2 +- qa/qa/runtime/application_settings.rb | 4 +- qa/qa/runtime/browser.rb | 23 +- qa/qa/runtime/env.rb | 5 +- qa/qa/runtime/feature.rb | 6 +- qa/qa/runtime/fixtures.rb | 2 +- qa/qa/runtime/ip_address.rb | 4 +- qa/qa/runtime/release.rb | 4 - qa/qa/runtime/search.rb | 10 +- qa/qa/runtime/user.rb | 2 +- qa/qa/service/docker_run/gitlab_runner.rb | 1 - qa/qa/service/kubernetes_cluster.rb | 2 - .../api/1_manage/bulk_import_group_spec.rb | 113 +++++---- .../api/1_manage/import_github_repo_spec.rb | 2 +- .../api/1_manage/import_large_github_repo_spec.rb | 41 ++-- .../api/1_manage/project_access_token_spec.rb | 8 +- .../features/api/1_manage/rate_limits_spec.rb | 2 +- .../api/1_manage/user_access_termination_spec.rb | 6 +- qa/qa/specs/features/api/1_manage/users_spec.rb | 6 +- .../closes_issue_via_pushing_a_commit_spec.rb | 4 +- .../gitaly/automatic_failover_and_recovery_spec.rb | 4 +- .../3_create/gitaly/backend_node_recovery_spec.rb | 2 +- .../gitaly/changing_repository_storage_spec.rb | 4 +- .../api/3_create/gitaly/distributed_reads_spec.rb | 4 +- .../api/3_create/gitaly/gitaly_mtls_spec.rb | 2 +- .../gitaly/praefect_replication_queue_spec.rb | 2 +- .../merge_request/push_options_labels_spec.rb | 4 +- .../merge_request/push_options_mwps_spec.rb | 4 +- .../push_options_remove_source_branch_spec.rb | 2 +- .../push_options_target_branch_spec.rb | 2 +- .../push_options_title_description_spec.rb | 2 +- .../repository/default_branch_name_setting_spec.rb | 6 +- .../features/api/3_create/repository/files_spec.rb | 5 +- .../repository/project_archive_compare_spec.rb | 5 +- .../repository/push_postreceive_idempotent_spec.rb | 4 +- .../snippet_repository_storage_move_spec.rb | 2 +- .../cancel_pipeline_when_block_user_spec.rb | 2 +- .../api/5_package/container_registry_spec.rb | 4 +- .../1_manage/group/bulk_import_group_spec.rb | 14 +- .../create_group_with_mattermost_team_spec.rb | 2 +- .../1_manage/group/transfer_group_spec.rb | 2 +- .../1_manage/group/transfer_project_spec.rb | 2 +- .../browser_ui/1_manage/login/2fa_recovery_spec.rb | 2 +- .../1_manage/login/2fa_ssh_recovery_spec.rb | 2 +- .../browser_ui/1_manage/login/log_in_spec.rb | 2 +- .../1_manage/login/log_in_with_2fa_spec.rb | 2 +- .../login/log_into_gitlab_via_ldap_spec.rb | 2 +- .../login/log_into_mattermost_via_gitlab_spec.rb | 2 +- .../login/login_via_instance_wide_saml_sso_spec.rb | 7 +- .../login/maintain_log_in_mixed_env_spec.rb | 39 ++++ .../browser_ui/1_manage/login/register_spec.rb | 8 +- .../1_manage/project/add_project_member_spec.rb | 2 +- .../1_manage/project/create_project_spec.rb | 4 +- .../1_manage/project/dashboard_images_spec.rb | 6 +- .../1_manage/project/import_github_repo_spec.rb | 2 +- .../1_manage/project/project_access_token_spec.rb | 2 +- .../1_manage/project/view_project_activity_spec.rb | 2 +- .../1_manage/user/follow_user_activity_spec.rb | 2 +- .../1_manage/user/user_access_termination_spec.rb | 2 +- .../email/trigger_email_notification_spec.rb | 4 +- .../2_plan/issue/check_mentions_for_xss_spec.rb | 2 +- .../issue/collapse_comments_in_discussions_spec.rb | 2 +- .../browser_ui/2_plan/issue/comment_issue_spec.rb | 2 +- .../browser_ui/2_plan/issue/create_issue_spec.rb | 6 +- .../2_plan/issue/custom_issue_template_spec.rb | 2 +- .../browser_ui/2_plan/issue/export_as_csv_spec.rb | 4 +- .../2_plan/issue/filter_issue_comments_spec.rb | 2 +- .../2_plan/issue/issue_suggestions_spec.rb | 2 +- .../2_plan/issue/jira_issue_import_spec.rb | 2 +- .../browser_ui/2_plan/issue/mentions_spec.rb | 2 +- .../2_plan/issue/real_time_assignee_spec.rb | 2 +- .../2_plan/issue_boards/focus_mode_spec.rb | 2 +- .../milestone/create_group_milestone_spec.rb | 2 +- .../milestone/create_project_milestone_spec.rb | 2 +- .../2_plan/related_issues/related_issues_spec.rb | 2 +- .../2_plan/transient/comment_on_discussion_spec.rb | 2 +- .../design_management/add_design_content_spec.rb | 2 +- .../archive_design_content_spec.rb | 2 +- .../modify_design_content_spec.rb | 2 +- .../3_create/jenkins/jenkins_build_status_spec.rb | 3 +- .../3_create/jira/jira_basic_integration_spec.rb | 6 +- .../cherry_pick/cherry_pick_a_merge_spec.rb | 2 +- .../cherry_pick/cherry_pick_commit_spec.rb | 2 +- .../merge_request/create_merge_request_spec.rb | 5 +- .../create_merge_request_via_template_spec.rb | 2 +- .../merge_merge_request_from_fork_spec.rb | 2 +- .../merge_when_pipeline_succeeds_spec.rb | 6 +- .../merge_request/rebase_merge_request_spec.rb | 22 +- .../merge_request/revert/revert_commit_spec.rb | 2 +- .../revert/reverting_merge_request_spec.rb | 8 +- .../merge_request/squash_merge_request_spec.rb | 2 +- .../suggestions/batch_suggestion_spec.rb | 2 +- .../suggestions/custom_commit_suggestion_spec.rb | 2 +- .../view_merge_request_diff_patch_spec.rb | 4 +- .../view_merge_request_merge_ref_diff_spec.rb | 4 +- .../3_create/repository/add_file_template_spec.rb | 2 - .../repository/add_list_delete_branches_spec.rb | 2 +- .../repository/branch_with_unusual_name_spec.rb | 2 +- .../browser_ui/3_create/repository/clone_spec.rb | 4 +- .../repository/file/create_file_via_web_spec.rb | 2 +- .../repository/file/delete_file_via_web_spec.rb | 2 +- .../repository/file/edit_file_via_web_spec.rb | 2 +- .../repository/file/file_with_unusual_name_spec.rb | 2 +- .../repository/move_project_create_fork_spec.rb | 2 +- .../repository/protocol_v2_push_http_spec.rb | 2 +- .../repository/protocol_v2_push_ssh_spec.rb | 2 +- .../repository/push_http_private_token_spec.rb | 2 +- .../push_mirroring_lfs_over_http_spec.rb | 2 +- .../repository/push_mirroring_over_http_spec.rb | 2 +- .../repository/push_over_http_file_size_spec.rb | 6 +- .../3_create/repository/push_over_http_spec.rb | 4 +- .../3_create/repository/push_over_ssh_spec.rb | 4 +- .../repository/push_protected_branch_spec.rb | 8 +- .../3_create/repository/ssh_key_support_spec.rb | 4 +- .../user_views_commit_diff_patch_spec.rb | 4 +- .../clone_push_pull_personal_snippet_spec.rb | 4 +- .../clone_push_pull_project_snippet_spec.rb | 4 +- .../snippet/create_personal_snippet_spec.rb | 2 +- ...te_personal_snippet_with_multiple_files_spec.rb | 2 +- .../snippet/create_project_snippet_spec.rb | 2 +- ...ate_project_snippet_with_multiple_files_spec.rb | 2 +- .../3_create/snippet/share_snippet_spec.rb | 4 +- .../3_create/web_ide/add_file_template_spec.rb | 2 - .../web_ide/add_new_directory_in_web_ide_spec.rb | 4 +- .../web_ide/create_first_file_in_web_ide_spec.rb | 2 +- .../web_ide/link_to_line_in_web_ide_spec.rb | 2 +- .../3_create/web_ide/open_fork_in_web_ide_spec.rb | 4 +- .../web_ide/open_web_ide_from_diff_tab_spec.rb | 2 +- .../3_create/web_ide/review_merge_request_spec.rb | 2 +- .../web_ide/upload_new_file_in_web_ide_spec.rb | 8 +- .../3_create/wiki/content_editor_spec.rb | 2 +- .../wiki/project_based_content_creation_spec.rb | 8 +- .../project_based_content_manipulation_spec.rb | 4 +- .../project_based_directory_management_spec.rb | 2 +- .../3_create/wiki/project_based_list_spec.rb | 4 +- .../wiki/project_based_page_deletion_spec.rb | 2 +- .../ci_variable/add_remove_ci_variable_spec.rb | 4 +- .../pipeline_with_protected_variable_spec.rb | 6 +- .../pipeline/create_and_process_pipeline_spec.rb | 2 +- ...e_local_config_file_paths_with_wildcard_spec.rb | 2 +- .../include_multiple_files_from_a_project_spec.rb | 4 +- .../4_verify/pipeline/locked_artifacts_spec.rb | 2 +- .../merge_mr_when_pipline_is_blocked_spec.rb | 4 +- .../pipeline/mr_event_rule_pipeline_spec.rb | 4 +- ...tenv_variables_to_downstream_via_bridge_spec.rb | 4 +- .../pipeline_editor_branch_switcher_spec.rb | 4 +- .../pipeline/run_pipeline_via_web_only_spec.rb | 2 +- .../trigger_child_pipeline_with_manual_spec.rb | 4 +- .../4_verify/pipeline/trigger_matrix_spec.rb | 4 +- .../4_verify/runner/register_runner_spec.rb | 4 +- .../4_verify/testing/view_code_coverage_spec.rb | 4 +- .../browser_ui/5_package/composer_registry_spec.rb | 4 +- .../browser_ui/5_package/conan_repository_spec.rb | 2 +- .../5_package/container_registry_omnibus_spec.rb | 2 +- .../5_package/container_registry_spec.rb | 2 +- .../browser_ui/5_package/dependency_proxy_spec.rb | 2 +- .../5_package/generic_repository_spec.rb | 2 +- .../5_package/maven_gradle_repository_spec.rb | 2 +- .../browser_ui/5_package/maven_repository_spec.rb | 8 +- .../browser_ui/5_package/npm_registry_spec.rb | 171 ++++++++------ .../browser_ui/5_package/nuget_repository_spec.rb | 258 ++++++++++++--------- .../5_package/online_garbage_collection_spec.rb | 4 +- .../browser_ui/5_package/pypi_repository_spec.rb | 4 +- .../browser_ui/5_package/rubygems_registry_spec.rb | 2 +- .../6_release/deploy_key/add_deploy_key_spec.rb | 2 +- .../deploy_token/add_deploy_token_spec.rb | 2 +- .../6_release/pages/pages_pipeline_spec.rb | 2 +- ..._child_pipelines_dependent_relationship_spec.rb | 4 +- ...hild_pipelines_independent_relationship_spec.rb | 4 +- .../create_project_with_auto_devops_spec.rb | 8 +- .../kubernetes/kubernetes_integration_spec.rb | 2 +- .../8_monitor/all_monitor_core_features_spec.rb | 12 +- .../browser_ui/non_devops/performance_bar_spec.rb | 2 +- qa/qa/specs/helpers/context_formatter.rb | 68 ------ qa/qa/specs/helpers/quarantine_formatter.rb | 45 ---- qa/qa/specs/helpers/rspec.rb | 15 +- qa/qa/specs/runner.rb | 1 - qa/qa/support/allure_metadata_formatter.rb | 37 --- qa/qa/support/api.rb | 4 +- .../formatters/allure_metadata_formatter.rb | 33 +++ qa/qa/support/formatters/context_formatter.rb | 65 ++++++ qa/qa/support/formatters/formatters.rb | 11 + qa/qa/support/formatters/quarantine_formatter.rb | 42 ++++ qa/qa/support/formatters/test_stats_formatter.rb | 156 +++++++++++++ qa/qa/support/helpers/stub_env.rb | 46 ++++ qa/qa/support/matchers/eventually_matcher.rb | 138 +++++++++++ qa/qa/support/matchers/have_matcher.rb | 36 +++ qa/qa/support/matchers/have_text.rb | 52 +++++ qa/qa/tools/delete_projects.rb | 2 +- qa/qa/tools/delete_subgroups.rb | 2 +- qa/qa/tools/delete_test_ssh_keys.rb | 2 +- qa/qa/tools/generate_perf_testdata.rb | 4 +- qa/qa/vendor/jira/jira_api.rb | 2 +- qa/qa/vendor/saml_idp/page/base.rb | 2 +- qa/qa/vendor/saml_idp/page/login.rb | 2 +- 241 files changed, 1623 insertions(+), 818 deletions(-) create mode 100644 qa/qa/page/group/settings/group_deploy_tokens.rb create mode 100644 qa/qa/page/group/settings/repository.rb create mode 100644 qa/qa/resource/group_deploy_token.rb create mode 100644 qa/qa/specs/features/browser_ui/1_manage/login/maintain_log_in_mixed_env_spec.rb delete mode 100644 qa/qa/specs/helpers/context_formatter.rb delete mode 100644 qa/qa/specs/helpers/quarantine_formatter.rb delete mode 100644 qa/qa/support/allure_metadata_formatter.rb create mode 100644 qa/qa/support/formatters/allure_metadata_formatter.rb create mode 100644 qa/qa/support/formatters/context_formatter.rb create mode 100644 qa/qa/support/formatters/formatters.rb create mode 100644 qa/qa/support/formatters/quarantine_formatter.rb create mode 100644 qa/qa/support/formatters/test_stats_formatter.rb create mode 100644 qa/qa/support/helpers/stub_env.rb create mode 100644 qa/qa/support/matchers/eventually_matcher.rb create mode 100644 qa/qa/support/matchers/have_matcher.rb create mode 100644 qa/qa/support/matchers/have_text.rb (limited to 'qa/qa') diff --git a/qa/qa/ce/strategy.rb b/qa/qa/ce/strategy.rb index 018a1eb1bfc..71c538c20a0 100644 --- a/qa/qa/ce/strategy.rb +++ b/qa/qa/ce/strategy.rb @@ -5,10 +5,6 @@ module QA module Strategy extend self - def extend_autoloads! - # noop - end - def perform_before_hooks # The login page could take some time to load the first time it is visited. # We visit the login page and wait for it to properly load only once before the tests. diff --git a/qa/qa/flow/login.rb b/qa/qa/flow/login.rb index d23d8eaf097..05a509588f1 100644 --- a/qa/qa/flow/login.rb +++ b/qa/qa/flow/login.rb @@ -5,10 +5,10 @@ module QA module Login module_function - def while_signed_in(as: nil, address: :gitlab) + def while_signed_in(as: nil, address: :gitlab, admin: false) Page::Main::Menu.perform(&:sign_out_if_signed_in) - sign_in(as: as, address: address) + sign_in(as: as, address: address, admin: admin) result = yield @@ -17,19 +17,25 @@ module QA end def while_signed_in_as_admin(address: :gitlab) - while_signed_in(as: Runtime::User.admin, address: address) do + while_signed_in(address: address, admin: true) do yield end end - def sign_in(as: nil, address: :gitlab, skip_page_validation: false) + def sign_in(as: nil, address: :gitlab, skip_page_validation: false, admin: false) Page::Main::Menu.perform(&:sign_out) if Page::Main::Menu.perform(&:signed_in?) Runtime::Browser.visit(address, Page::Main::Login) - Page::Main::Login.perform { |login| login.sign_in_using_credentials(user: as, skip_page_validation: skip_page_validation) } + Page::Main::Login.perform do |login| + if admin + login.sign_in_using_admin_credentials + else + login.sign_in_using_credentials(user: as, skip_page_validation: skip_page_validation) + end + end end def sign_in_as_admin(address: :gitlab) - sign_in(as: Runtime::User.admin, address: address) + sign_in(as: Runtime::User.admin, address: address, admin: true) end def sign_in_unless_signed_in(as: nil, address: :gitlab) diff --git a/qa/qa/flow/saml.rb b/qa/qa/flow/saml.rb index 7cbaba9fbd5..1280f59c3c2 100644 --- a/qa/qa/flow/saml.rb +++ b/qa/qa/flow/saml.rb @@ -67,7 +67,7 @@ module QA end def login_to_idp_if_required(username, password) - Vendor::SAMLIdp::Page::Login.perform { |login_page| login_page.login_if_required(username, password) } + Vendor::SamlIdp::Page::Login.perform { |login_page| login_page.login_if_required(username, password) } end end end diff --git a/qa/qa/git/repository.rb b/qa/qa/git/repository.rb index 24a148e9330..356e509a81d 100644 --- a/qa/qa/git/repository.rb +++ b/qa/qa/git/repository.rb @@ -4,7 +4,6 @@ require 'cgi' require 'uri' require 'fileutils' require 'tmpdir' -require 'securerandom' module QA module Git diff --git a/qa/qa/page/admin/settings/component/ip_limits.rb b/qa/qa/page/admin/settings/component/ip_limits.rb index 1f9bd113cab..a85b96014b3 100644 --- a/qa/qa/page/admin/settings/component/ip_limits.rb +++ b/qa/qa/page/admin/settings/component/ip_limits.rb @@ -7,16 +7,18 @@ module QA module Component class IpLimits < Page::Base view 'app/views/admin/application_settings/_ip_limits.html.haml' do - element :throttle_unauthenticated_checkbox + element :throttle_unauthenticated_api_checkbox + element :throttle_unauthenticated_web_checkbox element :throttle_authenticated_api_checkbox element :throttle_authenticated_web_checkbox element :save_changes_button end def enable_throttles - check_element(:throttle_unauthenticated_checkbox) - check_element(:throttle_authenticated_api_checkbox) - check_element(:throttle_authenticated_web_checkbox) + check_element(:throttle_unauthenticated_api_checkbox, true) + check_element(:throttle_unauthenticated_web_checkbox, true) + check_element(:throttle_authenticated_api_checkbox, true) + check_element(:throttle_authenticated_web_checkbox, true) end def save_settings diff --git a/qa/qa/page/component/note.rb b/qa/qa/page/component/note.rb index 67583f71bf3..7c733a231f1 100644 --- a/qa/qa/page/component/note.rb +++ b/qa/qa/page/component/note.rb @@ -14,8 +14,11 @@ module QA end base.view 'app/assets/javascripts/notes/components/comment_form.vue' do - element :comment_button element :comment_field + end + + base.view 'app/assets/javascripts/notes/components/comment_type_dropdown.vue' do + element :comment_button element :discussion_menu_item end diff --git a/qa/qa/page/component/wiki_page_form.rb b/qa/qa/page/component/wiki_page_form.rb index 6b7452b0e0f..fd536ff1dd3 100644 --- a/qa/qa/page/component/wiki_page_form.rb +++ b/qa/qa/page/component/wiki_page_form.rb @@ -47,6 +47,7 @@ module QA within_element(:try_new_editor_container) do click_button('Use the new editor') end + has_element?(:content_editor_container) end end end diff --git a/qa/qa/page/dashboard/snippet/index.rb b/qa/qa/page/dashboard/snippet/index.rb index d8314509b1f..088fff17578 100644 --- a/qa/qa/page/dashboard/snippet/index.rb +++ b/qa/qa/page/dashboard/snippet/index.rb @@ -35,8 +35,10 @@ module QA end def has_number_of_files?(snippet_title, number) - within_element(:snippet_link, snippet_title: snippet_title) do - has_element?(:snippet_file_count_content, snippet_files: number) + retry_until(max_attempts: 5, reload: true, sleep_interval: 1) do # snippet statistics computation can take a few moments + within_element(:snippet_link, snippet_title: snippet_title) do + has_element?(:snippet_file_count_content, snippet_files: number, wait: 5) + end end end end diff --git a/qa/qa/page/group/bulk_import.rb b/qa/qa/page/group/bulk_import.rb index 9ba80abf21c..b9497aeb6e5 100644 --- a/qa/qa/page/group/bulk_import.rb +++ b/qa/qa/page/group/bulk_import.rb @@ -7,7 +7,6 @@ module QA view "app/assets/javascripts/import_entities/import_groups/components/import_table.vue" do element :import_table element :import_item - element :import_group_button element :import_status_indicator end @@ -19,6 +18,10 @@ module QA element :target_namespace_selector_dropdown end + view "app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue" do + element :import_group_button + end + # Import source group in to target group # # @param [String] source_group_name diff --git a/qa/qa/page/group/menu.rb b/qa/qa/page/group/menu.rb index c997598e25a..be877e56713 100644 --- a/qa/qa/page/group/menu.rb +++ b/qa/qa/page/group/menu.rb @@ -68,8 +68,25 @@ module QA end end + def go_to_repository_settings + hover_group_settings do + within_submenu do + click_element(:sidebar_menu_item_link, menu_item: 'Repository') + end + end + end + private + def hover_settings + within_sidebar do + scroll_to_element(:sidebar_menu_link, menu_item: 'Settings') + find_element(:sidebar_menu_link, menu_item: 'Settings').hover + + yield + end + end + def hover_issues within_sidebar do scroll_to_element(:sidebar_menu_link, menu_item: 'Issues') diff --git a/qa/qa/page/group/settings/group_deploy_tokens.rb b/qa/qa/page/group/settings/group_deploy_tokens.rb new file mode 100644 index 00000000000..65ee3fc72eb --- /dev/null +++ b/qa/qa/page/group/settings/group_deploy_tokens.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module QA + module Page + module Group + module Settings + class GroupDeployTokens < Page::Base + view 'app/views/shared/deploy_tokens/_form.html.haml' do + element :deploy_token_name_field + element :deploy_token_expires_at_field + element :deploy_token_read_repository_checkbox + element :deploy_token_read_package_registry_checkbox + element :deploy_token_read_registry_checkbox + element :deploy_token_write_package_registry_checkbox + element :create_deploy_token_button + end + + view 'app/views/shared/deploy_tokens/_new_deploy_token.html.haml' do + element :created_deploy_token_container + element :deploy_token_user_field + element :deploy_token_field + end + + def fill_token_name(name) + fill_element(:deploy_token_name_field, name) + end + + def fill_token_expires_at(expires_at) + fill_element(:deploy_token_expires_at_field, expires_at.to_s + "\n") + end + + def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false, write_package_registry: false ) + check_element(:deploy_token_read_repository_checkbox) if read_repository + check_element(:deploy_token_read_package_registry_checkbox) if read_package_registry + check_element(:deploy_token_read_registry_checkbox) if read_registry + check_element(:deploy_token_write_package_registry_checkbox) if write_package_registry + end + + def add_token + click_element(:create_deploy_token_button) + end + + def token_username + within_new_project_deploy_token do + find_element(:deploy_token_user_field).value + end + end + + def token_password + within_new_project_deploy_token do + find_element(:deploy_token_field).value + end + end + + private + + def within_new_project_deploy_token + has_element?(:created_deploy_token_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) + + within_element(:created_deploy_token_container) do + yield + end + end + end + end + end + end +end diff --git a/qa/qa/page/group/settings/repository.rb b/qa/qa/page/group/settings/repository.rb new file mode 100644 index 00000000000..2cc80ef26c6 --- /dev/null +++ b/qa/qa/page/group/settings/repository.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module QA + module Page + module Group + module Settings + class Repository < Page::Base + include QA::Page::Settings::Common + + view 'app/views/shared/deploy_tokens/_index.html.haml' do + element :deploy_tokens_settings_content + end + + def expand_deploy_tokens(&block) + expand_content(:deploy_tokens_settings_content) do + Settings::GroupDeployTokens.perform(&block) + end + end + end + end + end + end +end diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb index 2c7ce69e4e5..c3170478733 100644 --- a/qa/qa/page/main/login.rb +++ b/qa/qa/page/main/login.rb @@ -53,7 +53,7 @@ module QA set_initial_password_if_present if Runtime::User.ldap_user? && user && user.username != Runtime::User.ldap_username - raise 'If an LDAP user is provided, it must be used for sign-in', QA::Resource::User::InvalidUserError + raise QA::Resource::User::InvalidUserError, 'If an LDAP user is provided, it must be used for sign-in' end if Runtime::User.ldap_user? diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb index 760741a9630..ad5cd971afc 100644 --- a/qa/qa/page/main/menu.rb +++ b/qa/qa/page/main/menu.rb @@ -11,6 +11,7 @@ module QA view 'app/views/layouts/header/_default.html.haml' do element :navbar, required: true + element :canary_badge_link element :user_avatar, required: true element :user_menu, required: true element :stop_impersonation_link @@ -168,6 +169,16 @@ module QA click_element(:stop_impersonation_link) end + # To verify whether the user has been directed to a canary web node + # @return [Boolean] result of checking existence of :canary_badge_link element + # @example: + # Menu.perform do |menu| + # expect(menu.canary?).to be(true) + # end + def canary? + has_element?(:canary_badge_link) + end + private def within_top_menu(&block) diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index afe88fc0cdc..1d8d9ed6859 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -136,14 +136,14 @@ module QA end def submit_pending_reviews + has_element?(:submit_review_button) within_element(:review_bar_content) do click_element(:review_preview_dropdown) click_element(:submit_review_button) - - # After clicking the button, wait for it to disappear - # before moving on to the next part of the test - has_no_element?(:submit_review_button) end + # After clicking the button, wait for it to disappear + # before moving on to the next part of the test + has_no_element?(:submit_review_button) end def add_comment_to_diff(text) @@ -287,6 +287,17 @@ module QA raise "Rebase did not appear to be successful" unless success end + def merge_immediately! + merge_moment_dropdown_found = has_element?(:merge_moment_dropdown, wait: 0) + + if merge_moment_dropdown_found + click_element(:merge_moment_dropdown) + click_element(:merge_immediately_menu_item) + else + click_element(:merge_button) + end + end + def try_to_merge! # Revisit after merge page re-architect is done https://gitlab.com/gitlab-org/gitlab/-/issues/300042 # To remove page refresh logic if possible diff --git a/qa/qa/page/project/monitor/metrics/show.rb b/qa/qa/page/project/monitor/metrics/show.rb index 07ceb108fa3..0129ee06cb6 100644 --- a/qa/qa/page/project/monitor/metrics/show.rb +++ b/qa/qa/page/project/monitor/metrics/show.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Page module Project diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb index c537db34a51..6df285cdd93 100644 --- a/qa/qa/page/project/settings/ci_cd.rb +++ b/qa/qa/page/project/settings/ci_cd.rb @@ -4,7 +4,7 @@ module QA module Page module Project module Settings - class CICD < Page::Base + class CiCd < Page::Base include QA::Page::Settings::Common view 'app/views/projects/settings/ci_cd/show.html.haml' do @@ -43,4 +43,4 @@ module QA end end -QA::Page::Project::Settings::CICD.prepend_mod_with("Page::Project::Settings::CICD", namespace: QA) +QA::Page::Project::Settings::CiCd.prepend_mod_with("Page::Project::Settings::CiCd", namespace: QA) diff --git a/qa/qa/page/project/settings/deploy_tokens.rb b/qa/qa/page/project/settings/deploy_tokens.rb index db1f6f68ec6..7b61c81154a 100644 --- a/qa/qa/page/project/settings/deploy_tokens.rb +++ b/qa/qa/page/project/settings/deploy_tokens.rb @@ -10,6 +10,7 @@ module QA element :deploy_token_expires_at_field element :deploy_token_read_repository_checkbox element :deploy_token_read_package_registry_checkbox + element :deploy_token_write_package_registry_checkbox element :deploy_token_read_registry_checkbox element :create_deploy_token_button end @@ -28,9 +29,10 @@ module QA fill_element(:deploy_token_expires_at_field, expires_at.to_s + "\n") end - def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false) + def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false, write_package_registry: false) check_element(:deploy_token_read_repository_checkbox) if read_repository check_element(:deploy_token_read_package_registry_checkbox) if read_package_registry + check_element(:deploy_token_write_package_registry_checkbox) if write_package_registry check_element(:deploy_token_read_registry_checkbox) if read_registry end diff --git a/qa/qa/page/view.rb b/qa/qa/page/view.rb index 613059b2d32..fa17b8fe302 100644 --- a/qa/qa/page/view.rb +++ b/qa/qa/page/view.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'pathname' - module QA module Page class View diff --git a/qa/qa/resource/api_fabricator.rb b/qa/qa/resource/api_fabricator.rb index 034feb4e90f..c1533577657 100644 --- a/qa/qa/resource/api_fabricator.rb +++ b/qa/qa/resource/api_fabricator.rb @@ -55,7 +55,7 @@ module QA end end - include Support::Api + include Support::API attr_writer :api_resource, :api_response def api_put(body = api_put_body) diff --git a/qa/qa/resource/ci_variable.rb b/qa/qa/resource/ci_variable.rb index 0b9f4eb6635..ef663bb613f 100644 --- a/qa/qa/resource/ci_variable.rb +++ b/qa/qa/resource/ci_variable.rb @@ -22,7 +22,7 @@ module QA Page::Project::Menu.perform(&:go_to_ci_cd_settings) - Page::Project::Settings::CICD.perform do |setting| + Page::Project::Settings::CiCd.perform do |setting| setting.expand_ci_variables do |page| page.click_add_variable page.fill_variable(key, value, masked) diff --git a/qa/qa/resource/deploy_token.rb b/qa/qa/resource/deploy_token.rb index cd638ad2f85..151454c37b1 100644 --- a/qa/qa/resource/deploy_token.rb +++ b/qa/qa/resource/deploy_token.rb @@ -37,7 +37,7 @@ module QA setting.expand_deploy_tokens do |page| page.fill_token_name(name) page.fill_token_expires_at(expires_at) - page.fill_scopes(read_repository: true, read_package_registry: true) + page.fill_scopes(read_repository: true, read_package_registry: true, write_package_registry: true) page.add_token end diff --git a/qa/qa/resource/group_base.rb b/qa/qa/resource/group_base.rb index b937b704613..a1e5b19f409 100644 --- a/qa/qa/resource/group_base.rb +++ b/qa/qa/resource/group_base.rb @@ -30,6 +30,22 @@ module QA end end + # Get group milestones + # + # @return [Array] + def milestones + parse_body(api_get_from("#{api_get_path}/milestones")).map do |milestone| + GroupMilestone.init do |resource| + resource.api_client = api_client + resource.group = self + resource.id = milestone[:id] + resource.iid = milestone[:iid] + resource.title = milestone[:title] + resource.description = milestone[:description] + end + end + end + # API get path # # @return [String] diff --git a/qa/qa/resource/group_deploy_token.rb b/qa/qa/resource/group_deploy_token.rb new file mode 100644 index 00000000000..410a7e6253f --- /dev/null +++ b/qa/qa/resource/group_deploy_token.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module QA + module Resource + class GroupDeployToken < Base + attr_accessor :name, :expires_at + + attribute :username do + Page::Group::Settings::Repository.perform do |repository_page| + repository_page.expand_deploy_tokens(&:token_username) + end + end + + attribute :password do + Page::Group::Settings::Repository.perform do |repository_page| + repository_page.expand_deploy_tokens(&:token_password) + end + end + + attribute :group do + Group.fabricate! do |resource| + resource.name = 'group-with-deploy-token' + resource.description = 'group for adding deploy token test' + end + end + + attribute :project do + Project.fabricate! do |resource| + resource.name = 'project-to-deploy' + resource.description = 'project for adding deploy token test' + end + end + + def fabricate! + group.visit! + + Page::Group::Menu.perform(&:go_to_repository_settings) + + Page::Group::Settings::Repository.perform do |setting| + setting.expand_deploy_tokens do |page| + page.fill_token_name(name) + page.fill_token_expires_at(expires_at) + page.fill_scopes(read_repository: true, read_package_registry: true, write_package_registry: true) + + page.add_token + end + end + end + end + end +end diff --git a/qa/qa/resource/group_milestone.rb b/qa/qa/resource/group_milestone.rb index 1fb07fdbd0b..880ca2b9721 100644 --- a/qa/qa/resource/group_milestone.rb +++ b/qa/qa/resource/group_milestone.rb @@ -3,11 +3,14 @@ module QA module Resource class GroupMilestone < Base - attr_writer :start_date, :due_date - - attribute :id - attribute :title - attribute :description + attributes :id, + :iid, + :title, + :description, + :start_date, + :due_date, + :updated_at, + :created_at attribute :group do Group.fabricate_via_api! do |resource| @@ -20,6 +23,21 @@ module QA @description = "My awesome group milestone." end + def fabricate! + group.visit! + + Page::Group::Menu.perform(&:go_to_milestones) + Page::Group::Milestone::Index.perform(&:click_new_milestone_link) + + Page::Group::Milestone::New.perform do |new_milestone| + new_milestone.set_title(@title) + new_milestone.set_description(@description) + new_milestone.set_start_date(@start_date) if @start_date + new_milestone.set_due_date(@due_date) if @due_date + new_milestone.click_create_milestone_button + end + end + def api_get_path "/groups/#{group.id}/milestones/#{id}" end @@ -38,19 +56,36 @@ module QA end end - def fabricate! - group.visit! + # Object comparison + # + # @param [QA::Resource::GroupMilestone] other + # @return [Boolean] + def ==(other) + other.is_a?(GroupMilestone) && comparable_milestone == other.comparable_milestone + end - Page::Group::Menu.perform(&:go_to_milestones) - Page::Group::Milestone::Index.perform(&:click_new_milestone_link) + # Override inspect for a better rspec failure diff output + # + # @return [String] + def inspect + JSON.pretty_generate(comparable_milestone) + end - Page::Group::Milestone::New.perform do |new_milestone| - new_milestone.set_title(@title) - new_milestone.set_description(@description) - new_milestone.set_start_date(@start_date) if @start_date - new_milestone.set_due_date(@due_date) if @due_date - new_milestone.click_create_milestone_button - end + protected + + # Return subset of fields for comparing milestones + # + # @return [Hash] + def comparable_milestone + reload! unless api_response + + api_response.slice( + :title, + :description, + :state, + :due_date, + :start_date + ) end end end diff --git a/qa/qa/resource/issue.rb b/qa/qa/resource/issue.rb index c45ab7593b6..9214d4eff4a 100644 --- a/qa/qa/resource/issue.rb +++ b/qa/qa/resource/issue.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class Issue < Base @@ -18,12 +16,14 @@ module QA :iid, :assignee_ids, :labels, - :title + :title, + :description def initialize @assignee_ids = [] @labels = [] @title = "Issue title #{SecureRandom.hex(8)}" + @description = "Issue description #{SecureRandom.hex(8)}" end def fabricate! @@ -34,7 +34,7 @@ module QA Page::Project::Issue::New.perform do |new_page| new_page.fill_title(@title) new_page.choose_template(@template) if @template - new_page.fill_description(@description) if @description + new_page.fill_description(@description) if @description && !@template new_page.choose_milestone(@milestone) if @milestone new_page.create_new_issue end @@ -64,6 +64,7 @@ module QA }.tap do |hash| hash[:milestone_id] = @milestone.id if @milestone hash[:weight] = @weight if @weight + hash[:description] = @description if @description end end diff --git a/qa/qa/resource/kubernetes_cluster/base.rb b/qa/qa/resource/kubernetes_cluster/base.rb index 38bca48be17..b3812d60431 100644 --- a/qa/qa/resource/kubernetes_cluster/base.rb +++ b/qa/qa/resource/kubernetes_cluster/base.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource module KubernetesCluster diff --git a/qa/qa/resource/label_base.rb b/qa/qa/resource/label_base.rb index 14ddd0809ea..b1af0e23561 100644 --- a/qa/qa/resource/label_base.rb +++ b/qa/qa/resource/label_base.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource # Base label class for GroupLabel and ProjectLabel @@ -66,9 +64,9 @@ module QA JSON.pretty_generate(comparable_label) end - # protected + protected - # Return subset of fields for comparing groups + # Return subset of fields for comparing labels # # @return [Hash] def comparable_label diff --git a/qa/qa/resource/members.rb b/qa/qa/resource/members.rb index c8f9feeca15..83adb10c3a0 100644 --- a/qa/qa/resource/members.rb +++ b/qa/qa/resource/members.rb @@ -12,7 +12,7 @@ module QA QA::Runtime::Logger.debug(%Q[Adding user #{user.username} to #{full_path} #{self.class.name}]) response = post Runtime::API::Request.new(api_client, api_members_path).url, { user_id: user.id, access_level: access_level } - response.code == QA::Support::Api::HTTP_STATUS_CREATED + response.code == QA::Support::API::HTTP_STATUS_CREATED end end @@ -31,7 +31,7 @@ module QA QA::Runtime::Logger.debug(%Q[Sharing #{self.class.name} with #{group.name}]) response = post Runtime::API::Request.new(api_client, api_share_path).url, { group_id: group.id, group_access: access_level } - response.code == QA::Support::Api::HTTP_STATUS_CREATED + response.code == QA::Support::API::HTTP_STATUS_CREATED end end diff --git a/qa/qa/resource/merge_request.rb b/qa/qa/resource/merge_request.rb index 8c313f5d518..1fea6feb910 100644 --- a/qa/qa/resource/merge_request.rb +++ b/qa/qa/resource/merge_request.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class MergeRequest < Base @@ -25,7 +23,7 @@ module QA :state attribute :project do - Project.fabricate! do |resource| + Project.fabricate_via_api! do |resource| resource.name = 'project-with-merge-request' end end diff --git a/qa/qa/resource/merge_request_from_fork.rb b/qa/qa/resource/merge_request_from_fork.rb index b0367df64ed..4eebbdf0a52 100644 --- a/qa/qa/resource/merge_request_from_fork.rb +++ b/qa/qa/resource/merge_request_from_fork.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class MergeRequestFromFork < MergeRequest diff --git a/qa/qa/resource/package.rb b/qa/qa/resource/package.rb index 0e8c3ee95de..b3decb1e2ab 100644 --- a/qa/qa/resource/package.rb +++ b/qa/qa/resource/package.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class Package < Base diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb index 53b8a9b0246..5ad55090f8c 100644 --- a/qa/qa/resource/project.rb +++ b/qa/qa/resource/project.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class Project < Base diff --git a/qa/qa/resource/project_imported_from_github.rb b/qa/qa/resource/project_imported_from_github.rb index 8aa19555d50..cffeed7a64b 100644 --- a/qa/qa/resource/project_imported_from_github.rb +++ b/qa/qa/resource/project_imported_from_github.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'octokit' - module QA module Resource class ProjectImportedFromGithub < Resource::Project @@ -68,7 +66,7 @@ module QA response = post(request_url(api_trigger_mirror_pull_path), nil) Runtime::Logger.info "Mirror pull request response: #{response}" - response.code == Support::Api::HTTP_STATUS_OK + response.code == Support::API::HTTP_STATUS_OK end end diff --git a/qa/qa/resource/project_imported_from_url.rb b/qa/qa/resource/project_imported_from_url.rb index f159a174840..9880504d886 100644 --- a/qa/qa/resource/project_imported_from_url.rb +++ b/qa/qa/resource/project_imported_from_url.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class ProjectImportedFromURL < Resource::Project diff --git a/qa/qa/resource/project_issue_note.rb b/qa/qa/resource/project_issue_note.rb index 0eb34380332..a68c68c660a 100644 --- a/qa/qa/resource/project_issue_note.rb +++ b/qa/qa/resource/project_issue_note.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class ProjectIssueNote < Base diff --git a/qa/qa/resource/protected_branch.rb b/qa/qa/resource/protected_branch.rb index 7eb5442a964..7db6450acf8 100644 --- a/qa/qa/resource/protected_branch.rb +++ b/qa/qa/resource/protected_branch.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class ProtectedBranch < Base diff --git a/qa/qa/resource/registry_repository.rb b/qa/qa/resource/registry_repository.rb index 3de409232dd..148af353a25 100644 --- a/qa/qa/resource/registry_repository.rb +++ b/qa/qa/resource/registry_repository.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class RegistryRepository < Base diff --git a/qa/qa/resource/repository/project_push.rb b/qa/qa/resource/repository/project_push.rb index ef4873e9483..d0e94951f3b 100644 --- a/qa/qa/resource/repository/project_push.rb +++ b/qa/qa/resource/repository/project_push.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource module Repository diff --git a/qa/qa/resource/repository/push.rb b/qa/qa/resource/repository/push.rb index f5b6040d927..00bed7ed546 100644 --- a/qa/qa/resource/repository/push.rb +++ b/qa/qa/resource/repository/push.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require 'pathname' -require 'securerandom' - module QA module Resource module Repository diff --git a/qa/qa/resource/runner.rb b/qa/qa/resource/runner.rb index 2a0823d648e..3c448816100 100644 --- a/qa/qa/resource/runner.rb +++ b/qa/qa/resource/runner.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class Runner < Base diff --git a/qa/qa/resource/ssh_key.rb b/qa/qa/resource/ssh_key.rb index 52526275cb0..9e178a425dd 100644 --- a/qa/qa/resource/ssh_key.rb +++ b/qa/qa/resource/ssh_key.rb @@ -72,7 +72,7 @@ module QA Support::Retrier.retry_until(max_duration: QA::EE::Runtime::Geo.max_db_replication_time, sleep_interval: 3) do response = get Runtime::API::Request.new(api_client, api_get_path).url - response.code == QA::Support::Api::HTTP_STATUS_OK && + response.code == QA::Support::API::HTTP_STATUS_OK && parse_body(response)[:title].include?(title) end end diff --git a/qa/qa/resource/user.rb b/qa/qa/resource/user.rb index c424d7319fe..811ce5e0505 100644 --- a/qa/qa/resource/user.rb +++ b/qa/qa/resource/user.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource class User < Base @@ -117,6 +115,10 @@ module QA '/users' end + def api_put_path + "/users/#{id}" + end + def api_block_path "/users/#{id}/block" end @@ -153,6 +155,16 @@ module QA raise ResourceUpdateFailedError, "Failed to block user. Request returned (#{response.code}): `#{response}`." end + def set_public_email + response = put(Runtime::API::Request.new(api_client, api_put_path).url, { public_email: email }) + return if response.code == HTTP_STATUS_OK + + raise( + ResourceUpdateFailedError, + "Failed to set public email. Request returned (#{response.code}): `#{response}`." + ) + end + private def ldap_post_body @@ -175,7 +187,8 @@ module QA end def fetching_own_data? - api_user&.username == username || Runtime::User.username == username + runtime_username = Runtime::User.ldap_user? ? Runtime::User.ldap_username : Runtime::User.username + api_user&.username == username || runtime_username == username end end end diff --git a/qa/qa/resource/wiki/group_page.rb b/qa/qa/resource/wiki/group_page.rb index 83beaf097ca..1e40426a389 100644 --- a/qa/qa/resource/wiki/group_page.rb +++ b/qa/qa/resource/wiki/group_page.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Resource module Wiki diff --git a/qa/qa/runtime/allure_report.rb b/qa/qa/runtime/allure_report.rb index bf49141566a..5b0456dc607 100644 --- a/qa/qa/runtime/allure_report.rb +++ b/qa/qa/runtime/allure_report.rb @@ -12,8 +12,6 @@ module QA def configure! return unless Env.generate_allure_report? - require 'allure-rspec' - configure_allure configure_attachments configure_rspec @@ -31,6 +29,13 @@ module QA AllureRspec.configure do |config| config.results_directory = 'tmp/allure-results' config.clean_results_directory = true + + # automatically attach links to testcases and issues + config.tms_tag = :testcase + config.link_tms_pattern = '{}' + config.issue_tag = :issue + config.link_issue_pattern = '{}' + config.environment_properties = environment_info if Env.running_in_ci? # Set custom environment name to separate same specs executed on different environments @@ -68,7 +73,7 @@ module QA def configure_rspec RSpec.configure do |config| config.add_formatter(AllureRspecFormatter) - config.add_formatter(QA::Support::AllureMetadataFormatter) + config.add_formatter(QA::Support::Formatters::AllureMetadataFormatter) end end diff --git a/qa/qa/runtime/api/client.rb b/qa/qa/runtime/api/client.rb index 4126ff9ff5a..8a5e22fbc37 100644 --- a/qa/qa/runtime/api/client.rb +++ b/qa/qa/runtime/api/client.rb @@ -36,16 +36,28 @@ module QA if Runtime::Env.admin_personal_access_token Runtime::API::Client.new(:gitlab, personal_access_token: Runtime::Env.admin_personal_access_token) else - user = Resource::User.fabricate_via_api! do |user| - user.username = Runtime::User.admin_username - user.password = Runtime::User.admin_password + # To return an API client that has admin access, we need a user with admin access to confirm that + # the API client user has admin access. + client = nil + Flow::Login.while_signed_in_as_admin do + admin_token = Resource::PersonalAccessToken.fabricate! do |pat| + pat.user = Runtime::User.admin + end.token + + client = Runtime::API::Client.new(:gitlab, personal_access_token: admin_token) + + user = QA::Resource::User.init do |user| + user.username = QA::Runtime::User.admin_username + user.password = QA::Runtime::User.admin_password + user.api_client = client + end.reload! + + unless user.admin? # rubocop: disable Cop/UserAdmin + raise AuthorizationError, "User '#{user.username}' is not an administrator." + end end - unless user.admin? - raise AuthorizationError, "User '#{user.username}' is not an administrator." - end - - Runtime::API::Client.new(:gitlab, user: user) + client end end end diff --git a/qa/qa/runtime/api/repository_storage_moves.rb b/qa/qa/runtime/api/repository_storage_moves.rb index d1d44bd1ab5..c3b2095be32 100644 --- a/qa/qa/runtime/api/repository_storage_moves.rb +++ b/qa/qa/runtime/api/repository_storage_moves.rb @@ -5,7 +5,7 @@ module QA module API module RepositoryStorageMoves extend self - extend Support::Api + extend Support::API RepositoryStorageMovesError = Class.new(RuntimeError) diff --git a/qa/qa/runtime/application_settings.rb b/qa/qa/runtime/application_settings.rb index 0b2aef47576..55a5ae9d06c 100644 --- a/qa/qa/runtime/application_settings.rb +++ b/qa/qa/runtime/application_settings.rb @@ -4,7 +4,7 @@ module QA module Runtime class ApplicationSettings class << self - include Support::Api + include Support::API APPLICATION_SETTINGS_PATH = '/application/settings' @@ -18,7 +18,7 @@ module QA QA::Runtime::Logger.info("Setting application settings: #{application_settings}") r = put(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url, **application_settings) - raise "Couldn't set application settings #{application_settings.inspect}" unless r.code == QA::Support::Api::HTTP_STATUS_OK + raise "Couldn't set application settings #{application_settings.inspect}" unless r.code == QA::Support::API::HTTP_STATUS_OK end def get_application_settings diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index 9097690de57..0566bc237bb 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -4,7 +4,6 @@ require 'rspec/core' require 'rspec/expectations' require 'capybara/rspec' require 'capybara-screenshot/rspec' -require 'selenium-webdriver' require 'webdrivers/chromedriver' require 'webdrivers/geckodriver' @@ -220,6 +219,28 @@ module QA yield.tap { clear! } if block_given? end + # To redirect the browser to a canary or non-canary web node + # after loading a subject test page + # @param [Boolean] Send to canary true or false + # @example: + # Runtime::Browser::Session.target_canary(true) + def self.target_canary(enable_canary) + if QA::Runtime::Env.qa_cookies.to_s.include?("gitlab_canary=true") + QA::Runtime::Logger.warn("WARNING: Setting cookie through QA_COOKIES var is incompatible with this method.") + return + end + + browser = Capybara.current_session.driver.browser + + if enable_canary + browser.manage.add_cookie name: "gitlab_canary", value: "true" + else + browser.manage.delete_cookie("gitlab_canary") + end + + browser.navigate.refresh + end + ## # Selenium allows to reset session cookies for current domain only. # diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index a076d8db9e0..cdfa95457c7 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'active_support/deprecation' -require 'gitlab/qa' require 'uri' module QA @@ -404,6 +403,10 @@ module QA ENV['GITLAB_TLS_CERTIFICATE'] end + def export_metrics? + running_in_ci? && enabled?(ENV['QA_EXPORT_TEST_METRICS'], default: true) + end + private def remote_grid_credentials diff --git a/qa/qa/runtime/feature.rb b/qa/qa/runtime/feature.rb index 7011f46542b..58408524f54 100644 --- a/qa/qa/runtime/feature.rb +++ b/qa/qa/runtime/feature.rb @@ -8,7 +8,7 @@ module QA class << self # Documentation: https://docs.gitlab.com/ee/api/features.html - include Support::Api + include Support::API SetFeatureError = Class.new(RuntimeError) AuthorizationError = Class.new(RuntimeError) @@ -17,7 +17,7 @@ module QA def remove(key) request = Runtime::API::Request.new(api_client, "/features/#{key}") response = delete(request.url) - unless response.code == QA::Support::Api::HTTP_STATUS_NO_CONTENT + unless response.code == QA::Support::API::HTTP_STATUS_NO_CONTENT raise SetFeatureError, "Deleting feature flag #{key} failed with `#{response}`." end end @@ -100,7 +100,7 @@ module QA scopes[:user] = scopes[:user].username if scopes.key?(:user) request = Runtime::API::Request.new(api_client, "/features/#{key}") response = post(request.url, scopes.merge({ value: value })) - unless response.code == QA::Support::Api::HTTP_STATUS_CREATED + unless response.code == QA::Support::API::HTTP_STATUS_CREATED raise SetFeatureError, "Setting feature flag #{key} to #{value} failed with `#{response}`." end end diff --git a/qa/qa/runtime/fixtures.rb b/qa/qa/runtime/fixtures.rb index ed051b18a9a..05dee4bfce5 100644 --- a/qa/qa/runtime/fixtures.rb +++ b/qa/qa/runtime/fixtures.rb @@ -5,7 +5,7 @@ require 'tmpdir' module QA module Runtime module Fixtures - include Support::Api + include Support::API TemplateNotFoundError = Class.new(RuntimeError) diff --git a/qa/qa/runtime/ip_address.rb b/qa/qa/runtime/ip_address.rb index f370882e5c7..bec5c412a6a 100644 --- a/qa/qa/runtime/ip_address.rb +++ b/qa/qa/runtime/ip_address.rb @@ -4,7 +4,7 @@ require 'socket' module QA module Runtime module IPAddress - include Support::Api + include Support::API HostUnreachableError = Class.new(StandardError) LOOPBACK_ADDRESS = '127.0.0.1' @@ -15,7 +15,7 @@ module QA # we use the public facing IP address ip_address = if Env.running_in_ci? && !URI.parse(Scenario.gitlab_address).host.include?('test') response = get(PUBLIC_IP_ADDRESS_API) - raise HostUnreachableError, "#{PUBLIC_IP_ADDRESS_API} is unreachable" unless response.code == Support::Api::HTTP_STATUS_OK + raise HostUnreachableError, "#{PUBLIC_IP_ADDRESS_API} is unreachable" unless response.code == Support::API::HTTP_STATUS_OK response.body elsif page.current_host.include?('localhost') diff --git a/qa/qa/runtime/release.rb b/qa/qa/runtime/release.rb index 029c8fc037e..c0a090ef552 100644 --- a/qa/qa/runtime/release.rb +++ b/qa/qa/runtime/release.rb @@ -13,10 +13,6 @@ module QA # CE to EE. # class Release - def initialize - require "qa/#{version.downcase}/strategy" - end - def version @version ||= ::File.directory?("#{__dir__}/../ee") ? :EE : :CE end diff --git a/qa/qa/runtime/search.rb b/qa/qa/runtime/search.rb index f7f87d96e68..a0ad84285be 100644 --- a/qa/qa/runtime/search.rb +++ b/qa/qa/runtime/search.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Runtime module Search extend self - extend Support::Api + extend Support::API + + RETRY_MAX_ITERATION = 10 + RETRY_SLEEP_INTERVAL = 12 + INSERT_RECALL_THRESHOLD = RETRY_MAX_ITERATION * RETRY_SLEEP_INTERVAL ElasticSearchServerError = Class.new(RuntimeError) @@ -85,7 +87,7 @@ module QA private def find_target_in_scope(scope, search_term) - QA::Support::Retrier.retry_until(max_attempts: 10, sleep_interval: 10, raise_on_failure: true, retry_on_exception: true) do + QA::Support::Retrier.retry_until(max_attempts: RETRY_MAX_ITERATION, sleep_interval: RETRY_SLEEP_INTERVAL, raise_on_failure: true, retry_on_exception: true) do result = search(scope, search_term) result && result.any? { |record| yield record } end diff --git a/qa/qa/runtime/user.rb b/qa/qa/runtime/user.rb index a836206034d..0af42470a7c 100644 --- a/qa/qa/runtime/user.rb +++ b/qa/qa/runtime/user.rb @@ -34,7 +34,7 @@ module QA end def ldap_user? - Runtime::Env.ldap_username && Runtime::Env.ldap_password + Runtime::Env.ldap_username.present? && Runtime::Env.ldap_password.present? end def ldap_username diff --git a/qa/qa/service/docker_run/gitlab_runner.rb b/qa/qa/service/docker_run/gitlab_runner.rb index 63fbf758231..595d47bf162 100644 --- a/qa/qa/service/docker_run/gitlab_runner.rb +++ b/qa/qa/service/docker_run/gitlab_runner.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'resolv' -require 'securerandom' module QA module Service diff --git a/qa/qa/service/kubernetes_cluster.rb b/qa/qa/service/kubernetes_cluster.rb index adef1b46af2..674bcdca9bb 100644 --- a/qa/qa/service/kubernetes_cluster.rb +++ b/qa/qa/service/kubernetes_cluster.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true -require 'securerandom' require 'mkmf' -require 'pathname' module QA module Service diff --git a/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb b/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb index 6bbb859b3ee..1422dd5a029 100644 --- a/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb +++ b/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb @@ -5,6 +5,7 @@ module QA describe 'Bulk group import' do let!(:staging?) { Runtime::Scenario.gitlab_address.include?('staging.gitlab.com') } + let(:import_wait_duration) { { max_duration: 300, sleep_interval: 2 } } let(:admin_api_client) { Runtime::API::Client.as_admin } let(:user) do Resource::User.fabricate_via_api! do |usr| @@ -14,7 +15,6 @@ module QA end let(:api_client) { Runtime::API::Client.new(user: user) } - let(:personal_access_token) { api_client.personal_access_token } let(:sandbox) do Resource::Sandbox.fabricate_via_api! do |group| @@ -29,22 +29,6 @@ module QA end end - let(:subgroup) do - Resource::Group.fabricate_via_api! do |group| - group.api_client = api_client - group.sandbox = source_group - group.path = "subgroup-for-import-#{SecureRandom.hex(4)}" - end - end - - let(:imported_subgroup) do - Resource::Group.init do |group| - group.api_client = api_client - group.sandbox = imported_group - group.path = subgroup.path - end - end - let(:imported_group) do Resource::BulkImportGroup.fabricate_via_api! do |group| group.api_client = api_client @@ -54,47 +38,88 @@ module QA end before do - Runtime::Feature.enable(:bulk_import) unless staging? Runtime::Feature.enable(:top_level_group_creation_enabled) if staging? sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER) + end - Resource::GroupLabel.fabricate_via_api! do |label| - label.api_client = api_client - label.group = source_group - label.title = "source-group-#{SecureRandom.hex(4)}" + context 'with subgroups and labels' do + let(:subgroup) do + Resource::Group.fabricate_via_api! do |group| + group.api_client = api_client + group.sandbox = source_group + group.path = "subgroup-for-import-#{SecureRandom.hex(4)}" + end end - Resource::GroupLabel.fabricate_via_api! do |label| - label.api_client = api_client - label.group = subgroup - label.title = "subgroup-#{SecureRandom.hex(4)}" + + let(:imported_subgroup) do + Resource::Group.init do |group| + group.api_client = api_client + group.sandbox = imported_group + group.path = subgroup.path + end + end + + before do + Resource::GroupLabel.fabricate_via_api! do |label| + label.api_client = api_client + label.group = source_group + label.title = "source-group-#{SecureRandom.hex(4)}" + end + Resource::GroupLabel.fabricate_via_api! do |label| + label.api_client = api_client + label.group = subgroup + label.title = "subgroup-#{SecureRandom.hex(4)}" + end + end + + it( + 'successfully imports groups and labels', + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1873' + ) do + expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration) + + aggregate_failures do + expect(imported_group.reload!).to eq(source_group) + expect(imported_group.labels).to include(*source_group.labels) + + expect(imported_subgroup.reload!).to eq(subgroup) + expect(imported_subgroup.labels).to include(*subgroup.labels) + end end end - # Non blocking issues: - # https://gitlab.com/gitlab-org/gitlab/-/issues/331252 - # https://gitlab.com/gitlab-org/gitlab/-/issues/333678 <- can cause 500 when creating user and group back to back - it( - 'imports group with subgroups and labels', - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1871' - ) do - expect { imported_group.import_status }.to( - eventually_eq('finished').within(max_duration: 300, sleep_interval: 2) - ) - - aggregate_failures do - expect(imported_group.reload!).to eq(source_group) - expect(imported_group.labels).to include(*source_group.labels) - - expect(imported_subgroup.reload!).to eq(subgroup) - expect(imported_subgroup.labels).to include(*subgroup.labels) + context 'with milestones' do + let(:source_milestone) do + Resource::GroupMilestone.fabricate_via_api! do |milestone| + milestone.api_client = api_client + milestone.group = source_group + end + end + + before do + source_milestone + end + + it( + 'successfully imports group milestones', + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2245' + ) do + expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration) + + imported_milestone = imported_group.reload!.milestones.find { |ml| ml.title == source_milestone.title } + aggregate_failures do + expect(imported_milestone).to eq(source_milestone) + expect(imported_milestone.iid).to eq(source_milestone.iid) + expect(imported_milestone.created_at).to eq(source_milestone.created_at) + expect(imported_milestone.updated_at).to eq(source_milestone.updated_at) + end end end after do user.remove_via_api! ensure - Runtime::Feature.disable(:bulk_import) unless staging? Runtime::Feature.disable(:top_level_group_creation_enabled) if staging? end end diff --git a/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb index 72a0a761294..744f39525b9 100644 --- a/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb +++ b/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb @@ -30,7 +30,7 @@ module QA user.remove_via_api! end - it 'imports Github repo via api', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1858' do + it 'imports Github repo via api', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1878' do imported_project # import the project expect { imported_project.reload!.import_status }.to eventually_eq('finished').within(max_duration: 90) diff --git a/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb index 385908f2176..b51a79f239c 100644 --- a/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb +++ b/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'octokit' - # rubocop:disable Rails/Pluck module QA # Only executes in custom job/pipeline @@ -130,10 +128,10 @@ module QA ) end - it 'imports large Github repo via api' do + it 'imports large Github repo via api', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1880' do start = Time.now - imported_project # import the project + Runtime::Logger.info("Importing project '#{imported_project.full_path}'") # import the project and log path fetch_github_objects # fetch all objects right after import has started import_status = lambda do @@ -221,32 +219,39 @@ module QA # @return [void] def verify_mrs_or_issues(type) msg = ->(title) { "expected #{type} with title '#{title}' to have" } + + # Compare length to have easy to read overview how many objects are missing expected = type == 'mr' ? mrs : gl_issues actual = type == 'mr' ? gh_prs : gh_issues + count_msg = "Expected to contain same amount of #{type}s. Gitlab: #{expected.length}, Github: #{actual.length}" + expect(expected.length).to eq(actual.length), count_msg - # Compare length to have easy to read overview how many objects are missing - expect(expected.length).to( - eq(actual.length), - "Expected to contain same amount of #{type}s. Expected: #{expected.length}, actual: #{actual.length}" - ) logger.debug("= Comparing #{type}s =") actual.each do |title, actual_item| print "." # indicate that it is still going but don't spam the output with newlines expected_item = expected[title] + # Print title in the error message to see which object is missing expect(expected_item).to be_truthy, "#{msg.call(title)} been imported" next unless expected_item - expect(expected_item[:body]).to( - include(actual_item[:body]), - "#{msg.call(title)} same description. diff:\n#{differ.diff(expected_item[:body], actual_item[:body])}" - ) - expect(expected_item[:comments].length).to( - eq(actual_item[:comments].length), - "#{msg.call(title)} same amount of comments" - ) - expect(expected_item[:comments]).to match_array(actual_item[:comments]) + # Print difference in the description + expected_body = expected_item[:body] + actual_body = actual_item[:body] + body_msg = <<~MSG + #{msg.call(title)} same description. diff:\n#{differ.diff(expected_item[:body], actual_item[:body])} + MSG + expect(expected_body).to include(actual_body), body_msg + + # Print amount difference first + expected_comments = expected_item[:comments] + actual_comments = actual_item[:comments] + comment_count_msg = <<~MSG + #{msg.call(title)} same amount of comments. Gitlab: #{expected_comments.length}, Github: #{actual_comments.length} + MSG + expect(expected_comments.length).to eq(actual_comments.length), comment_count_msg + expect(expected_comments).to match_array(actual_comments) end puts # print newline after last print to make output pretty end diff --git a/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb b/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb index 6024c8658d5..47c07875257 100644 --- a/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb +++ b/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb @@ -9,7 +9,7 @@ module QA end context 'for the same project' do - it 'can be used to create a file via the project API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1734' do + it 'can be used to create a file via the project API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1823' do expect do Resource::File.fabricate_via_api! do |file| file.api_client = @user_api_client @@ -22,7 +22,7 @@ module QA end.not_to raise_error end - it 'can be used to commit via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1735' do + it 'can be used to commit via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1822' do expect do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.api_client = @user_api_client @@ -43,7 +43,7 @@ module QA @different_project = Resource::Project.fabricate! end - it 'cannot be used to create a file via the project API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1736' do + it 'cannot be used to create a file via the project API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1821' do expect do Resource::File.fabricate_via_api! do |file| file.api_client = @user_api_client @@ -56,7 +56,7 @@ module QA end.to raise_error(Resource::ApiFabricator::ResourceFabricationFailedError, /403 Forbidden/) end - it 'cannot be used to commit via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1737' do + it 'cannot be used to commit via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1820' do expect do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.api_client = @user_api_client diff --git a/qa/qa/specs/features/api/1_manage/rate_limits_spec.rb b/qa/qa/specs/features/api/1_manage/rate_limits_spec.rb index ae1c3a9fbcc..9eb1bd985ea 100644 --- a/qa/qa/specs/features/api/1_manage/rate_limits_spec.rb +++ b/qa/qa/specs/features/api/1_manage/rate_limits_spec.rb @@ -8,7 +8,7 @@ module QA let(:api_client) { Runtime::API::Client.new(:gitlab, ip_limits: true) } let(:request) { Runtime::API::Request.new(api_client, '/users') } - it 'GET /users', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/441' do + it 'GET /users', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1567' do 5.times do get request.url expect_status(200) diff --git a/qa/qa/specs/features/api/1_manage/user_access_termination_spec.rb b/qa/qa/specs/features/api/1_manage/user_access_termination_spec.rb index a069b94f4da..a149c42877f 100644 --- a/qa/qa/specs/features/api/1_manage/user_access_termination_spec.rb +++ b/qa/qa/specs/features/api/1_manage/user_access_termination_spec.rb @@ -30,7 +30,7 @@ module QA @group.sandbox.remove_member(@user) end - it 'is not allowed to push code via the CLI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1660' do + it 'is not allowed to push code via the CLI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1712' do expect do Resource::Repository::Push.fabricate! do |push| push.repository_http_uri = @project.repository_http_location.uri @@ -43,7 +43,7 @@ module QA end.to raise_error(QA::Support::Run::CommandError, /You are not allowed to push code to this project/) end - it 'is not allowed to create a file via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1661' do + it 'is not allowed to create a file via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1711' do expect do Resource::File.fabricate_via_api! do |file| file.api_client = @user_api_client @@ -56,7 +56,7 @@ module QA end.to raise_error(Resource::ApiFabricator::ResourceFabricationFailedError, /403 Forbidden/) end - it 'is not allowed to commit via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1662' do + it 'is not allowed to commit via the API', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1710' do expect do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.api_client = @user_api_client diff --git a/qa/qa/specs/features/api/1_manage/users_spec.rb b/qa/qa/specs/features/api/1_manage/users_spec.rb index bca0e1f67e8..b705ce9e174 100644 --- a/qa/qa/specs/features/api/1_manage/users_spec.rb +++ b/qa/qa/specs/features/api/1_manage/users_spec.rb @@ -8,13 +8,13 @@ module QA let(:api_client) { Runtime::API::Client.new(:gitlab) } let(:request) { Runtime::API::Request.new(api_client, '/users') } - it 'GET /users', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/460' do + it 'GET /users', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1552' do get request.url expect_status(200) end - it 'GET /users/:username with a valid username', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/480' do + it 'GET /users/:username with a valid username', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1544' do get request.url, { params: { username: Runtime::User.username } } expect_status(200) @@ -23,7 +23,7 @@ module QA ) end - it 'GET /users/:username with an invalid username', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/462' do + it 'GET /users/:username with an invalid username', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1551' do get request.url, { params: { username: SecureRandom.hex(10) } } expect_status(200) diff --git a/qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb b/qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb index 8b8c9b4c8b1..dabd97d69d0 100644 --- a/qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb +++ b/qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb @@ -4,7 +4,7 @@ require 'airborne' module QA RSpec.describe 'Plan' do - include Support::Api + include Support::API describe 'Issue' do let(:issue) do @@ -22,7 +22,7 @@ module QA push_commit('Initial commit') end - it 'closes via pushing a commit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/423' do + it 'closes via pushing a commit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1579' do push_commit("Closes ##{issue_id}", false) Support::Retrier.retry_until(max_duration: 10, sleep_interval: 1) do diff --git a/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb index 223ed02bb47..19fdb37f788 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb @@ -28,7 +28,7 @@ module QA praefect_manager.reset_primary_to_original end - it 'automatically fails over', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/976' do + it 'automatically fails over', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1267' do # Create a new project with a commit and wait for it to replicate Resource::Repository::ProjectPush.fabricate! do |push| push.project = project @@ -66,7 +66,7 @@ module QA end context 'when recovering from dataloss after failover' do - it 'automatically reconciles', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/238187', type: :stale }, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/977' do + it 'automatically reconciles', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/238187', type: :stale }, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1266' do # Start the old primary node again praefect_manager.start_primary_node praefect_manager.wait_for_health_check_current_primary_node diff --git a/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb index c90f8546f91..f00321ee3f5 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb @@ -22,7 +22,7 @@ module QA praefect_manager.reset_primary_to_original end - it 'recovers from dataloss', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/978' do + it 'recovers from dataloss', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1265' do # Create a new project with a commit and wait for it to replicate praefect_manager.wait_for_replication(project.id) diff --git a/qa/qa/specs/features/api/3_create/gitaly/changing_repository_storage_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/changing_repository_storage_spec.rb index 176f1139a7a..a4251475e97 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/changing_repository_storage_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/changing_repository_storage_spec.rb @@ -24,7 +24,7 @@ module QA end end - context 'when moving from one Gitaly storage to another', :orchestrated, :repository_storage, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/973' do + context 'when moving from one Gitaly storage to another', :orchestrated, :repository_storage, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1270' do let(:source_storage) { { type: :gitaly, name: 'default' } } let(:destination_storage) { { type: :gitaly, name: QA::Runtime::Env.additional_repository_storage } } let(:project) do @@ -45,7 +45,7 @@ module QA # Note: This test doesn't have the :orchestrated tag because it runs in the Test::Integration::Praefect # scenario with other tests that aren't considered orchestrated. # It also runs on staging using nfs-file07 as non-cluster storage and nfs-file22 as cluster/praefect storage - context 'when moving from Gitaly to Gitaly Cluster', :requires_praefect, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1755', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/284645', type: :investigating } do + context 'when moving from Gitaly to Gitaly Cluster', :requires_praefect, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1269', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/284645', type: :investigating } do let(:source_storage) { { type: :gitaly, name: QA::Runtime::Env.non_cluster_repository_storage } } let(:destination_storage) { { type: :praefect, name: QA::Runtime::Env.praefect_repository_storage } } let(:project) do diff --git a/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb index 6c70c09c7ab..1aea1bd1189 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb @@ -19,7 +19,7 @@ module QA praefect_manager.wait_for_replication(project.id) end - it 'reads from each node', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/979' do + it 'reads from each node', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1264' do pre_read_data = praefect_manager.query_read_distribution wait_for_reads_to_increase(project, number_of_reads_per_loop, pre_read_data) @@ -47,7 +47,7 @@ module QA praefect_manager.wait_for_reliable_connection end - it 'does not read from the unhealthy node', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/980' do + it 'does not read from the unhealthy node', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1263' do pre_read_data = praefect_manager.query_read_distribution read_from_project(project, number_of_reads_per_loop * 10) diff --git a/qa/qa/specs/features/api/3_create/gitaly/gitaly_mtls_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/gitaly_mtls_spec.rb index 8c3b8d88a29..237b8055d94 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/gitaly_mtls_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/gitaly_mtls_spec.rb @@ -8,7 +8,7 @@ module QA let(:first_added_commit_message) { 'commit over git' } let(:second_added_commit_message) { 'commit over api' } - it 'pushes to gitaly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1118' do + it 'pushes to gitaly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1843' do project = Resource::Project.fabricate! do |project| project.name = "mTLS" project.initialize_with_readme = true diff --git a/qa/qa/specs/features/api/3_create/gitaly/praefect_replication_queue_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/praefect_replication_queue_spec.rb index 7e924475437..cd60f3fdf7c 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/praefect_replication_queue_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/praefect_replication_queue_spec.rb @@ -19,7 +19,7 @@ module QA praefect_manager.clear_replication_queue end - it 'allows replication of different repository after interruption', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/975' do + it 'allows replication of different repository after interruption', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1268' do # We want to fill the replication queue with 10 `in_progress` jobs, # while a lock has been acquired, which is when the problem occurred # as reported in https://gitlab.com/gitlab-org/gitaly/-/issues/2801 diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb index 2391154030b..26ca6de29f7 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb @@ -31,7 +31,7 @@ module QA end end - it 'sets labels', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1032' do + it 'sets labels', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1244' do create_new_mr_via_push merge_request = project.merge_request_with_title(title) @@ -45,7 +45,7 @@ module QA create_new_mr_via_push end - it 'removes them on subsequent push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1033' do + it 'removes them on subsequent push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1243' do Resource::Repository::ProjectPush.fabricate! do |push| push.project = project push.file_content = "Unlabel test #{SecureRandom.hex(8)}" diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb index 157a9e92817..164507d8fca 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb @@ -29,7 +29,7 @@ module QA runner.remove_via_api! end - it 'sets merge when pipeline succeeds', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1037' do + it 'sets merge when pipeline succeeds', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1240' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' @@ -72,7 +72,7 @@ module QA expect(merge_request.merge_when_pipeline_succeeds).to be true end - it 'merges when pipeline succeeds', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1036' do + it 'merges when pipeline succeeds', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1241' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_remove_source_branch_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_remove_source_branch_spec.rb index eb93f4cd5cb..32c7196e9fb 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_remove_source_branch_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_remove_source_branch_spec.rb @@ -17,7 +17,7 @@ module QA end end - it 'removes the source branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1035' do + it 'removes the source branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1242' do Resource::Repository::ProjectPush.fabricate! do |push| push.project = project push.branch_name = branch diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb index 9ac27a2ca06..b0e616c2d1d 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb @@ -16,7 +16,7 @@ module QA end end - it 'sets a target branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1034' do + it 'sets a target branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1646' do target_branch = "push-options-test-target-#{SecureRandom.hex(8)}" Resource::Repository::ProjectPush.fabricate! do |push| diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_title_description_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_title_description_spec.rb index 62e6290183f..c898646c0de 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_title_description_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_title_description_spec.rb @@ -14,7 +14,7 @@ module QA end end - it 'sets title and description', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1038' do + it 'sets title and description', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1239' do description = "This is a test of MR push options" title = "MR push options test #{SecureRandom.hex(8)}" diff --git a/qa/qa/specs/features/api/3_create/repository/default_branch_name_setting_spec.rb b/qa/qa/specs/features/api/3_create/repository/default_branch_name_setting_spec.rb index f86bbee05c2..b2a184c2374 100644 --- a/qa/qa/specs/features/api/3_create/repository/default_branch_name_setting_spec.rb +++ b/qa/qa/specs/features/api/3_create/repository/default_branch_name_setting_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Create' do describe 'Default branch name instance setting', :requires_admin, :skip_live_env do @@ -13,7 +11,7 @@ module QA Runtime::ApplicationSettings.restore_application_settings(:default_branch_name) end - it 'sets the default branch name for a new project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1018' do + it 'sets the default branch name for a new project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1247' do project = Resource::Project.fabricate_via_api! do |project| project.name = "default-branch-name" project.initialize_with_readme = true @@ -32,7 +30,7 @@ module QA end end - it 'allows a project to be created via the CLI with a different default branch name', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1019' do + it 'allows a project to be created via the CLI with a different default branch name', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1246' do project_name = "default-branch-name-via-cli-#{SecureRandom.hex(8)}" group = Resource::Group.fabricate_via_api! diff --git a/qa/qa/specs/features/api/3_create/repository/files_spec.rb b/qa/qa/specs/features/api/3_create/repository/files_spec.rb index 1099234537a..4141b4343a0 100644 --- a/qa/qa/specs/features/api/3_create/repository/files_spec.rb +++ b/qa/qa/specs/features/api/3_create/repository/files_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'airborne' -require 'securerandom' module QA RSpec.describe 'API basics' do @@ -12,7 +11,7 @@ module QA let(:project_name) { "api-basics-#{SecureRandom.hex(8)}" } let(:sanitized_project_path) { CGI.escape("#{Runtime::User.username}/#{project_name}") } - it 'user creates a project with a file and deletes them afterwards', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/420' do + it 'user creates a project with a file and deletes them afterwards', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1581' do create_project_request = Runtime::API::Request.new(@api_client, '/projects') post create_project_request.url, path: project_name, name: project_name @@ -78,7 +77,7 @@ module QA SVG end - it 'sets no-cache headers as expected', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/421' do + it 'sets no-cache headers as expected', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1580' do create_project_request = Runtime::API::Request.new(@api_client, '/projects') post create_project_request.url, path: project_name, name: project_name diff --git a/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb b/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb index c65d981d99a..caaa615149d 100644 --- a/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb +++ b/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb @@ -1,13 +1,12 @@ # frozen_string_literal: true require 'airborne' -require 'securerandom' require 'digest' module QA RSpec.describe 'Create' do describe 'Compare archives of different user projects with the same name and check they\'re different' do - include Support::Api + include Support::API let(:project_name) { "project-archive-download-#{SecureRandom.hex(8)}" } let(:archive_types) { %w(tar.gz tar.bz2 tar zip) } @@ -28,7 +27,7 @@ module QA end end - it 'download archives of each user project then check they are different', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/427' do + it 'download archives of each user project then check they are different', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1575' do archive_checksums = {} users.each do |user_key, user_info| diff --git a/qa/qa/specs/features/api/3_create/repository/push_postreceive_idempotent_spec.rb b/qa/qa/specs/features/api/3_create/repository/push_postreceive_idempotent_spec.rb index c06e3b9f162..34254d579cb 100644 --- a/qa/qa/specs/features/api/3_create/repository/push_postreceive_idempotent_spec.rb +++ b/qa/qa/specs/features/api/3_create/repository/push_postreceive_idempotent_spec.rb @@ -17,11 +17,11 @@ module QA project&.remove_via_api! end - it 'pushes and creates a single push event three times', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1744' do + it 'pushes and creates a single push event three times', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1840' do verify_single_event_per_push(repeat: 3) end - it 'repeatedly pushes and creates a single push event several times', :transient, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1744' do + it 'repeatedly pushes and creates a single push event several times', :transient, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1915' do verify_single_event_per_push(repeat: Runtime::Env.transient_trials) do |i| QA::Runtime::Logger.info("Transient bug test action - Trial #{i}") end diff --git a/qa/qa/specs/features/api/3_create/snippet/snippet_repository_storage_move_spec.rb b/qa/qa/specs/features/api/3_create/snippet/snippet_repository_storage_move_spec.rb index 7b82a872fc0..4b0dc9d431b 100644 --- a/qa/qa/specs/features/api/3_create/snippet/snippet_repository_storage_move_spec.rb +++ b/qa/qa/specs/features/api/3_create/snippet/snippet_repository_storage_move_spec.rb @@ -21,7 +21,7 @@ module QA praefect_manager.gitlab = 'gitlab' end - it 'moves snippet repository from one Gitaly storage to another', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1700' do + it 'moves snippet repository from one Gitaly storage to another', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1912' do expect(snippet).to have_file('original_file') expect { snippet.change_repository_storage(destination_storage[:name]) }.not_to raise_error expect { praefect_manager.verify_storage_move(source_storage, destination_storage, repo_type: :snippet) }.not_to raise_error diff --git a/qa/qa/specs/features/api/4_verify/cancel_pipeline_when_block_user_spec.rb b/qa/qa/specs/features/api/4_verify/cancel_pipeline_when_block_user_spec.rb index ecca0f94604..5d153e7736a 100644 --- a/qa/qa/specs/features/api/4_verify/cancel_pipeline_when_block_user_spec.rb +++ b/qa/qa/specs/features/api/4_verify/cancel_pipeline_when_block_user_spec.rb @@ -34,7 +34,7 @@ module QA project.remove_via_api! end - it 'pipeline schedule is canceled', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1730' do + it 'pipeline schedule is canceled', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1825' do user.block! expect(pipeline_schedule[:active]).not_to be_truthy, "Expected schedule active state to be false - active state #{pipeline_schedule[:active]}" diff --git a/qa/qa/specs/features/api/5_package/container_registry_spec.rb b/qa/qa/specs/features/api/5_package/container_registry_spec.rb index f79a3ebbe03..5847ffa1419 100644 --- a/qa/qa/specs/features/api/5_package/container_registry_spec.rb +++ b/qa/qa/specs/features/api/5_package/container_registry_spec.rb @@ -4,7 +4,7 @@ require 'airborne' module QA RSpec.describe 'Package', only: { subdomain: %i[staging pre] } do - include Support::Api + include Support::API describe 'Container Registry' do let(:api_client) { Runtime::API::Client.new(:gitlab) } @@ -72,7 +72,7 @@ module QA registry&.remove_via_api! end - it 'pushes, pulls image to the registry and deletes image blob, manifest and tag', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1738' do + it 'pushes, pulls image to the registry and deletes image blob, manifest and tag', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1819' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.api_client = api_client commit.commit_message = 'Add .gitlab-ci.yml' diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/bulk_import_group_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/bulk_import_group_spec.rb index fe17b5c34e1..c3be58fda74 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/bulk_import_group_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/bulk_import_group_spec.rb @@ -38,7 +38,6 @@ module QA end before do - Runtime::Feature.enable(:bulk_import) unless staging? Runtime::Feature.enable(:top_level_group_creation_enabled) if staging? sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER) @@ -54,10 +53,14 @@ module QA end end - # Non blocking issues: - # https://gitlab.com/gitlab-org/gitlab/-/issues/331252 - # https://gitlab.com/gitlab-org/gitlab/-/issues/333678 <- can cause 500 when creating user and group back to back - it 'imports group from UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1785' do + it( + 'imports group from UI', + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1806', + issue_1: 'https://gitlab.com/gitlab-org/gitlab/-/issues/331252', + issue_2: 'https://gitlab.com/gitlab-org/gitlab/-/issues/333678', + # mostly impacts testing as it makes small groups import slower + issue_3: 'https://gitlab.com/gitlab-org/gitlab/-/issues/332351' + ) do Page::Group::BulkImport.perform do |import_page| import_page.import_group(imported_group.path, imported_group.sandbox.path) @@ -73,7 +76,6 @@ module QA after do user.remove_via_api! ensure - Runtime::Feature.disable(:bulk_import) unless staging? Runtime::Feature.disable(:top_level_group_creation_enabled) if staging? end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/create_group_with_mattermost_team_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/create_group_with_mattermost_team_spec.rb index 192c1a3908b..eae8e1b7e12 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/create_group_with_mattermost_team_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/create_group_with_mattermost_team_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Configure', :orchestrated, :mattermost do describe 'Mattermost support' do - it 'user creates a group with a mattermost team', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/665' do + it 'user creates a group with a mattermost team', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1459' do Flow::Login.sign_in Page::Main::Menu.perform(&:go_to_groups) diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb index 84464f7174a..2550fc86ef2 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb @@ -28,7 +28,7 @@ module QA end it 'transfers a subgroup to another group', - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1724' do + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1828' do Page::Group::Menu.perform(&:click_group_general_settings_item) Page::Group::Settings::General.perform do |general| general.transfer_group(target_group.path) diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb index 7ab5ffdf014..87ac136d802 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb @@ -44,7 +44,7 @@ module QA end it 'user transfers a project between groups', - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1703' do + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1592' do # Retry is needed here as the target group is not avaliable for transfer right away. QA::Support::Retrier.retry_on_exception(reload_page: page) do Page::File::Show.perform(&:go_to_general_settings) diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb index 8e03444b113..a3235543998 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb @@ -33,7 +33,7 @@ module QA group.add_member(developer_user, Resource::Members::AccessLevel::DEVELOPER) end - it 'allows using 2FA recovery code once only', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/972' do + it 'allows using 2FA recovery code once only', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1271' do recovery_code = enable_2fa_for_user_and_fetch_recovery_code(developer_user) Flow::Login.sign_in(as: developer_user, skip_page_validation: true) diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb index 3702f95158c..8a2bbc92eca 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb @@ -19,7 +19,7 @@ module QA enable_2fa_for_user(user) end - it 'allows 2FA code recovery via ssh' do + it 'allows 2FA code recovery via ssh', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1227' do recovery_code = Support::SSH.perform do |ssh| ssh.key = ssh_key ssh.uri = address.gsub(/(?<=:)(#{uri.port})/, ssh_port) diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb index 9b2540f67c7..ca95d567316 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Manage', :smoke do describe 'basic user login' do - it 'user logs in using basic credentials and logs out', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1690' do + it 'user logs in using basic credentials and logs out', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1578' do Flow::Login.sign_in Page::Main::Menu.perform do |menu| diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb index a8650d633c8..2fe1cbabee3 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb @@ -35,7 +35,7 @@ module QA group.add_member(developer_user, Resource::Members::AccessLevel::DEVELOPER) end - it 'allows enforcing 2FA via UI and logging in with 2FA', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/898' do + it 'allows enforcing 2FA via UI and logging in with 2FA', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1320' do enforce_two_factor_authentication_on_group(group) enable_two_factor_authentication_for_user(developer_user) diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_into_gitlab_via_ldap_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_into_gitlab_via_ldap_spec.rb index cc12dd4e315..b4b1632dfbf 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_into_gitlab_via_ldap_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_into_gitlab_via_ldap_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Manage', :orchestrated, :ldap_no_tls, :ldap_tls do describe 'LDAP login' do - it 'user logs into GitLab using LDAP credentials', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/668' do + it 'user logs into GitLab using LDAP credentials', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1456' do Flow::Login.sign_in Page::Main::Menu.perform do |menu| diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb index 366f150bcd1..f06ded7ba53 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Manage', :orchestrated, :mattermost do describe 'Mattermost login' do - it 'user logs into Mattermost using GitLab OAuth', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/666' do + it 'user logs into Mattermost using GitLab OAuth', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1458' do Flow::Login.sign_in Support::Retrier.retry_on_exception do diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/login_via_instance_wide_saml_sso_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/login_via_instance_wide_saml_sso_spec.rb index 6cd486bc84b..e3b73906fe5 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/login_via_instance_wide_saml_sso_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/login_via_instance_wide_saml_sso_spec.rb @@ -3,12 +3,15 @@ module QA RSpec.describe 'Manage', :orchestrated, :instance_saml do describe 'Instance wide SAML SSO' do - it 'user logs in to gitlab with SAML SSO', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/671' do + it( + 'user logs in to gitlab with SAML SSO', + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1453' + ) do Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_with_saml) - Vendor::SAMLIdp::Page::Login.perform do |login_page| + Vendor::SamlIdp::Page::Login.perform do |login_page| login_page.login('user1', 'user1pass') end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/maintain_log_in_mixed_env_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/maintain_log_in_mixed_env_spec.rb new file mode 100644 index 00000000000..2b1c956039f --- /dev/null +++ b/qa/qa/specs/features/browser_ui/1_manage/login/maintain_log_in_mixed_env_spec.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Manage', :mixed_env, :smoke, only: { subdomain: :staging } do + describe 'basic user' do + it 'remains logged in when redirected from canary to non-canary node', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2251' do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + + Support::Retrier.retry_until(sleep_interval: 0.5) do + Page::Main::Login.perform(&:can_sign_in?) + end + + Runtime::Browser::Session.target_canary(true) + Flow::Login.sign_in + + verify_session_on_canary(true) + + Runtime::Browser::Session.target_canary(false) + + verify_session_on_canary(false) + + Support::Retrier.retry_until(sleep_interval: 0.5) do + Page::Main::Menu.perform(&:sign_out) + + Page::Main::Login.perform(&:can_sign_in?) + end + end + + def verify_session_on_canary(enable_canary) + Page::Main::Menu.perform do |menu| + aggregate_failures 'testing session log in' do + expect(menu.canary?).to be(enable_canary) + expect(menu).to have_personal_area + end + end + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb index 696bbc2a7b7..45d01d0f00a 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb @@ -14,7 +14,7 @@ module QA end RSpec.describe 'Manage', :skip_signup_disabled, :requires_admin do - describe 'while LDAP is enabled', :orchestrated, :ldap_no_tls, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/935' do + describe 'while LDAP is enabled', :orchestrated, :ldap_no_tls, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1300' do before do # When LDAP is enabled, a previous test might have created a token for the LDAP 'tanuki' user who is not an admin # So we need to set it to nil in order to create a new token for admin user so that we are able to set_application_settings @@ -39,7 +39,7 @@ module QA end end - describe 'standard', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/936' do + describe 'standard', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1652' do context 'when admin approval is not required' do before(:all) do set_require_admin_approval_after_user_signup_via_api(false) @@ -66,7 +66,7 @@ module QA end end - it 'allows recreating with same credentials', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/937' do + it 'allows recreating with same credentials', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1651' do expect(Page::Main::Menu.perform(&:signed_in?)).to be_falsy Flow::Login.sign_in(as: user, skip_page_validation: true) @@ -106,7 +106,7 @@ module QA end end - it 'allows user login after approval', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1076' do + it 'allows user login after approval', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1639' do expect(page).to have_text(signed_up_waiting_approval_text) Flow::Login.sign_in(as: @user, skip_page_validation: true) diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb index bf59dcfcc4c..3eb0a5457c0 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb @@ -7,7 +7,7 @@ module QA Runtime::Feature.enable(:invite_members_group_modal) end - it 'user adds project member', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/482' do + it 'user adds project member', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1543' do Flow::Login.sign_in user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb index 564b14a872f..974d9b02f4d 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb @@ -21,7 +21,7 @@ module QA project end - context 'in group', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1857' do + context 'in group', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1620' do let(:project_name) { "project-in-group-#{SecureRandom.hex(8)}" } let(:project) do Resource::Project.fabricate_via_browser_ui! do |project| @@ -33,7 +33,7 @@ module QA it_behaves_like 'successful project creation' end - context 'in personal namespace', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1888' do + context 'in personal namespace', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1914' do let(:project_name) { "project-in-personal-namespace-#{SecureRandom.hex(8)}" } let(:project) do Resource::Project.fabricate_via_browser_ui! do |project| diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb index 6e0ed4adb63..e48a03b5661 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'nokogiri' - module QA RSpec.describe 'Manage', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/212145', type: :stale } do describe 'Check for broken images', :requires_admin do @@ -41,13 +39,13 @@ module QA end end - context 'when logged in as a new user', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1693' do + context 'when logged in as a new user', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1549' do it_behaves_like 'loads all images' do let(:new_user) { @new_user } end end - context 'when logged in as a new admin', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1727' do + context 'when logged in as a new admin', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1550' do it_behaves_like 'loads all images' do let(:new_user) { @new_admin } end diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb index c55ecb28361..4e3739a7672 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb @@ -40,7 +40,7 @@ module QA user.remove_via_api! end - it 'imports a GitHub repo', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1762' do + it 'imports a GitHub repo', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1607' do Page::Project::Import::Github.perform do |import_page| import_page.add_personal_access_token(Runtime::Env.github_access_token) import_page.import!(github_repo, group.full_path, imported_project_name) diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/project_access_token_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/project_access_token_spec.rb index 00d1b829150..dcf72c1cafc 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/project_access_token_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/project_access_token_spec.rb @@ -5,7 +5,7 @@ module QA describe 'Project access tokens' do let(:project_access_token) {QA::Resource::ProjectAccessToken.fabricate_via_browser_ui!} - it 'can be created and revoked via the UI' do + it 'can be created and revoked via the UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1832' do expect(project_access_token.token).not_to be_nil project_access_token.revoke_via_ui! diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb index db96c2d4ad3..e5faebd2a80 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Manage' do describe 'Project activity' do - it 'user creates an event in the activity page upon Git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/407' do + it 'user creates an event in the activity page upon Git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1591' do Flow::Login.sign_in project = Resource::Repository::ProjectPush.fabricate! do |push| diff --git a/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb index 964cd453049..d0a57b95df4 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb @@ -61,7 +61,7 @@ module QA user_api_client.personal_access_token end - it 'can be followed and their activity seen', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1773' do + it 'can be followed and their activity seen', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1842' do Flow::Login.sign_in page.visit Runtime::Scenario.gitlab_address + "/#{user.username}" Page::User::Show.perform(&:click_follow_user_link) diff --git a/qa/qa/specs/features/browser_ui/1_manage/user/user_access_termination_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/user/user_access_termination_spec.rb index d9b5ffcdc47..1158e65c3f3 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/user/user_access_termination_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/user/user_access_termination_spec.rb @@ -39,7 +39,7 @@ module QA end end - it 'is not allowed to edit the project files', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1663' do + it 'is not allowed to edit the project files', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1709' do Flow::Login.sign_in(as: user) project.visit! diff --git a/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb index d561e5d113c..27c16898c43 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Plan', :orchestrated, :smtp, :requires_admin do describe 'Email Notification' do - include Support::Api + include Support::API let!(:user) do Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) @@ -20,7 +20,7 @@ module QA Flow::Login.sign_in end - it 'is received by a user for project invitation', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/676' do + it 'is received by a user for project invitation', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1448' do project.visit! Page::Project::Menu.perform(&:click_members) diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb index 9129584d110..7c4e10dc2b3 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb @@ -33,7 +33,7 @@ module QA user&.remove_via_api! end - it 'mentions a user in a comment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/452' do + it 'mentions a user in a comment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1559' do Page::Project::Issue::Show.perform do |show| show.select_all_activities_filter show.comment("cc-ing you here @#{user.username}") diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb index 72c990cbbc2..95272bae9c2 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb @@ -13,7 +13,7 @@ module QA issue.visit! end - it 'collapses and expands reply for comments in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1163' do + it 'collapses and expands reply for comments in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1189' do Page::Project::Issue::Show.perform do |show| show.select_all_activities_filter show.start_discussion('My first discussion') diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/comment_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/comment_issue_spec.rb index c5cd495f607..b4df43cb235 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/comment_issue_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/comment_issue_spec.rb @@ -9,7 +9,7 @@ module QA Resource::Issue.fabricate_via_api!.visit! end - it 'comments on an issue and edits the comment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1151' do + it 'comments on an issue and edits the comment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1200' do Page::Project::Issue::Show.perform do |show| first_version_of_comment = 'First version of the comment' second_version_of_comment = 'Second version of the comment' diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb index 2243437fc71..7519f4daae2 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb @@ -9,7 +9,7 @@ module QA Flow::Login.sign_in end - it 'creates an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1793' do + it 'creates an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1185' do issue = Resource::Issue.fabricate_via_browser_ui! Page::Project::Menu.perform(&:click_issues) @@ -19,7 +19,7 @@ module QA end end - it 'closes an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1792' do + it 'closes an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1222' do closed_issue.visit! Page::Project::Issue::Show.perform do |issue_page| @@ -51,7 +51,7 @@ module QA # The following example is excluded from running in `review-qa-smoke` job # as it proved to be flaky when running against Review App # See https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/11568#note_621999351 - it 'comments on an issue with an attachment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1742', except: { job: 'review-qa-smoke' } do + it 'comments on an issue with an attachment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1599', except: { job: 'review-qa-smoke' } do Page::Project::Issue::Show.perform do |show| show.comment('See attached image for scale', attachment: file_to_attach) diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb index 5f5fe161e71..5ad590f4011 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb @@ -28,7 +28,7 @@ module QA end end - it 'creates an issue via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1229' do + it 'creates an issue via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1612' do Resource::Issue.fabricate_via_browser_ui! do |issue| issue.project = template_project issue.template = template_name diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/export_as_csv_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/export_as_csv_spec.rb index a23474ad6f2..3914dbf4cd2 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/export_as_csv_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/export_as_csv_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Plan', :reliable do describe 'Issues list' do @@ -24,7 +22,7 @@ module QA Page::Project::Menu.perform(&:click_issues) end - it 'successfully exports issues list as CSV', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1141' do + it 'successfully exports issues list as CSV', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1210' do Page::Project::Issue::Index.perform do |index| index.click_export_as_csv_button diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb index e275c3decd3..f31a8e69f83 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb @@ -9,7 +9,7 @@ module QA Resource::Issue.fabricate_via_api!.visit! end - it 'filters comments and activities in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/425' do + it 'filters comments and activities in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1577' do Page::Project::Issue::Show.perform do |show| my_own_comment = "My own comment" made_the_issue_confidential = "made the issue confidential" diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb index ff33f9d4824..8cef592029e 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb @@ -13,7 +13,7 @@ module QA end.project.visit! end - it 'shows issue suggestions when creating a new issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1175' do + it 'shows issue suggestions when creating a new issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1179' do Page::Project::Show.perform(&:go_to_new_issue) Page::Project::Issue::New.perform do |new_page| new_page.fill_title("issue") diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/jira_issue_import_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/jira_issue_import_spec.rb index 1455847277e..57ef09ab347 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/jira_issue_import_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/jira_issue_import_spec.rb @@ -14,7 +14,7 @@ module QA end end - it 'imports issues from Jira', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/896' do + it 'imports issues from Jira', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1321' do set_up_jira_integration import_jira_issues diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb index 45222d2ec7e..2d7fe6864aa 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb @@ -23,7 +23,7 @@ module QA end.visit! end - it 'mentions another user in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1166' do + it 'mentions another user in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1186' do Page::Project::Issue::Show.perform do |show| at_username = "@#{user.username}" diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/real_time_assignee_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/real_time_assignee_spec.rb index 44a361df34d..268ea975d32 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/real_time_assignee_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/real_time_assignee_spec.rb @@ -28,7 +28,7 @@ module QA Runtime::Feature.disable(:invite_members_group_modal, project: project) end - it 'update without refresh', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1048' do + it 'update without refresh', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1644' do issue = Resource::Issue.fabricate_via_api! do |issue| issue.project = project issue.assignee_ids = [user1.id] diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue_boards/focus_mode_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue_boards/focus_mode_spec.rb index 8f17a25012b..63e707a4d27 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue_boards/focus_mode_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue_boards/focus_mode_spec.rb @@ -13,7 +13,7 @@ module QA Flow::Login.sign_in end - it 'focuses on issue board', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1176' do + it 'focuses on issue board', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1178' do project.visit! Page::Project::Menu.perform(&:go_to_boards) diff --git a/qa/qa/specs/features/browser_ui/2_plan/milestone/create_group_milestone_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/milestone/create_group_milestone_spec.rb index 8c328abcbe9..9097dc07b04 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/milestone/create_group_milestone_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/milestone/create_group_milestone_spec.rb @@ -14,7 +14,7 @@ module QA Flow::Login.sign_in end - it 'creates a group milestone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1148' do + it 'creates a group milestone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1203' do group_milestone = Resource::GroupMilestone.fabricate_via_browser_ui! do |milestone| milestone.title = title milestone.description = description diff --git a/qa/qa/specs/features/browser_ui/2_plan/milestone/create_project_milestone_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/milestone/create_project_milestone_spec.rb index 78d1471f484..a6aee3e2b06 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/milestone/create_project_milestone_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/milestone/create_project_milestone_spec.rb @@ -14,7 +14,7 @@ module QA Flow::Login.sign_in end - it 'creates a project milestone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1165' do + it 'creates a project milestone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1187' do project_milestone = Resource::ProjectMilestone.fabricate_via_browser_ui! do |milestone| milestone.title = title milestone.description = description diff --git a/qa/qa/specs/features/browser_ui/2_plan/related_issues/related_issues_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/related_issues/related_issues_spec.rb index d907cfaab6d..2bb686c2694 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/related_issues/related_issues_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/related_issues/related_issues_spec.rb @@ -25,7 +25,7 @@ module QA Flow::Login.sign_in end - it 'relates and unrelates one issue to/from another', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1172' do + it 'relates and unrelates one issue to/from another', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1180' do issue_1.visit! Page::Project::Issue::Show.perform do |show| diff --git a/qa/qa/specs/features/browser_ui/2_plan/transient/comment_on_discussion_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/transient/comment_on_discussion_spec.rb index f2e4a320e04..6d73848b8f8 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/transient/comment_on_discussion_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/transient/comment_on_discussion_spec.rb @@ -16,7 +16,7 @@ module QA Flow::Login.sign_in end - it 'comments with mention on a discussion in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1753' do + it 'comments with mention on a discussion in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1816' do Runtime::Env.transient_trials.times do |i| QA::Runtime::Logger.info("Transient bug test action - Trial #{i}") diff --git a/qa/qa/specs/features/browser_ui/3_create/design_management/add_design_content_spec.rb b/qa/qa/specs/features/browser_ui/3_create/design_management/add_design_content_spec.rb index 2e48899742b..b26f2338f45 100644 --- a/qa/qa/specs/features/browser_ui/3_create/design_management/add_design_content_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/design_management/add_design_content_spec.rb @@ -12,7 +12,7 @@ module QA Flow::Login.sign_in end - it 'user adds a design and annotates it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1692' do + it 'user adds a design and annotates it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1290' do issue.visit! Page::Project::Issue::Show.perform do |issue| diff --git a/qa/qa/specs/features/browser_ui/3_create/design_management/archive_design_content_spec.rb b/qa/qa/specs/features/browser_ui/3_create/design_management/archive_design_content_spec.rb index 6afc7549c59..e7954cefffc 100644 --- a/qa/qa/specs/features/browser_ui/3_create/design_management/archive_design_content_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/design_management/archive_design_content_spec.rb @@ -23,7 +23,7 @@ module QA Flow::Login.sign_in end - it 'user archives a design', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1761' do + it 'user archives a design', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1812' do third_design.issue.visit! Page::Project::Issue::Show.perform do |issue| diff --git a/qa/qa/specs/features/browser_ui/3_create/design_management/modify_design_content_spec.rb b/qa/qa/specs/features/browser_ui/3_create/design_management/modify_design_content_spec.rb index dfdc9b7c9b4..7192e68d1cd 100644 --- a/qa/qa/specs/features/browser_ui/3_create/design_management/modify_design_content_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/design_management/modify_design_content_spec.rb @@ -13,7 +13,7 @@ module QA Flow::Login.sign_in end - it 'user adds a design and modifies it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1760' do + it 'user adds a design and modifies it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1813' do design.issue.visit! Page::Project::Issue::Show.perform do |issue| diff --git a/qa/qa/specs/features/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb b/qa/qa/specs/features/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb index 734ff160937..245b33c6691 100644 --- a/qa/qa/specs/features/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true -require 'securerandom' module QA RSpec.describe 'Create', :requires_admin, :skip_live_env, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/195179', type: :flaky } do @@ -26,7 +25,7 @@ module QA setup_jenkins end - it 'integrates and displays build status for MR pipeline in GitLab', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/719' do + it 'integrates and displays build status for MR pipeline in GitLab', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1410' do login_to_gitlab setup_project_integration_with_jenkins diff --git a/qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb b/qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb index 449795f9707..b2efdb11e9a 100644 --- a/qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - include Support::Api + include Support::API describe 'Jira integration', :jira, :orchestrated, :requires_admin do let(:jira_project_key) { 'JITP' } @@ -36,7 +36,7 @@ module QA expect(page).not_to have_text("Requests to the local network are not allowed") end - it 'closes an issue via pushing a commit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/827' do + it 'closes an issue via pushing a commit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1362' do issue_key = Vendor::Jira::JiraAPI.perform do |jira_api| jira_api.create_issue(jira_project_key) end @@ -46,7 +46,7 @@ module QA expect_issue_done(issue_key) end - it 'closes an issue via a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/828' do + it 'closes an issue via a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1361' do issue_key = Vendor::Jira::JiraAPI.perform do |jira_api| jira_api.create_issue(jira_project_key) end diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_a_merge_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_a_merge_spec.rb index 16afa3be62a..826c1a45ff4 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_a_merge_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_a_merge_spec.rb @@ -22,7 +22,7 @@ module QA Flow::Login.sign_in end - it 'creates a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1616' do + it 'creates a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1836' do feature_mr.visit! Page::MergeRequest::Show.perform do |merge_request| diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_commit_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_commit_spec.rb index 41746e84862..b2e54680560 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_commit_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/cherry_pick/cherry_pick_commit_spec.rb @@ -29,7 +29,7 @@ module QA commit.visit! end - it 'creates a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1752' do + it 'creates a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1817' do Page::Project::Commit::Show.perform(&:cherry_pick_commit) Page::MergeRequest::New.perform(&:create_merge_request) diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb index 082d001b716..79cc91acc79 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb @@ -19,11 +19,12 @@ module QA it( 'creates a basic merge request', :smoke, - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1850' + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1590' ) do Resource::MergeRequest.fabricate_via_browser_ui! do |merge_request| merge_request.project = project merge_request.title = merge_request_title + merge_request.assignee = 'me' merge_request.description = merge_request_description end @@ -35,7 +36,7 @@ module QA it( 'creates a merge request with a milestone and label', - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/514' + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1542' ) do gitlab_account_username = "@#{Runtime::User.username}" diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb index d8341eff41d..01c75d95683 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb @@ -29,7 +29,7 @@ module QA end end - it 'creates a merge request via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1230' do + it 'creates a merge request via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1680' do Resource::MergeRequest.fabricate_via_browser_ui! do |merge_request| merge_request.project = template_project merge_request.title = merge_request_title diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb index a2b011bc61c..4090837d5c9 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb @@ -4,7 +4,7 @@ module QA RSpec.describe 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/332588', type: :investigating } do describe 'Merge request creation from fork' do # TODO: Please add this back to :smoke suite as soon as https://gitlab.com/gitlab-org/gitlab/-/issues/332588 is addressed - it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1701' do + it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1305' do merge_request = Resource::MergeRequestFromFork.fabricate_via_browser_ui! do |merge_request| merge_request.fork_branch = 'feature-branch' end diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb index 2b1ac75b9f5..3a5850c0047 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb @@ -30,7 +30,7 @@ module QA content: <<~EOF test: tags: ["runner-for-#{project.name}"] - script: sleep 10 + script: sleep 20 only: - merge_requests EOF @@ -87,11 +87,11 @@ module QA end end - context 'when merging once', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1684' do + context 'when merging once', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1834' do it_behaves_like 'merge when pipeline succeeds' end - context 'when merging several times', :transient, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1684' do + context 'when merging several times', :transient, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1917' do it_behaves_like 'merge when pipeline succeeds', repeat: Runtime::Env.transient_trials end end diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb index ca0eeb2403c..81fb187df85 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb @@ -1,15 +1,16 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', quarantine: { only: { subdomain: :staging }, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/323990', type: :flaky } do + RSpec.describe 'Create' do describe 'Merge request rebasing' do - it 'user rebases source branch of merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1800' do + let(:merge_request) { Resource::MergeRequest.fabricate_via_api! } + + before do Flow::Login.sign_in + end - project = Resource::Project.fabricate_via_api! do |project| - project.name = "only-fast-forward" - end - project.visit! + it 'user rebases source branch of merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1596' do + merge_request.project.visit! Page::Project::Menu.perform(&:go_to_general_settings) Page::Project::Settings::Main.perform do |main| @@ -18,13 +19,8 @@ module QA end end - merge_request = Resource::MergeRequest.fabricate! do |merge_request| - merge_request.project = project - merge_request.title = 'Needs rebasing' - end - Resource::Repository::ProjectPush.fabricate! do |push| - push.project = project + push.project = merge_request.project push.file_name = "other.txt" push.file_content = "New file added!" push.new_branch = false @@ -33,7 +29,7 @@ module QA merge_request.visit! Page::MergeRequest::Show.perform do |merge_request| - expect(merge_request).to have_content('Needs rebasing') + expect(merge_request).to have_content('Merge blocked: the source branch must be rebased onto the target branch.') expect(merge_request).to be_fast_forward_not_possible expect(merge_request).not_to have_merge_button diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/revert_commit_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/revert_commit_spec.rb index 089b87be423..a24ba9ac45a 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/revert_commit_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/revert_commit_spec.rb @@ -27,7 +27,7 @@ module QA commit.visit! end - it 'creates a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1784' do + it 'creates a merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1807' do Page::Project::Commit::Show.perform(&:revert_commit) Page::MergeRequest::New.perform(&:create_merge_request) diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb index c05a3610b99..0ea294b8e51 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb @@ -1,7 +1,11 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create' do + RSpec.describe 'Create', quarantine: { + only: { job: 'large-setup' }, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338324', + type: :stale + } do describe 'Merged merge request' do let(:project) do Resource::Project.fabricate_via_api! do |project| @@ -19,7 +23,7 @@ module QA Flow::Login.sign_in end - it 'can be reverted', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1745' do + it 'can be reverted', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1818' do revertable_merge_request.visit! Page::MergeRequest::Show.perform do |merge_request| diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb index 366671d3385..9fcf6b3db71 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb @@ -31,7 +31,7 @@ module QA merge_request.visit! end - it 'user squashes commits while merging', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/418' do + it 'user squashes commits while merging', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1583' do Page::MergeRequest::Show.perform do |merge_request_page| merge_request_page.retry_on_exception(reload: true) do expect(merge_request_page).to have_text('to be squashed') diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb index 05e274de820..5cebbb32ade 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb @@ -46,7 +46,7 @@ module QA merge_request.visit! end - it 'applies multiple suggestions', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1177' do + it 'applies multiple suggestions', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1838' do Page::MergeRequest::Show.perform do |merge_request| merge_request.click_diffs_tab 4.times { merge_request.add_suggestion_to_batch } diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb index ad12a3ec334..339010cd1df 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb @@ -43,7 +43,7 @@ module QA merge_request.visit! end - it 'applies a single suggestion with a custom message' do + it 'applies a single suggestion with a custom message', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1815' do Page::MergeRequest::Show.perform do |merge_request| merge_request.click_diffs_tab merge_request.apply_suggestion_with_message(commit_message) diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb index 37008e6d507..fb30d47135e 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb @@ -15,7 +15,7 @@ module QA merge_request.visit! end - it 'views the merge request email patches', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1689' do + it 'views the merge request email patches', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1585' do Page::MergeRequest::Show.perform(&:view_email_patches) expect(page.text).to start_with('From') @@ -23,7 +23,7 @@ module QA expect(page).to have_content("diff --git a/#{merge_request.file_name} b/#{merge_request.file_name}") end - it 'views the merge request plain diff', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/417' do + it 'views the merge request plain diff', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1584' do Page::MergeRequest::Show.perform(&:view_plain_diff) expect(page.text).to start_with('diff') diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_merge_ref_diff_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_merge_ref_diff_spec.rb index 24b92164060..c7942c5c2e4 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_merge_ref_diff_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_merge_ref_diff_spec.rb @@ -32,7 +32,7 @@ module QA merge_request.visit! end - it 'views the merge-ref diff by default' do + it 'views the merge-ref diff by default', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1902' do Page::MergeRequest::Show.perform do |mr_page| mr_page.click_diffs_tab mr_page.click_target_version_dropdown @@ -57,7 +57,7 @@ module QA merge_request.visit! end - it 'views the merge-base diff by default' do + it 'views the merge-base diff by default', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1903' do Page::MergeRequest::Show.perform do |mr_page| mr_page.click_diffs_tab mr_page.click_target_version_dropdown diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb index c02632c2c60..3da73c8fa72 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Create' do describe 'File templates' do diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb index 639702f9148..9448cd13f53 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb @@ -61,7 +61,7 @@ module QA project.visit! end - it 'lists branches correctly after CRUD operations', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1688' do + it 'lists branches correctly after CRUD operations', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1588' do Page::Project::Menu.perform(&:go_to_repository_branches) expect(page).to have_content(master_branch) diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb index db31cadb37d..39fb18f2051 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb @@ -16,7 +16,7 @@ module QA end context 'when branch name contains slash, hash, double dash, and capital letter' do - it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1780' do + it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1809' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.branch = branch_name diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb index fb9e42a6960..1fa95eda3f0 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb @@ -28,7 +28,7 @@ module QA project.wait_for_push_new_branch end - it 'user performs a deep clone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/475' do + it 'user performs a deep clone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1546' do Git::Repository.perform do |repository| repository.uri = project.repository_http_location.uri repository.use_default_credentials @@ -39,7 +39,7 @@ module QA end end - it 'user performs a shallow clone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/411' do + it 'user performs a shallow clone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1589' do Git::Repository.perform do |repository| repository.uri = project.repository_http_location.uri repository.use_default_credentials diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/file/create_file_via_web_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/file/create_file_via_web_spec.rb index cd333b3cea2..6d7e1b4f6df 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/file/create_file_via_web_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/file/create_file_via_web_spec.rb @@ -11,7 +11,7 @@ module QA Flow::Login.sign_in end - it 'user creates a file via the Web', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1093' do + it 'user creates a file via the Web', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1633' do Resource::File.fabricate_via_browser_ui! do |file| file.name = file_name file.content = file_content diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/file/delete_file_via_web_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/file/delete_file_via_web_spec.rb index 903001aa4f0..4667dccb9a1 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/file/delete_file_via_web_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/file/delete_file_via_web_spec.rb @@ -12,7 +12,7 @@ module QA file.visit! end - it 'user deletes a file via the Web', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1095' do + it 'user deletes a file via the Web', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1631' do Page::File::Show.perform do |file| file.click_delete file.add_commit_message(commit_message_for_delete) diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/file/edit_file_via_web_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/file/edit_file_via_web_spec.rb index 0da774b557f..47aebcbf349 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/file/edit_file_via_web_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/file/edit_file_via_web_spec.rb @@ -13,7 +13,7 @@ module QA file.visit! end - it 'user edits a file via the Web', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1094' do + it 'user edits a file via the Web', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1632' do Page::File::Show.perform(&:click_edit) Page::File::Form.perform do |file| diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb index 98d0a3c5706..0a01afd97d8 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb @@ -16,7 +16,7 @@ module QA end context 'when file name starts with a dash and contains hash, semicolon, colon, and question mark' do - it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1779' do + it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1810' do Resource::File.fabricate_via_api! do |file| file.project = project file.commit_message = 'Add new file' diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb index 0f6edca654b..a53bb197b09 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb @@ -23,7 +23,7 @@ module QA parent_project.add_member(user) end - it 'creates a 2nd fork after moving the parent project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/713' do + it 'creates a 2nd fork after moving the parent project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1413' do Flow::Login.sign_in(as: user) fork_project.visit! diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb index 3440b462302..48bfe56e91e 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Push over HTTP using Git protocol version 2', :requires_git_protocol_v2 do - it 'user pushes to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/469' do + it 'user pushes to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1548' do Flow::Login.sign_in # Create a project to push to diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb index ef3d45724db..467d9b2487d 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb @@ -27,7 +27,7 @@ module QA Page::Main::Menu.perform(&:sign_out_if_signed_in) end - it 'user pushes to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1763' do + it 'user pushes to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1606' do project = Resource::Project.fabricate_via_api! do |project| project.name = 'git-protocol-project' end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb index 41fc20cfa5c..6fdf7f424ee 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Git push over HTTP', :smoke do - it 'user using a personal access token pushes code to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1848' do + it 'user using a personal access token pushes code to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1573' do Flow::Login.sign_in access_token = Resource::PersonalAccessToken.fabricate!.token diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb index e4a492d3487..d8972d4f37a 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Push mirror a repository over HTTP' do - it 'configures and syncs LFS objects for a (push) mirrored repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1075' do + it 'configures and syncs LFS objects for a (push) mirrored repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1224' do Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_using_credentials) diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb index f01a3b21eee..ec63ed9cdf1 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Push mirror a repository over HTTP' do - it 'configures and syncs a (push) mirrored repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/414' do + it 'configures and syncs a (push) mirrored repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1587' do Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_using_credentials) diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb index 1423e3c45ce..727a9e27c63 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb @@ -9,7 +9,7 @@ module QA # tests are run in parallel). # See: https://gitlab.com/gitlab-org/gitlab/-/issues/218620#note_361634705 - include Support::Api + include Support::API before(:context) do @project = Resource::Project.fabricate_via_api! do |p| @@ -26,7 +26,7 @@ module QA set_file_size_limit(nil) end - it 'push successful when the file size is under the limit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/456' do + it 'push successful when the file size is under the limit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1556' do set_file_size_limit(5) retry_on_fail do @@ -36,7 +36,7 @@ module QA end end - it 'push fails when the file size is above the limit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/458' do + it 'push fails when the file size is above the limit', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1554' do set_file_size_limit(2) retry_on_fail do diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb index 861efa8b45a..4c294f21859 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Git push over HTTP' do - it 'user pushes code to the repository', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1702' do + it 'user pushes code to the repository', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1576' do Flow::Login.sign_in Resource::Repository::ProjectPush.fabricate! do |push| @@ -18,7 +18,7 @@ module QA end end - it 'pushes to a project using a specific Praefect repository storage', :smoke, :requires_admin, :requires_praefect, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/742' do + it 'pushes to a project using a specific Praefect repository storage', :smoke, :requires_admin, :requires_praefect, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1389' do Flow::Login.sign_in_as_admin project = Resource::Project.fabricate_via_api! do |storage_project| diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb index 9eeb762e548..be0d48e5ab9 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb @@ -26,7 +26,7 @@ module QA Flow::Login.sign_in end - it 'pushes code to the repository via SSH', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1678' do + it 'pushes code to the repository via SSH', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1283' do Resource::Repository::ProjectPush.fabricate! do |push| push.project = project push.ssh_key = @key @@ -41,7 +41,7 @@ module QA end end - it 'pushes multiple branches and tags together', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1679' do + it 'pushes multiple branches and tags together', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1282' do branches = [] tags = [] Git::Repository.perform do |repository| diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb index ce7fdf379a4..318d905c149 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb @@ -18,24 +18,24 @@ module QA end context 'when developers and maintainers are allowed to push to a protected branch' do - it 'user with push rights successfully pushes to the protected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/447' do + it 'user with push rights successfully pushes to the protected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1563' do create_protected_branch(allowed_to_push: { roles: Resource::ProtectedBranch::Roles::DEVS_AND_MAINTAINERS }) push = push_new_file(branch_name) - expect(push.output).to match(/remote: To create a merge request for protected-branch, visit/) + expect(push.output).to match(/To create a merge request for protected-branch, visit/) end end context 'when developers and maintainers are not allowed to push to a protected branch' do - it 'user without push rights fails to push to the protected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/449' do + it 'user without push rights fails to push to the protected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1562' do create_protected_branch(allowed_to_push: { roles: Resource::ProtectedBranch::Roles::NO_ONE }) - expect { push_new_file(branch_name) }.to raise_error(QA::Support::Run::CommandError, /remote: GitLab: You are not allowed to push code to protected branches on this project\.([\s\S]+)\[remote rejected\] #{branch_name} -> #{branch_name} \(pre-receive hook declined\)/) + expect { push_new_file(branch_name) }.to raise_error(QA::Support::Run::CommandError, /You are not allowed to push code to protected branches on this project\.([\s\S]+)\[remote rejected\] #{branch_name} -> #{branch_name} \(pre-receive hook declined\)/) end end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb index a90bb920107..3f488a1610d 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb @@ -9,7 +9,7 @@ module QA Flow::Login.sign_in end - it 'user can add an SSH key', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1685' do + it 'user can add an SSH key', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1304' do key = Resource::SSHKey.fabricate_via_browser_ui! do |resource| resource.title = key_title end @@ -20,7 +20,7 @@ module QA # Note this context ensures that the example it contains is executed after the example above. Be aware of the order of execution if you add new examples in either context. context 'after adding an ssh key' do - it 'can delete an ssh key', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1686' do + it 'can delete an ssh key', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1303' do Page::Main::Menu.perform(&:click_edit_profile_link) Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::SSHKeys.perform do |ssh_keys| diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb index cd6ffdf4571..d445f4d091b 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb @@ -43,7 +43,7 @@ module QA find('pre').text end - it 'user views raw email patch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/442' do + it 'user views raw email patch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1566' do view_commit Page::Project::Commit::Show.perform(&:select_email_patches) @@ -53,7 +53,7 @@ module QA expect(page).to have_content('diff --git a/second b/second') end - it 'user views raw commit diff', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/439' do + it 'user views raw commit diff', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1568' do view_commit Page::Project::Commit::Show.perform(&:select_plain_diff) diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_personal_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_personal_snippet_spec.rb index 70880011985..b41e90fa834 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_personal_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_personal_snippet_spec.rb @@ -39,7 +39,7 @@ module QA ssh_key.remove_via_api! end - it 'clones, pushes, and pulls a snippet over HTTP, edits via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1748' do + it 'clones, pushes, and pulls a snippet over HTTP, edits via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1363' do push = Resource::Repository::Push.fabricate! do |push| push.repository_http_uri = repository_uri_http push.file_name = new_file @@ -70,7 +70,7 @@ module QA snippet.remove_via_api! end - it 'clones, pushes, and pulls a snippet over SSH, deletes via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1747' do + it 'clones, pushes, and pulls a snippet over SSH, deletes via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1364' do push = Resource::Repository::Push.fabricate! do |push| push.repository_ssh_uri = repository_uri_ssh push.ssh_key = ssh_key diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_project_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_project_snippet_spec.rb index 9d90ff189c6..e8b2ffe1f14 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_project_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/clone_push_pull_project_snippet_spec.rb @@ -40,7 +40,7 @@ module QA ssh_key.remove_via_api! end - it 'clones, pushes, and pulls a project snippet over HTTP, edits via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1725' do + it 'clones, pushes, and pulls a project snippet over HTTP, edits via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1359' do Resource::Repository::Push.fabricate! do |push| push.repository_http_uri = repository_uri_http push.file_name = new_file @@ -71,7 +71,7 @@ module QA snippet.remove_via_api! end - it 'clones, pushes, and pulls a project snippet over SSH, deletes via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1794' do + it 'clones, pushes, and pulls a project snippet over SSH, deletes via UI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1360' do Resource::Repository::Push.fabricate! do |push| push.repository_ssh_uri = repository_uri_ssh push.ssh_key = ssh_key diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb index ae8f34f9845..1080d8ab849 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do # convert back to a smoke test once proved to be stable describe 'Personal snippet creation' do - it 'user creates a personal snippet', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1704' do + it 'user creates a personal snippet', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1357' do Flow::Login.sign_in Page::Main::Menu.perform do |menu| diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_with_multiple_files_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_with_multiple_files_spec.rb index 8ff3222f065..525fc5799a9 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_with_multiple_files_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_with_multiple_files_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Multiple file snippet' do - it 'creates a personal snippet with multiple files', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/842' do + it 'creates a personal snippet with multiple files', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1654' do Flow::Login.sign_in Page::Main::Menu.perform do |menu| diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb index 8c44cd6d642..e4c2488e8df 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do # to be converted to a smoke test once proved to be stable describe 'Project snippet creation' do - it 'user creates a project snippet', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/839' do + it 'user creates a project snippet', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1358' do Flow::Login.sign_in Resource::ProjectSnippet.fabricate_via_browser_ui! do |snippet| diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_with_multiple_files_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_with_multiple_files_spec.rb index 7b4ec573f53..3298989cc12 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_with_multiple_files_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_with_multiple_files_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Multiple file snippet' do - it 'creates a project snippet with multiple files', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1024' do + it 'creates a project snippet with multiple files', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1648' do Flow::Login.sign_in Resource::ProjectSnippet.fabricate_via_browser_ui! do |snippet| diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/share_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/share_snippet_spec.rb index 3973e0aacad..53e1e8e2e02 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/share_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/share_snippet_spec.rb @@ -21,7 +21,7 @@ module QA end context 'when the snippet is public' do - it 'can be shared with not signed-in users', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1016' do + it 'can be shared with not signed-in users', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1248' do snippet.visit! sharing_link = Page::Dashboard::Snippet::Show.perform do |snippet| @@ -43,7 +43,7 @@ module QA end context 'when the snippet is changed to private' do - it 'does not display Embed/Share dropdown', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1015' do + it 'does not display Embed/Share dropdown', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1249' do snippet.visit! Page::Dashboard::Snippet::Show.perform do |snippet| diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb index 1e3cb0e2ffc..70c9c9beeb8 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Create' do describe 'Web IDE file templates' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb index 293c9043266..b92c8e881ab 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb @@ -35,7 +35,7 @@ module QA Page::Project::Show.perform(&:open_web_ide!) end - it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1615' do + it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1618' do Page::Project::WebIDE::Edit.perform do |ide| ide.add_directory(directory_name) end @@ -51,7 +51,7 @@ module QA Page::Project::Show.perform(&:open_web_ide!) end - it 'shows in the tree view but cannot be committed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1614' do + it 'shows in the tree view but cannot be committed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1619' do Page::Project::WebIDE::Edit.perform do |ide| ide.add_directory(directory_name) diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb index f7a2e3081fb..2e37cc98555 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb @@ -16,7 +16,7 @@ module QA Flow::Login.sign_in end - it "creates the first file in an empty project via Web IDE", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/847' do + it "creates the first file in an empty project via Web IDE", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1353' do project.visit! Page::Project::Show.perform(&:create_first_new_file!) diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb index c7fc01303b7..c648fecf847 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb @@ -18,7 +18,7 @@ module QA project.remove_via_api! end - it 'can link to a specific line of code in Web IDE', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1102' do + it 'can link to a specific line of code in Web IDE', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1844' do project.visit! Page::Project::Show.perform(&:open_web_ide!) diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb index ce1b6f4a3ec..99a9bc5b2d0 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb @@ -14,7 +14,7 @@ module QA let(:user) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) } context 'when no fork is present' do - it 'suggests to create a fork when a user clicks Web IDE in the main project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1697' do + it 'suggests to create a fork when a user clicks Web IDE in the main project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1289' do Flow::Login.sign_in(as: user) parent_project.visit! @@ -34,7 +34,7 @@ module QA end end - it 'opens the fork when a user clicks Web IDE in the main project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1698' do + it 'opens the fork when a user clicks Web IDE in the main project', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1288' do Flow::Login.sign_in(as: user) fork_project.upstream.visit! Page::Project::Show.perform do |project_page| diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb index 1789e20e216..061ab66b271 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb @@ -49,7 +49,7 @@ module QA merge_request.visit! end - it 'opens and edits a multi-file merge request in Web IDE from Diff Tab', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/997' do + it 'opens and edits a multi-file merge request in Web IDE from Diff Tab', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1649' do Page::MergeRequest::Show.perform do |show| show.click_diffs_tab show.edit_file_in_web_ide('file1') diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb index 4e1b6b6094e..7135e04e457 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb @@ -20,7 +20,7 @@ module QA merge_request.visit! end - it 'opens and edits a merge request in Web IDE', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/705' do + it 'opens and edits a merge request in Web IDE', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1420' do Page::MergeRequest::Show.perform do |show| show.click_open_in_web_ide end diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb index 0a342664dd2..705ee954bcb 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb @@ -22,7 +22,7 @@ module QA context 'when a file with the same name already exists' do let(:file_name) { 'README.md' } - it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1136' do + it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1214' do Page::Project::WebIDE::Edit.perform do |ide| ide.upload_file(file_path) end @@ -34,7 +34,7 @@ module QA context 'when the file is a text file' do let(:file_name) { 'text_file.txt' } - it 'shows the Edit tab with the text', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1138' do + it 'shows the Edit tab with the text', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1212' do Page::Project::WebIDE::Edit.perform do |ide| ide.upload_file(file_path) @@ -52,7 +52,7 @@ module QA context 'when the file is binary' do let(:file_name) { 'logo_sample.svg' } - it 'shows a Download button', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1137' do + it 'shows a Download button', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1213' do Page::Project::WebIDE::Edit.perform do |ide| ide.upload_file(file_path) @@ -70,7 +70,7 @@ module QA context 'when the file is an image' do let(:file_name) { 'dk.png' } - it 'shows an image viewer', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1139' do + it 'shows an image viewer', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1211' do Page::Project::WebIDE::Edit.perform do |ide| ide.upload_file(file_path) diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb index 2a46604f8ac..bd4b82d8ea0 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb @@ -16,7 +16,7 @@ module QA initial_wiki.project.remove_via_api! end - it 'creates a formatted Wiki page with an image uploaded', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1861' do + it 'creates a formatted Wiki page with an image uploaded', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1919' do initial_wiki.visit! Page::Project::Wiki::Show.perform(&:click_new_page) diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_creation_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_creation_spec.rb index 70959dd0200..40188fae06c 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_creation_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_creation_spec.rb @@ -15,7 +15,7 @@ module QA Flow::Login.sign_in end - it 'by adding a home page to the wiki', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/856' do + it 'by adding a home page to the wiki', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1347' do project.visit! Page::Project::Menu.perform(&:click_wiki) @@ -35,7 +35,7 @@ module QA end end - it 'by adding a second page to the wiki', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/855' do + it 'by adding a second page to the wiki', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1348' do wiki.visit! Page::Project::Wiki::Show.perform(&:click_new_page) @@ -54,7 +54,7 @@ module QA end end - it 'by adding a home page to the wiki using git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/853' do + it 'by adding a home page to the wiki using git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1350' do empty_wiki = Resource::Wiki::ProjectPage.new do |empty_wiki| empty_wiki.project = project end @@ -73,7 +73,7 @@ module QA end end - it 'by adding a second page to the wiki using git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/854' do + it 'by adding a second page to the wiki using git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1349' do Resource::Repository::WikiPush.fabricate! do |push| push.file_name = "#{new_wiki_title}.md" push.file_content = new_wiki_content diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_manipulation_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_manipulation_spec.rb index 9a6d7d08e7b..5b277d07fea 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_manipulation_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_manipulation_spec.rb @@ -14,7 +14,7 @@ module QA Flow::Login.sign_in end - it 'by manipulating content on the page', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/857' do + it 'by manipulating content on the page', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1346' do wiki.visit! Page::Project::Wiki::Show.perform(&:click_edit) @@ -33,7 +33,7 @@ module QA end end - it 'by manipulating content on the page using git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/858' do + it 'by manipulating content on the page using git push', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1345' do Resource::Repository::WikiPush.fabricate! do |push| push.file_content = new_wiki_content push.commit_message = commit_message diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_directory_management_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_directory_management_spec.rb index 1a46322d283..9784ad2e9c1 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_directory_management_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_directory_management_spec.rb @@ -10,7 +10,7 @@ module QA Flow::Login.sign_in end - it 'has changed the directory', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/948' do + it 'has changed the directory', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1293' do initial_wiki.visit! Page::Project::Wiki::Show.perform(&:click_edit) diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_list_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_list_spec.rb index dcf52f7c744..c91fc8e10f7 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_list_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_list_spec.rb @@ -15,7 +15,7 @@ module QA end context 'Sidebar' do - it 'has all expected links that work', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/903' do + it 'has all expected links that work', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1317' do small_wiki.visit! small_number_of_pages.times do |index| @@ -35,7 +35,7 @@ module QA end context 'Page List' do - it 'has all expected links that work', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/902' do + it 'has all expected links that work', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1318' do large_wiki.visit! Page::Project::Wiki::Show.perform(&:click_view_all_pages) diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_page_deletion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_page_deletion_spec.rb index d2b18d81670..71ce042f0a3 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_page_deletion_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/project_based_page_deletion_spec.rb @@ -10,7 +10,7 @@ module QA end context 'Page deletion' do - it 'has removed the deleted page correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/921' do + it 'has removed the deleted page correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1310' do initial_wiki.visit! Page::Project::Wiki::Show.perform(&:click_edit) diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/add_remove_ci_variable_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/add_remove_ci_variable_spec.rb index 39cbd0028c0..c8b308d53ef 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/add_remove_ci_variable_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/add_remove_ci_variable_spec.rb @@ -16,7 +16,7 @@ module QA add_ci_variable end - it 'user adds a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1759' do + it 'user adds a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1597' do Page::Project::Settings::CiVariables.perform do |ci_variable| expect(ci_variable).to have_text('VARIABLE_KEY') expect(ci_variable).not_to have_text('some_CI_variable') @@ -27,7 +27,7 @@ module QA end end - it 'user removes a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1758' do + it 'user removes a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1598' do Page::Project::Settings::CiVariables.perform do |ci_variable| ci_variable.click_edit_ci_variable ci_variable.click_ci_variable_delete_button diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb index 4938ae3f969..4d21a98e072 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do describe 'Pipeline with protected variable' do @@ -63,7 +61,7 @@ module QA runner.remove_via_api! end - it 'exposes variable on protected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/156' do + it 'exposes variable on protected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1714' do create_protected_branch [developer, maintainer].each do |user| @@ -76,7 +74,7 @@ module QA end end - it 'does not expose variable on unprotected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/156' do + it 'does not expose variable on unprotected branch', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1885' do [developer, maintainer].each do |user| create_merge_request(Runtime::API::Client.new(:gitlab, user: user)) go_to_pipeline_job(user) diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb index 7a81318f158..47117ae751f 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb @@ -24,7 +24,7 @@ module QA runner.remove_via_api! end - it 'users creates a pipeline which gets processed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1849' do + it 'users creates a pipeline which gets processed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1601' do # TODO: Convert back to :smoke once proved to be stable. Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/300909 Flow::Login.sign_in diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb index 5b3949f9c3a..27b45d1a2a0 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb @@ -20,7 +20,7 @@ module QA project.remove_via_api! end - it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1757' do + it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1814' do Page::Project::Pipeline::Show.perform do |pipeline| aggregate_failures 'pipeline has all expected jobs' do expect(pipeline).to have_job('build') diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb index c2ea568dbad..9d145a3becf 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do describe 'Include multiple files from a project' do @@ -41,7 +39,7 @@ module QA runner.remove_via_api! end - it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1082' do + it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1223' do Page::Project::Pipeline::Show.perform do |pipeline| aggregate_failures 'pipeline has all expected jobs' do expect(pipeline).to have_job('build') diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb index 253b5fb2af4..7faf4114d02 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb @@ -30,7 +30,7 @@ module QA runner.remove_via_api! end - it 'can be browsed' do + it 'can be browsed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1808' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb index b43581289ef..8dfd485bbf1 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do context 'When pipeline is blocked' do @@ -70,7 +68,7 @@ module QA runner.remove_via_api! end - it 'can still merge MR successfully', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/971' do + it 'can still merge MR successfully', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1281' do Page::MergeRequest::Show.perform do |show| # waiting for manual action status shows status badge 'blocked' on pipelines page show.has_pipeline_status?('waiting for manual action') diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb index 47b36b55c8c..0ddfcf8cafb 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do context 'When job is configured to only run on merge_request_events' do @@ -68,7 +66,7 @@ module QA project.remove_via_api! end - it 'only runs the job configured to run on merge requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/170' do + it 'only runs the job configured to run on merge requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1890' do Page::Project::Pipeline::Show.perform do |pipeline| aggregate_failures do expect(pipeline).to have_job(mr_only_job_name) diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb index adacedb36ab..9fd54251411 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do describe 'Pass dotenv variables to downstream via bridge' do @@ -44,7 +42,7 @@ module QA [upstream_project, downstream_project].each(&:remove_via_api!) end - it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1086' do + it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1221' do Page::Project::Pipeline::Show.perform do |parent_pipeline| Support::Waiter.wait_until { parent_pipeline.has_child_pipeline? } parent_pipeline.expand_child_pipeline diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb index bb9b5feed2e..1a2d450f7eb 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb @@ -58,19 +58,17 @@ module QA end before do - Runtime::Feature.enable(:pipeline_editor_branch_switcher) Flow::Login.sign_in project.visit! Page::Project::Menu.perform(&:go_to_pipeline_editor) end after do - Runtime::Feature.disable(:pipeline_editor_branch_switcher) project.remove_via_api! Page::Main::Menu.perform(&:sign_out) end - it 'can switch branches and target branch field updates accordingly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1856' do + it 'can switch branches and target branch field updates accordingly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1891' do Page::Project::PipelineEditor::Show.perform do |show| expect(show).to have_branch_selector_button diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb index 5f3ec3ec870..f599d6b6251 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb @@ -40,7 +40,7 @@ module QA Page::Project::Menu.perform(&:click_ci_cd_pipelines) end - it 'can trigger pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/946' do + it 'can trigger pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1650' do Page::Project::Pipeline::Index.perform do |index| expect(index).not_to have_pipeline # should not auto trigger pipeline index.click_run_pipeline_button diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb index c89cda73711..f803cfdb714 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do describe "Trigger child pipeline with 'when:manual'" do @@ -32,7 +30,7 @@ module QA runner.remove_via_api! end - it 'can trigger bridge job', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1049' do + it 'can trigger bridge job', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1237' do Page::Project::Pipeline::Show.perform do |parent_pipeline| expect(parent_pipeline).not_to have_child_pipeline diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb index d87fa0f5127..0bfbd164331 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'faker' - module QA RSpec.describe 'Verify', :runner do describe 'Trigger matrix' do @@ -33,7 +31,7 @@ module QA project.remove_via_api! end - it 'creates 2 trigger jobs and passes corresponding matrix variables', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1732' do + it 'creates 2 trigger jobs and passes corresponding matrix variables', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1824' do Page::Project::Pipeline::Show.perform do |parent_pipeline| trigger_title1 = 'deploy: [ovh, monitoring]' trigger_title2 = 'deploy: [ovh, app]' diff --git a/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb index 916b809ebc1..42aec99d6cf 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb @@ -15,13 +15,13 @@ module QA runner.remove_via_api! end - it 'user registers a new specific runner', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1764' do + it 'user registers a new specific runner', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1600' do Flow::Login.sign_in runner.project.visit! Page::Project::Menu.perform(&:go_to_ci_cd_settings) - Page::Project::Settings::CICD.perform do |settings| + Page::Project::Settings::CiCd.perform do |settings| sleep 5 # Runner should register within 5 seconds settings.expand_runners_settings do |page| diff --git a/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb index 7d3f8f2b1d4..c85920d98ec 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb @@ -33,7 +33,7 @@ module QA runner.remove_via_api! end - it 'creates an MR with code coverage statistics', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1740' do + it 'creates an MR with code coverage statistics', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1373' do runner.project.visit! configure_code_coverage(simplecov) merge_request.visit! @@ -49,7 +49,7 @@ module QA def configure_code_coverage(coverage_tool_pattern) Page::Project::Menu.perform(&:go_to_ci_cd_settings) - Page::Project::Settings::CICD.perform do |settings| + Page::Project::Settings::CiCd.perform do |settings| settings.expand_general_pipelines do |coverage| coverage.configure_coverage_regex(coverage_tool_pattern) end diff --git a/qa/qa/specs/features/browser_ui/5_package/composer_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/composer_registry_spec.rb index 61c71b062ae..9ddf485870d 100644 --- a/qa/qa/specs/features/browser_ui/5_package/composer_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/composer_registry_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Package', :orchestrated, :packages, :object_storage do describe 'Composer Repository' do @@ -104,7 +102,7 @@ module QA package.remove_via_api! end - it 'publishes a composer package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1088' do + it 'publishes a composer package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1634' do Page::Project::Menu.perform(&:click_packages_link) Page::Project::Packages::Index.perform do |index| diff --git a/qa/qa/specs/features/browser_ui/5_package/conan_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/conan_repository_spec.rb index 668a1524b1c..a8f1fc2a7de 100644 --- a/qa/qa/specs/features/browser_ui/5_package/conan_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/conan_repository_spec.rb @@ -41,7 +41,7 @@ module QA package.remove_via_api! end - it 'publishes, installs, and deletes a Conan package', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1077' do + it 'publishes, installs, and deletes a Conan package', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1638' do Flow::Login.sign_in Resource::Repository::Commit.fabricate_via_api! do |commit| diff --git a/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb b/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb index 375a371c2b1..3d02c2884a2 100644 --- a/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb @@ -28,7 +28,7 @@ module QA runner.remove_via_api! end - it "pushes image and deletes tag", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1743' do + it "pushes image and deletes tag", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1911' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' diff --git a/qa/qa/specs/features/browser_ui/5_package/container_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/container_registry_spec.rb index 9131cad7244..65519cdebec 100644 --- a/qa/qa/specs/features/browser_ui/5_package/container_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/container_registry_spec.rb @@ -49,7 +49,7 @@ module QA registry_repository&.remove_via_api! end - it 'pushes project image to the container registry and deletes tag', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1699' do + it 'pushes project image to the container registry and deletes tag', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1833' do Flow::Login.sign_in project.visit! diff --git a/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb b/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb index be1d0dd8e81..bfcc49885a0 100644 --- a/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb @@ -44,7 +44,7 @@ module QA end with_them do - it "pulls an image using the dependency proxy", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1862' do + it "pulls an image using the dependency proxy" do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' diff --git a/qa/qa/specs/features/browser_ui/5_package/generic_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/generic_repository_spec.rb index ef5965b29e5..2e5fa2c2904 100644 --- a/qa/qa/specs/features/browser_ui/5_package/generic_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/generic_repository_spec.rb @@ -98,7 +98,7 @@ module QA package.remove_via_api! end - it 'uploads a generic package, downloads and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1108' do + it 'uploads a generic package, downloads and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1628' do Page::Project::Menu.perform(&:click_packages_link) Page::Project::Packages::Index.perform do |index| diff --git a/qa/qa/specs/features/browser_ui/5_package/maven_gradle_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/maven_gradle_repository_spec.rb index 32a0670e342..fb3f2abd87a 100644 --- a/qa/qa/specs/features/browser_ui/5_package/maven_gradle_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/maven_gradle_repository_spec.rb @@ -194,7 +194,7 @@ module QA } end - it "pushes and pulls a maven package via gradle using #{params[:authentication_token_type]}", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1074' do + it "pushes and pulls a maven package via gradle using #{params[:authentication_token_type]}" do # pushing Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = package_project diff --git a/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb index fb92616ffc5..bf1d2a04dba 100644 --- a/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Package', :orchestrated, :packages, :reliable, :object_storage do describe 'Maven Repository' do @@ -185,7 +183,7 @@ module QA another_project.remove_via_api! end - it 'pushes and pulls a Maven package via CI and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1115' do + it 'pushes and pulls a Maven package via CI and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1627' do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' @@ -258,7 +256,7 @@ module QA Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_disabled) end - it 'prevents users from publishing duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1717' do + it 'prevents users from publishing duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1830' do with_fixtures([pom_xml, settings_xml]) do |dir| Service::DockerRun::Maven.new(dir).publish! end @@ -303,7 +301,7 @@ module QA Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_enabled) end - it 'allows users to publish duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1722' do + it 'allows users to publish duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1829' do with_fixtures([pom_xml, settings_xml]) do |dir| Service::DockerRun::Maven.new(dir).publish! end diff --git a/qa/qa/specs/features/browser_ui/5_package/npm_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/npm_registry_spec.rb index 2322d18a9ba..5a3b4388f0c 100644 --- a/qa/qa/specs/features/browser_ui/5_package/npm_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/npm_registry_spec.rb @@ -3,10 +3,11 @@ module QA RSpec.describe 'Package', :orchestrated, :packages, :reliable, :object_storage do describe 'npm registry' do + using RSpec::Parameterized::TableSyntax include Runtime::Fixtures let!(:registry_scope) { Runtime::Namespace.sandbox_name } - let(:auth_token) do + let!(:personal_access_token) do unless Page::Main::Menu.perform(&:signed_in?) Flow::Login.sign_in end @@ -14,6 +15,13 @@ module QA Resource::PersonalAccessToken.fabricate!.token end + let(:project_deploy_token) do + Resource::DeployToken.fabricate_via_browser_ui! do |deploy_token| + deploy_token.name = 'npm-deploy-token' + deploy_token.project = project + end + end + let(:uri) { URI.parse(Runtime::Scenario.gitlab_address) } let(:gitlab_address_with_port) { "#{uri.scheme}://#{uri.host}:#{uri.port}" } let(:gitlab_host_with_port) { "#{uri.host}:#{uri.port}" } @@ -109,16 +117,6 @@ module QA } end - let(:npmrc) do - { - file_path: '.npmrc', - content: <<~NPMRC - //#{gitlab_host_with_port}/api/v4/projects/#{project.id}/packages/npm/:_authToken=#{auth_token} - @#{registry_scope}:registry=#{gitlab_address_with_port}/api/v4/projects/#{project.id}/packages/npm/ - NPMRC - } - end - let(:package) do Resource::Package.init do |package| package.name = "@#{registry_scope}/#{project.name}" @@ -133,72 +131,101 @@ module QA another_project.remove_via_api! end - it 'push and pull a npm package via CI', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1772' do - Resource::Repository::Commit.fabricate_via_api! do |commit| - commit.project = project - commit.commit_message = 'Add .gitlab-ci.yml' - commit.add_files([ - gitlab_ci_deploy_yaml, - npmrc, - package_json - ]) - end - - project.visit! - Flow::Pipeline.visit_latest_pipeline - - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('deploy') - end - - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - end - - Resource::Repository::Commit.fabricate_via_api! do |commit| - commit.project = another_project - commit.commit_message = 'Add .gitlab-ci.yml' - commit.add_files([ - gitlab_ci_install_yaml - ]) - end - - another_project.visit! - Flow::Pipeline.visit_latest_pipeline - - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('install') - end - - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - job.click_browse_button - end - - Page::Project::Artifact::Show.perform do |artifacts| - artifacts.go_to_directory('node_modules') - artifacts.go_to_directory("@#{registry_scope}") - expect(artifacts).to have_content( "#{project.name}") - end - - project.visit! - Page::Project::Menu.perform(&:click_packages_link) - - Page::Project::Packages::Index.perform do |index| - expect(index).to have_package(package.name) + where(:authentication_token_type, :token_name) do + :personal_access_token | 'Personal Access Token' + :ci_job_token | 'CI Job Token' + :project_deploy_token | 'Deploy Token' + end - index.click_package(package.name) + with_them do + let(:auth_token) do + case authentication_token_type + when :personal_access_token + "\"#{personal_access_token}\"" + when :ci_job_token + '${CI_JOB_TOKEN}' + when :project_deploy_token + "\"#{project_deploy_token.password}\"" + end end - Page::Project::Packages::Show.perform do |show| - expect(show).to have_package_info(package.name, "1.0.0") - - show.click_delete + let(:npmrc) do + { + file_path: '.npmrc', + content: <<~NPMRC + //#{gitlab_host_with_port}/api/v4/projects/#{project.id}/packages/npm/:_authToken=#{auth_token} + @#{registry_scope}:registry=#{gitlab_address_with_port}/api/v4/projects/#{project.id}/packages/npm/ + NPMRC + } end - Page::Project::Packages::Index.perform do |index| - expect(index).to have_content("Package deleted successfully") - expect(index).not_to have_package(package.name) + it "push and pull a npm package via CI using a #{params[:token_name]}", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1772' do + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.add_files([ + gitlab_ci_deploy_yaml, + npmrc, + package_json + ]) + end + + project.visit! + Flow::Pipeline.visit_latest_pipeline + + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('deploy') + end + + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + end + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = another_project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.add_files([ + gitlab_ci_install_yaml + ]) + end + + another_project.visit! + Flow::Pipeline.visit_latest_pipeline + + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('install') + end + + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + job.click_browse_button + end + + Page::Project::Artifact::Show.perform do |artifacts| + artifacts.go_to_directory('node_modules') + artifacts.go_to_directory("@#{registry_scope}") + expect(artifacts).to have_content( "#{project.name}") + end + + project.visit! + Page::Project::Menu.perform(&:click_packages_link) + + Page::Project::Packages::Index.perform do |index| + expect(index).to have_package(package.name) + + index.click_package(package.name) + end + + Page::Project::Packages::Show.perform do |show| + expect(show).to have_package_info(package.name, "1.0.0") + + show.click_delete + end + + Page::Project::Packages::Index.perform do |index| + expect(index).to have_content("Package deleted successfully") + expect(index).not_to have_package(package.name) + end end end end diff --git a/qa/qa/specs/features/browser_ui/5_package/nuget_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/nuget_repository_spec.rb index 1f62b285798..8a6752ed817 100644 --- a/qa/qa/specs/features/browser_ui/5_package/nuget_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/nuget_repository_spec.rb @@ -1,10 +1,9 @@ # frozen_string_literal: true -require 'securerandom' - module QA RSpec.describe 'Package', :orchestrated, :packages, :object_storage do describe 'NuGet Repository' do + using RSpec::Parameterized::TableSyntax include Runtime::Fixtures let(:project) do Resource::Project.fabricate_via_api! do |project| @@ -13,6 +12,21 @@ module QA end end + let(:personal_access_token) do + unless Page::Main::Menu.perform(&:signed_in?) + Flow::Login.sign_in + end + + Resource::PersonalAccessToken.fabricate! + end + + let(:group_deploy_token) do + Resource::GroupDeployToken.fabricate_via_browser_ui! do |deploy_token| + deploy_token.name = 'nuget-group-deploy-token' + deploy_token.group = project.group + end + end + let(:package) do Resource::Package.init do |package| package.name = "dotnetcore-#{SecureRandom.hex(8)}" @@ -42,123 +56,153 @@ module QA package.remove_via_api! end - it 'publishes a nuget package at the project level, installs and deletes it at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1073' do - Flow::Login.sign_in - - Resource::Repository::Commit.fabricate_via_api! do |commit| - commit.project = project - commit.commit_message = 'Add .gitlab-ci.yml' - commit.update_files( - [ - { - file_path: '.gitlab-ci.yml', - content: <<~YAML - image: mcr.microsoft.com/dotnet/sdk:5.0 - - stages: - - deploy - - deploy: - stage: deploy - script: - - dotnet restore -p:Configuration=Release - - dotnet build -c Release - - dotnet pack -c Release -p:PackageID=#{package.name} - - dotnet nuget add source "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/nuget/index.json" --name gitlab --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text - - dotnet nuget push "bin/Release/*.nupkg" --source gitlab - only: - - "#{project.default_branch}" - tags: - - "runner-for-#{project.group.name}" - YAML - } - ] - ) - end - - project.visit! - Flow::Pipeline.visit_latest_pipeline + where(:authentication_token_type, :token_name) do + :personal_access_token | 'Personal Access Token' + :ci_job_token | 'CI Job Token' + :group_deploy_token | 'Deploy Token' + end - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('deploy') + with_them do + let(:auth_token_password) do + case authentication_token_type + when :personal_access_token + "\"#{personal_access_token.token}\"" + when :ci_job_token + '${CI_JOB_TOKEN}' + when :group_deploy_token + "\"#{group_deploy_token.password}\"" + end end - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) + let(:auth_token_username) do + case authentication_token_type + when :personal_access_token + "\"#{personal_access_token.user.username}\"" + when :ci_job_token + 'gitlab-ci-token' + when :group_deploy_token + "\"#{group_deploy_token.username}\"" + end end - another_project.visit! - - Resource::Repository::Commit.fabricate_via_api! do |commit| - commit.project = another_project - commit.commit_message = 'Add new csproj file' - commit.add_files( - [ - { - file_path: 'otherdotnet.csproj', - content: <<~EOF - - - - Exe - net5.0 - - - - EOF - } - ] - ) - commit.update_files( - [ - { - file_path: '.gitlab-ci.yml', - content: <<~YAML + it "publishes a nuget package at the project level, installs and deletes it at the group level using a #{params[:token_name]}", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1073' do + Flow::Login.sign_in + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.update_files( + [ + { + file_path: '.gitlab-ci.yml', + content: <<~YAML image: mcr.microsoft.com/dotnet/sdk:5.0 stages: - - install + - deploy - install: - stage: install + deploy: + stage: deploy script: - - dotnet nuget locals all --clear - - dotnet nuget add source "$CI_SERVER_URL/api/v4/groups/#{another_project.group.id}/-/packages/nuget/index.json" --name gitlab --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text - - "dotnet add otherdotnet.csproj package #{package.name} --version 1.0.0" - only: - - "#{another_project.default_branch}" + - dotnet restore -p:Configuration=Release + - dotnet build -c Release + - dotnet pack -c Release -p:PackageID=#{package.name} + - dotnet nuget add source "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/nuget/index.json" --name gitlab --username #{auth_token_username} --password #{auth_token_password} --store-password-in-clear-text + - dotnet nuget push "bin/Release/*.nupkg" --source gitlab + rules: + - if: '$CI_COMMIT_BRANCH == "#{project.default_branch}"' tags: - "runner-for-#{project.group.name}" - YAML - } - ] - ) - end - - Flow::Pipeline.visit_latest_pipeline - - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('install') - end - - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - end - - project.group.visit! - - Page::Group::Menu.perform(&:go_to_group_packages) - - Page::Project::Packages::Index.perform do |index| - expect(index).to have_package(package.name) - index.click_package(package.name) - end - - Page::Project::Packages::Show.perform(&:click_delete) - - Page::Project::Packages::Index.perform do |index| - expect(index).to have_content("Package deleted successfully") - expect(index).not_to have_package(package.name) + YAML + } + ] + ) + end + + project.visit! + Flow::Pipeline.visit_latest_pipeline + + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('deploy') + end + + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + end + + another_project.visit! + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = another_project + commit.commit_message = 'Add new csproj file' + commit.add_files( + [ + { + file_path: 'otherdotnet.csproj', + content: <<~EOF + + + + Exe + net5.0 + + + + EOF + } + ] + ) + commit.update_files( + [ + { + file_path: '.gitlab-ci.yml', + content: <<~YAML + image: mcr.microsoft.com/dotnet/sdk:5.0 + + stages: + - install + + install: + stage: install + script: + - dotnet nuget locals all --clear + - dotnet nuget add source "$CI_SERVER_URL/api/v4/groups/#{another_project.group.id}/-/packages/nuget/index.json" --name gitlab --username #{auth_token_username} --password #{auth_token_password} --store-password-in-clear-text + - "dotnet add otherdotnet.csproj package #{package.name} --version 1.0.0" + only: + - "#{another_project.default_branch}" + tags: + - "runner-for-#{project.group.name}" + YAML + } + ] + ) + end + + Flow::Pipeline.visit_latest_pipeline + + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('install') + end + + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + end + + project.group.visit! + + Page::Group::Menu.perform(&:go_to_group_packages) + + Page::Project::Packages::Index.perform do |index| + expect(index).to have_package(package.name) + index.click_package(package.name) + end + + Page::Project::Packages::Show.perform(&:click_delete) + + Page::Project::Packages::Index.perform do |index| + expect(index).to have_content('Package deleted successfully') + expect(index).not_to have_package(package.name) + end end end end diff --git a/qa/qa/specs/features/browser_ui/5_package/online_garbage_collection_spec.rb b/qa/qa/specs/features/browser_ui/5_package/online_garbage_collection_spec.rb index 8c686e65e33..3ec76e8afad 100644 --- a/qa/qa/specs/features/browser_ui/5_package/online_garbage_collection_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/online_garbage_collection_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Package' do - describe 'Container Registry Online Garbage Collection', :registry_gc, only: { subdomain: %i[pre] }, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/337791', type: :waiting_on } do + describe 'Container Registry Online Garbage Collection', :registry_gc, only: { subdomain: %i[pre] } do let(:group) { Resource::Group.fabricate_via_api! } let(:imported_project) do @@ -90,7 +90,7 @@ module QA end end - it 'runs the online garbage collector tool', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1854' do + it 'runs the online garbage collector tool', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1889' do imported_project.visit! Flow::Pipeline.visit_latest_pipeline diff --git a/qa/qa/specs/features/browser_ui/5_package/pypi_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/pypi_repository_spec.rb index 7b924f1b52b..dfc9202ebed 100644 --- a/qa/qa/specs/features/browser_ui/5_package/pypi_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/pypi_repository_spec.rb @@ -117,7 +117,7 @@ module QA end context 'when at the project level' do - it 'publishes and installs a pypi package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1087' do + it 'publishes and installs a pypi package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1635' do Page::Project::Menu.perform(&:click_packages_link) Page::Project::Packages::Index.perform do |index| @@ -137,7 +137,7 @@ module QA end context 'Geo', :orchestrated, :geo do - it 'replicates a published pypi package to the Geo secondary site', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1120', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/325556', type: :investigating } do + it 'replicates a published pypi package to the Geo secondary site', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1219', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/325556', type: :investigating } do QA::Runtime::Logger.debug('Visiting the secondary Geo site') QA::Flow::Login.while_signed_in(address: :geo_secondary) do diff --git a/qa/qa/specs/features/browser_ui/5_package/rubygems_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/rubygems_registry_spec.rb index 530a3243766..9a45b072eed 100644 --- a/qa/qa/specs/features/browser_ui/5_package/rubygems_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/rubygems_registry_spec.rb @@ -43,7 +43,7 @@ module QA project.remove_via_api! end - it 'publishes and deletes a Ruby gem', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1131' do + it 'publishes and deletes a Ruby gem', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1906' do Flow::Login.sign_in Resource::Repository::ProjectPush.fabricate! do |push| diff --git a/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb index 713b32de217..8878b719a21 100644 --- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Release' do describe 'Deploy key creation' do - it 'user adds a deploy key', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1765' do + it 'user adds a deploy key', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1602' do Flow::Login.sign_in key = Runtime::Key::RSA.new diff --git a/qa/qa/specs/features/browser_ui/6_release/deploy_token/add_deploy_token_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_token/add_deploy_token_spec.rb index 10795654617..23625ab645d 100644 --- a/qa/qa/specs/features/browser_ui/6_release/deploy_token/add_deploy_token_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/deploy_token/add_deploy_token_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Release' do describe 'Deploy token creation' do - it 'user adds a deploy token', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/419' do + it 'user adds a deploy token', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1582' do Flow::Login.sign_in deploy_token_name = 'deploy token name' diff --git a/qa/qa/specs/features/browser_ui/6_release/pages/pages_pipeline_spec.rb b/qa/qa/specs/features/browser_ui/6_release/pages/pages_pipeline_spec.rb index 1502e1ab924..97f52ea7ec1 100644 --- a/qa/qa/specs/features/browser_ui/6_release/pages/pages_pipeline_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/pages/pages_pipeline_spec.rb @@ -31,7 +31,7 @@ module QA pipeline.visit! end - it 'runs a Pages-specific pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1783' do + it 'runs a Pages-specific pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1879' do Page::Project::Pipeline::Show.perform do |show| expect(show).to have_job(:pages) show.click_job(:pages) diff --git a/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_dependent_relationship_spec.rb b/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_dependent_relationship_spec.rb index 0ef3715db5e..46640b1a540 100644 --- a/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_dependent_relationship_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_dependent_relationship_spec.rb @@ -25,7 +25,7 @@ module QA runner.remove_via_api! end - it 'parent pipelines passes if child passes', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1153' do + it 'parent pipelines passes if child passes', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1198' do add_ci_files(success_child_ci_file) Flow::Pipeline.visit_latest_pipeline(pipeline_condition: 'completed') @@ -35,7 +35,7 @@ module QA end end - it 'parent pipeline fails if child fails', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1152' do + it 'parent pipeline fails if child fails', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1199' do add_ci_files(fail_child_ci_file) Flow::Pipeline.visit_latest_pipeline(pipeline_condition: 'completed') diff --git a/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_independent_relationship_spec.rb b/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_independent_relationship_spec.rb index 6c7ab9f2f72..dac89663f84 100644 --- a/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_independent_relationship_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_independent_relationship_spec.rb @@ -25,7 +25,7 @@ module QA runner.remove_via_api! end - it 'parent pipelines passes if child passes', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1161' do + it 'parent pipelines passes if child passes', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1191' do add_ci_files(success_child_ci_file) Flow::Pipeline.visit_latest_pipeline(pipeline_condition: 'completed') @@ -35,7 +35,7 @@ module QA end end - it 'parent pipeline passes even if child fails', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1162' do + it 'parent pipeline passes even if child fails', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1190' do add_ci_files(fail_child_ci_file) Flow::Pipeline.visit_latest_pipeline(pipeline_condition: 'completed') diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb index 1dcc02095f6..655c806a37a 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'pathname' - module QA RSpec.describe 'Configure' do let(:project) do @@ -23,7 +21,7 @@ module QA cluster&.remove! end - it 'runs auto devops', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1715' do + it 'runs auto devops', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1422' do Flow::Login.sign_in # Set an application secret CI variable (prefixed with K8S_SECRET_) @@ -102,7 +100,7 @@ module QA project.visit! Page::Project::Menu.perform(&:go_to_ci_cd_settings) - Page::Project::Settings::CICD.perform(&:expand_auto_devops) + Page::Project::Settings::CiCd.perform(&:expand_auto_devops) Page::Project::Settings::AutoDevops.perform(&:enable_autodevops) # Create AutoDevOps repo @@ -115,7 +113,7 @@ module QA end end - it 'runs an AutoDevOps pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1847' do + it 'runs an AutoDevOps pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1564' do Flow::Pipeline.visit_latest_pipeline Page::Project::Pipeline::Show.perform do |pipeline| diff --git a/qa/qa/specs/features/browser_ui/7_configure/kubernetes/kubernetes_integration_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/kubernetes/kubernetes_integration_spec.rb index 3a59efe645a..ba41285ebca 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/kubernetes/kubernetes_integration_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/kubernetes/kubernetes_integration_spec.rb @@ -20,7 +20,7 @@ module QA cluster.remove! end - it 'can create and associate a project cluster', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/707' do + it 'can create and associate a project cluster', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1419' do Resource::KubernetesCluster::ProjectCluster.fabricate_via_browser_ui! do |k8s_cluster| k8s_cluster.project = project k8s_cluster.cluster = cluster diff --git a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb index 1511f74c883..14bd6af815e 100644 --- a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb +++ b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb @@ -10,13 +10,13 @@ module QA @project.visit! end - it 'configures custom metrics', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/872' do + it 'configures custom metrics', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1334' do verify_add_custom_metric verify_edit_custom_metric verify_delete_custom_metric end - it 'duplicates to create dashboard to custom', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/871' do + it 'duplicates to create dashboard to custom', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1335' do Page::Project::Menu.perform(&:go_to_monitor_metrics) Page::Project::Monitor::Metrics::Show.perform do |on_dashboard| @@ -27,7 +27,7 @@ module QA end end - it 'verifies data on filtered deployed environment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/874' do + it 'verifies data on filtered deployed environment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1332' do Page::Project::Menu.perform(&:go_to_monitor_metrics) Page::Project::Monitor::Metrics::Show.perform do |on_dashboard| @@ -37,7 +37,7 @@ module QA end end - it 'filters using the quick range', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/873' do + it 'filters using the quick range', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1333' do Page::Project::Menu.perform(&:go_to_monitor_metrics) Page::Project::Monitor::Metrics::Show.perform do |on_dashboard| @@ -52,7 +52,7 @@ module QA end end - it 'observes cluster health graph', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/920' do + it 'observes cluster health graph', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1311' do Page::Project::Menu.perform(&:go_to_infrastructure_kubernetes) Page::Project::Infrastructure::Kubernetes::Index.perform do |cluster_list| @@ -65,7 +65,7 @@ module QA end end - it 'uses templating variables for metrics dashboards' do + it 'uses templating variables for metrics dashboards', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1926' do templating_dashboard_yml = Pathname .new(__dir__) .join('../../../../fixtures/metrics_dashboards/templating.yml') diff --git a/qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb b/qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb index a0f613cfda2..9d84658da76 100644 --- a/qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb +++ b/qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb @@ -20,7 +20,7 @@ module QA end end - it 'shows results for the original request and AJAX requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/478' do + it 'shows results for the original request and AJAX requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1545' do # Issue pages always make AJAX requests Resource::Issue.fabricate_via_browser_ui! do |issue| issue.title = 'Performance bar test' diff --git a/qa/qa/specs/helpers/context_formatter.rb b/qa/qa/specs/helpers/context_formatter.rb deleted file mode 100644 index 26db7c3b67e..00000000000 --- a/qa/qa/specs/helpers/context_formatter.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -require 'rspec/core' -require "rspec/core/formatters/base_formatter" - -module QA - module Specs - module Helpers - class ContextFormatter < ::RSpec::Core::Formatters::BaseFormatter - include ContextSelector - - ::RSpec::Core::Formatters.register( - self, - :example_group_started, - :example_started - ) - - # Starts example group - # @param [RSpec::Core::Notifications::GroupNotification] example_group_notification - # @return [void] - def example_group_started(example_group_notification) - set_skip_metadata(example_group_notification.group) - end - - # Starts example - # @param [RSpec::Core::Notifications::ExampleNotification] example_notification - # @return [void] - def example_started(example_notification) - example = example_notification.example - - # if skip propagated from example_group, do not reset skip metadata - set_skip_metadata(example_notification.example) unless example.metadata[:skip] - end - - private - - # Skip example_group or example - # - # @param [] example - # @return [void] - def set_skip_metadata(example) - return skip_only(example.metadata) if example.metadata.key?(:only) - return skip_except(example.metadata) if example.metadata.key?(:except) - end - - # Skip based on 'only' condition - # - # @param [Hash] metadata - # @return [void] - def skip_only(metadata) - return if context_matches?(metadata[:only]) - - metadata[:skip] = 'Test is not compatible with this environment or pipeline' - end - - # Skip based on 'except' condition - # - # @param [Hash] metadata - # @return [void] - def skip_except(metadata) - return unless except?(metadata[:except]) - - metadata[:skip] = 'Test is excluded in this job' - end - end - end - end -end diff --git a/qa/qa/specs/helpers/quarantine_formatter.rb b/qa/qa/specs/helpers/quarantine_formatter.rb deleted file mode 100644 index c42debee07c..00000000000 --- a/qa/qa/specs/helpers/quarantine_formatter.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -require 'rspec/core' -require "rspec/core/formatters/base_formatter" - -module QA - module Specs - module Helpers - class QuarantineFormatter < ::RSpec::Core::Formatters::BaseFormatter - include Quarantine - - ::RSpec::Core::Formatters.register( - self, - :example_group_started, - :example_started - ) - - # Starts example group - # @param [RSpec::Core::Notifications::GroupNotification] example_group_notification - # @return [void] - def example_group_started(example_group_notification) - group = example_group_notification.group - - skip_or_run_quarantined_tests_or_contexts(filters, group) - end - - # Starts example - # @param [RSpec::Core::Notifications::ExampleNotification] example_notification - # @return [void] - def example_started(example_notification) - example = example_notification.example - - # if skip propagated from example_group, do not reset skip metadata - skip_or_run_quarantined_tests_or_contexts(filters, example) unless example.metadata[:skip] - end - - private - - def filters - @filters ||= ::RSpec.configuration.inclusion_filter.rules - end - end - end - end -end diff --git a/qa/qa/specs/helpers/rspec.rb b/qa/qa/specs/helpers/rspec.rb index 853dfbfd1b6..3e97dbd118a 100644 --- a/qa/qa/specs/helpers/rspec.rb +++ b/qa/qa/specs/helpers/rspec.rb @@ -19,13 +19,22 @@ module QA # expanding into the global state # See: https://github.com/rspec/rspec-core/issues/2603 def describe_successfully(*args, &describe_body) - reporter = ::RSpec.configuration.reporter - - example_group = RSpec.describe(*args, &describe_body) + example_group = ::RSpec.describe(*args, &describe_body) ran_successfully = example_group.run reporter expect(ran_successfully).to eq true example_group end + + def send_stop_notification + reporter.notify( + :stop, + ::RSpec::Core::Notifications::ExamplesNotification.new(reporter) + ) + end + + def reporter + ::RSpec.configuration.reporter + end end end end diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb index bd9907611c7..d7d64834e7a 100644 --- a/qa/qa/specs/runner.rb +++ b/qa/qa/specs/runner.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'knapsack' require 'rspec/core' require 'rspec/expectations' diff --git a/qa/qa/support/allure_metadata_formatter.rb b/qa/qa/support/allure_metadata_formatter.rb deleted file mode 100644 index 8a18eeca839..00000000000 --- a/qa/qa/support/allure_metadata_formatter.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -require 'rspec/core' -require "rspec/core/formatters/base_formatter" - -module QA - module Support - class AllureMetadataFormatter < ::RSpec::Core::Formatters::BaseFormatter - ::RSpec::Core::Formatters.register( - self, - :example_started - ) - - # Starts example - # @param [RSpec::Core::Notifications::ExampleNotification] example_notification - # @return [void] - def example_started(example_notification) - example = example_notification.example - - testcase = example.metadata[:testcase] - example.tms('Testcase', testcase) if testcase - - quarantine_issue = example.metadata.dig(:quarantine, :issue) - example.issue('Quarantine issue', quarantine_issue) if quarantine_issue - - spec_file = example.file_path.split('/').last - example.issue( - 'Failure issues', - "https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&search=#{spec_file}" - ) - return unless Runtime::Env.running_in_ci? - - example.add_link(name: "Job(#{Runtime::Env.ci_job_name})", url: Runtime::Env.ci_job_url) - end - end - end -end diff --git a/qa/qa/support/api.rb b/qa/qa/support/api.rb index 579227b4f7a..205ddf7ad3a 100644 --- a/qa/qa/support/api.rb +++ b/qa/qa/support/api.rb @@ -1,10 +1,8 @@ # frozen_string_literal: true -require 'rest-client' - module QA module Support - module Api + module API HTTP_STATUS_OK = 200 HTTP_STATUS_CREATED = 201 HTTP_STATUS_NO_CONTENT = 204 diff --git a/qa/qa/support/formatters/allure_metadata_formatter.rb b/qa/qa/support/formatters/allure_metadata_formatter.rb new file mode 100644 index 00000000000..10769ba5c57 --- /dev/null +++ b/qa/qa/support/formatters/allure_metadata_formatter.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module QA + module Support + module Formatters + class AllureMetadataFormatter < ::RSpec::Core::Formatters::BaseFormatter + ::RSpec::Core::Formatters.register( + self, + :example_started + ) + + # Starts example + # @param [RSpec::Core::Notifications::ExampleNotification] example_notification + # @return [void] + def example_started(example_notification) + example = example_notification.example + + quarantine_issue = example.metadata.dig(:quarantine, :issue) + example.issue('Quarantine issue', quarantine_issue) if quarantine_issue + + spec_file = example.file_path.split('/').last + example.issue( + 'Failure issues', + "https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&search=#{spec_file}" + ) + return unless Runtime::Env.running_in_ci? + + example.add_link(name: "Job(#{Runtime::Env.ci_job_name})", url: Runtime::Env.ci_job_url) + end + end + end + end +end diff --git a/qa/qa/support/formatters/context_formatter.rb b/qa/qa/support/formatters/context_formatter.rb new file mode 100644 index 00000000000..c8991561f45 --- /dev/null +++ b/qa/qa/support/formatters/context_formatter.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module QA + module Support + module Formatters + class ContextFormatter < ::RSpec::Core::Formatters::BaseFormatter + include Specs::Helpers::ContextSelector + + ::RSpec::Core::Formatters.register( + self, + :example_group_started, + :example_started + ) + + # Starts example group + # @param [RSpec::Core::Notifications::GroupNotification] example_group_notification + # @return [void] + def example_group_started(example_group_notification) + set_skip_metadata(example_group_notification.group) + end + + # Starts example + # @param [RSpec::Core::Notifications::ExampleNotification] example_notification + # @return [void] + def example_started(example_notification) + example = example_notification.example + + # if skip propagated from example_group, do not reset skip metadata + set_skip_metadata(example_notification.example) unless example.metadata[:skip] + end + + private + + # Skip example_group or example + # + # @param [] example + # @return [void] + def set_skip_metadata(example) + return skip_only(example.metadata) if example.metadata.key?(:only) + return skip_except(example.metadata) if example.metadata.key?(:except) + end + + # Skip based on 'only' condition + # + # @param [Hash] metadata + # @return [void] + def skip_only(metadata) + return if context_matches?(metadata[:only]) + + metadata[:skip] = 'Test is not compatible with this environment or pipeline' + end + + # Skip based on 'except' condition + # + # @param [Hash] metadata + # @return [void] + def skip_except(metadata) + return unless except?(metadata[:except]) + + metadata[:skip] = 'Test is excluded in this job' + end + end + end + end +end diff --git a/qa/qa/support/formatters/formatters.rb b/qa/qa/support/formatters/formatters.rb new file mode 100644 index 00000000000..f0abf98001f --- /dev/null +++ b/qa/qa/support/formatters/formatters.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'rspec/core' +require 'rspec/core/formatters/base_formatter' + +module QA + module Support + module Formatters + end + end +end diff --git a/qa/qa/support/formatters/quarantine_formatter.rb b/qa/qa/support/formatters/quarantine_formatter.rb new file mode 100644 index 00000000000..c5d16988dbd --- /dev/null +++ b/qa/qa/support/formatters/quarantine_formatter.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module QA + module Support + module Formatters + class QuarantineFormatter < ::RSpec::Core::Formatters::BaseFormatter + include Specs::Helpers::Quarantine + + ::RSpec::Core::Formatters.register( + self, + :example_group_started, + :example_started + ) + + # Starts example group + # @param [RSpec::Core::Notifications::GroupNotification] example_group_notification + # @return [void] + def example_group_started(example_group_notification) + group = example_group_notification.group + + skip_or_run_quarantined_tests_or_contexts(filters, group) + end + + # Starts example + # @param [RSpec::Core::Notifications::ExampleNotification] example_notification + # @return [void] + def example_started(example_notification) + example = example_notification.example + + # if skip propagated from example_group, do not reset skip metadata + skip_or_run_quarantined_tests_or_contexts(filters, example) unless example.metadata[:skip] + end + + private + + def filters + @filters ||= ::RSpec.configuration.inclusion_filter.rules + end + end + end + end +end diff --git a/qa/qa/support/formatters/test_stats_formatter.rb b/qa/qa/support/formatters/test_stats_formatter.rb new file mode 100644 index 00000000000..0f76a924b10 --- /dev/null +++ b/qa/qa/support/formatters/test_stats_formatter.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +module QA + module Support + module Formatters + class TestStatsFormatter < RSpec::Core::Formatters::BaseFormatter + RSpec::Core::Formatters.register(self, :stop) + + # Finish test execution + # + # @param [RSpec::Core::Notifications::ExamplesNotification] notification + # @return [void] + def stop(notification) + return log(:warn, 'Missing QA_INFLUXDB_URL, skipping metrics export!') unless influxdb_url + return log(:warn, 'Missing QA_INFLUXDB_TOKEN, skipping metrics export!') unless influxdb_token + + data = notification.examples.map { |example| test_stats(example) }.compact + influx_client.create_write_api.write(data: data) + log(:info, "Pushed #{data.length} entries to influxdb") + rescue StandardError => e + log(:error, "Failed to push data to influxdb, error: #{e}") + end + + private + + # InfluxDb client + # + # @return [InfluxDB2::Client] + def influx_client + @influx_client ||= InfluxDB2::Client.new( + influxdb_url, + influxdb_token, + bucket: 'e2e-test-stats', + org: 'gitlab-qa', + use_ssl: false, + precision: InfluxDB2::WritePrecision::NANOSECOND + ) + end + + # InfluxDb instance url + # + # @return [String] + def influxdb_url + @influxdb_url ||= env('QA_INFLUXDB_URL') + end + + # Influxdb token + # + # @return [String] + def influxdb_token + @influxdb_token ||= env('QA_INFLUXDB_TOKEN') + end + + # Transform example to influxdb compatible metrics data + # https://github.com/influxdata/influxdb-client-ruby#data-format + # + # @param [RSpec::Core::Example] example + # @return [Hash] + def test_stats(example) + { + name: 'test-stats', + time: time, + tags: { + name: example.full_description, + file_path: example.metadata[:file_path].gsub('./qa/specs/features', ''), + status: example.execution_result.status, + reliable: example.metadata.key?(:reliable).to_s, + quarantined: example.metadata.key?(:quarantine).to_s, + retried: ((example.metadata[:retry_attempts] || 0) > 0).to_s, + job_name: job_name, + merge_request: merge_request, + run_type: env('QA_RUN_TYPE') || run_type + }, + fields: { + id: example.id, + run_time: (example.execution_result.run_time * 1000).round, + retry_attempts: example.metadata[:retry_attempts] || 0, + job_url: QA::Runtime::Env.ci_job_url, + pipeline_url: env('CI_PIPELINE_URL'), + pipeline_id: env('CI_PIPELINE_ID') + } + } + rescue StandardError => e + log(:error, "Failed to transform example '#{example.id}', error: #{e}") + nil + end + + # Project name + # + # @return [String] + def project_name + @project_name ||= QA::Runtime::Env.ci_project_name + end + + # Base ci job name + # + # @return [String] + def job_name + @job_name ||= QA::Runtime::Env.ci_job_name.gsub(%r{ \d{1,2}/\d{1,2}}, '') + end + + # Single common timestamp for all exported example metrics to keep data points consistently grouped + # + # @return [Time] + def time + @time ||= DateTime.strptime(env('CI_PIPELINE_CREATED_AT')).to_time + end + + # Is a merge request execution + # + # @return [String] + def merge_request + @merge_request ||= (!!env('CI_MERGE_REQUEST_IID') || !!env('TOP_UPSTREAM_MERGE_REQUEST_IID')).to_s + end + + # Test run type from staging, canary or production env + # + # @return [String>, nil] + def run_type + return unless %w[staging canary production].include?(project_name) + + @run_type ||= begin + test_subset = if env('NO_ADMIN') == 'true' + 'sanity-no-admin' + elsif env('SMOKE_ONLY') == 'true' + 'sanity' + else + 'full' + end + + "#{project_name}-#{test_subset}" + end + end + + # Print log message + # + # @param [Symbol] level + # @param [String] message + # @return [void] + def log(level, message) + QA::Runtime::Logger.public_send(level, "influxdb exporter: #{message}") + end + + # Return non empty environment variable value + # + # @param [String] name + # @return [String, nil] + def env(name) + return unless ENV[name] && !ENV[name].empty? + + ENV[name] + end + end + end + end +end diff --git a/qa/qa/support/helpers/stub_env.rb b/qa/qa/support/helpers/stub_env.rb new file mode 100644 index 00000000000..d6514788c24 --- /dev/null +++ b/qa/qa/support/helpers/stub_env.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Inspired by https://github.com/ljkbennett/stub_env/blob/master/lib/stub_env/helpers.rb +module QA + module Support + module Helpers + module StubEnv + def stub_env(key_or_hash, value = nil) + init_stub unless env_stubbed? + + if key_or_hash.is_a? Hash + key_or_hash.each { |k, v| add_stubbed_value(k, v) } + else + add_stubbed_value key_or_hash, value + end + end + + private + + STUBBED_KEY = '__STUBBED__' + + def add_stubbed_value(key, value) + allow(ENV).to receive(:[]).with(key).and_return(value) + allow(ENV).to receive(:key?).with(key).and_return(true) + allow(ENV).to receive(:fetch).with(key).and_return(value) + allow(ENV).to receive(:fetch).with(key, anything) do |_, default_val| + value || default_val + end + end + + def env_stubbed? + ENV[STUBBED_KEY] + end + + def init_stub + allow(ENV).to receive(:[]).and_call_original + allow(ENV).to receive(:key?).and_call_original + allow(ENV).to receive(:fetch).and_call_original + # Prevent secrets from leaking in CI + allow(ENV).to receive(:inspect).and_return([]) + add_stubbed_value(STUBBED_KEY, true) + end + end + end + end +end diff --git a/qa/qa/support/matchers/eventually_matcher.rb b/qa/qa/support/matchers/eventually_matcher.rb new file mode 100644 index 00000000000..ff8adab424b --- /dev/null +++ b/qa/qa/support/matchers/eventually_matcher.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# Rspec matcher with build in retry logic +# +# USAGE: +# +# Basic +# expect { Something.that.takes.time.to_appear }.to eventually_eq(expected_result) +# expect { Something.that.takes.time.to_appear }.not_to eventually_eq(expected_result) +# +# With duration and attempts override +# expect { Something.that.takes.time.to_appear }.to( +# eventually_eq(expected_result).within(max_duration: 10, max_attempts: 5) +# ) + +module QA + module Support + module Matchers + module EventuallyMatcher + %w[ + eq + be + include + be_truthy + be_falsey + be_empty + ].each do |op| + RSpec::Matchers.define(:"eventually_#{op}") do |*expected| + chain(:within) do |kwargs = {}| + @retry_args = kwargs + @retry_args[:sleep_interval] = 0.5 unless @retry_args[:sleep_interval] + end + + def supports_block_expectations? + true + end + + match { |actual| wait_and_check(actual, :default_expectation) } + + match_when_negated { |actual| wait_and_check(actual, :when_negated_expectation) } + + description do + "eventually #{operator_msg} #{expected.inspect}" + end + + failure_message do + "#{e}:\nexpected to #{description}, last attempt was #{@result.nil? ? 'nil' : @result}" + end + + failure_message_when_negated do + "#{e}:\nexpected not to #{description}, last attempt was #{@result.nil? ? 'nil' : @result}" + end + + # Execute rspec expectation within retrier + # + # @param [Proc] actual + # @param [Symbol] expectation_name + # @return [Boolean] + def wait_and_check(actual, expectation_name) + attempt = 0 + + QA::Runtime::Logger.debug("Running eventually matcher with '#{operator_msg}' operator") + QA::Support::Retrier.retry_until(**@retry_args) do + QA::Runtime::Logger.debug("evaluating expectation, attempt: #{attempt += 1}") + + public_send(expectation_name, actual) + rescue RSpec::Expectations::ExpectationNotMetError, QA::Resource::ApiFabricator::ResourceNotFoundError + false + end + rescue QA::Support::Repeater::RetriesExceededError, QA::Support::Repeater::WaitExceededError => e + @e = e + false + end + + # Execute rspec expectation + # + # @param [Proc] actual + # @return [void] + def default_expectation(actual) + expect(result(&actual)).to public_send(*expectation_args) + end + + # Execute negated rspec expectation + # + # @param [Proc] actual + # @return [void] + def when_negated_expectation(actual) + expect(result(&actual)).not_to public_send(*expectation_args) + end + + # Result of actual block + # + # @return [Object] + def result + @result = yield + end + + # Error message placeholder to indicate waiter did not fail properly + # This message should not appear under normal circumstances since it should + # always be assigned from repeater + # + # @return [String] + def e + @e ||= 'Waiter did not fail!' + end + + # Operator message + # + # @return [String] + def operator_msg + operator == 'eq' ? 'equal' : operator + end + + # Expect operator + # + # @return [String] + def operator + @operator ||= name.to_s.match(/eventually_(.+?)$/).to_a[1].to_s + end + + # Expectation args + # + # @return [String, Array] + def expectation_args + if operator.include?('truthy') || operator.include?('falsey') || operator.include?('empty') + operator + elsif operator == 'include' && expected.is_a?(Array) + [operator, *expected] + else + [operator, expected] + end + end + end + end + end + end + end +end diff --git a/qa/qa/support/matchers/have_matcher.rb b/qa/qa/support/matchers/have_matcher.rb new file mode 100644 index 00000000000..7001f53a7b7 --- /dev/null +++ b/qa/qa/support/matchers/have_matcher.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module QA + module Support + module Matchers + module HaveMatcher + PREDICATE_TARGETS = %w[ + element + file_content + assignee + child_pipeline + content + design + file + issue + job + package + pipeline + related_issue_item + snippet_description + tag + ].each do |predicate| + RSpec::Matchers.define "have_#{predicate}" do |*args, **kwargs| + match do |page_object| + page_object.public_send("has_#{predicate}?", *args, **kwargs) + end + + match_when_negated do |page_object| + page_object.public_send("has_no_#{predicate}?", *args, **kwargs) + end + end + end + end + end + end +end diff --git a/qa/qa/support/matchers/have_text.rb b/qa/qa/support/matchers/have_text.rb new file mode 100644 index 00000000000..2bae2971be3 --- /dev/null +++ b/qa/qa/support/matchers/have_text.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module QA + module Support + module Matchers + class HaveText + def initialize(expected_text, **kwargs) + @expected_text = expected_text + @kwargs = kwargs + end + + def matches?(actual) + @actual = wrap(actual) + @actual.has_text?(@expected_text, **@kwargs) + end + + def does_not_match?(actual) + @actual = wrap(actual) + @actual.has_no_text?(@expected_text, **@kwargs) + end + + def failure_message + "expected to find text \"#{@expected_text}\" in \"#{normalized_actual_text}\"" + end + + def failure_message_when_negated + "expected not to find text \"#{@expected_text}\" in \"#{normalized_actual_text}\"" + end + + def normalized_actual_text + @actual.text.gsub(/\s+/, " ") + end + + # From https://github.com/teamcapybara/capybara/blob/fe5940c6afbfe32152df936ce03ad1371ae05354/lib/capybara/rspec/matchers/base.rb#L66 + def wrap(actual) + actual = actual.to_capybara_node if actual.respond_to?(:to_capybara_node) + @context_el = if actual.respond_to?(:has_selector?) + actual + else + Capybara.string(actual.to_s) + end + end + end + + def have_text(text, **kwargs) # rubocop:disable Naming/PredicateName + HaveText.new(text, **kwargs) + end + + alias_method :have_content, :have_text + end + end +end diff --git a/qa/qa/tools/delete_projects.rb b/qa/qa/tools/delete_projects.rb index 8a690373a37..240901eea6f 100644 --- a/qa/qa/tools/delete_projects.rb +++ b/qa/qa/tools/delete_projects.rb @@ -10,7 +10,7 @@ require_relative '../../qa' module QA module Tools class DeleteProjects - include Support::Api + include Support::API def initialize raise ArgumentError, "Please provide GITLAB_ADDRESS environment variable" unless ENV['GITLAB_ADDRESS'] diff --git a/qa/qa/tools/delete_subgroups.rb b/qa/qa/tools/delete_subgroups.rb index b9e3ed66013..2734a702536 100644 --- a/qa/qa/tools/delete_subgroups.rb +++ b/qa/qa/tools/delete_subgroups.rb @@ -10,7 +10,7 @@ require_relative '../../qa' module QA module Tools class DeleteSubgroups - include Support::Api + include Support::API def initialize raise ArgumentError, "Please provide GITLAB_ADDRESS" unless ENV['GITLAB_ADDRESS'] diff --git a/qa/qa/tools/delete_test_ssh_keys.rb b/qa/qa/tools/delete_test_ssh_keys.rb index dea6930de1e..58ab4865336 100644 --- a/qa/qa/tools/delete_test_ssh_keys.rb +++ b/qa/qa/tools/delete_test_ssh_keys.rb @@ -15,7 +15,7 @@ require_relative '../../qa' module QA module Tools class DeleteTestSSHKeys - include Support::Api + include Support::API ITEMS_PER_PAGE = '100' diff --git a/qa/qa/tools/generate_perf_testdata.rb b/qa/qa/tools/generate_perf_testdata.rb index ec1aa20c3b8..8e5da94e7e6 100644 --- a/qa/qa/tools/generate_perf_testdata.rb +++ b/qa/qa/tools/generate_perf_testdata.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'securerandom' -require 'faker' require 'yaml' require_relative '../../qa' # This script generates testdata for Performance Testing. @@ -12,7 +10,7 @@ require_relative '../../qa' module QA module Tools class GeneratePerfTestdata - include Support::Api + include Support::API def initialize raise ArgumentError, "Please provide GITLAB_ADDRESS" unless ENV['GITLAB_ADDRESS'] diff --git a/qa/qa/vendor/jira/jira_api.rb b/qa/qa/vendor/jira/jira_api.rb index 65b080df3d0..64af824418d 100644 --- a/qa/qa/vendor/jira/jira_api.rb +++ b/qa/qa/vendor/jira/jira_api.rb @@ -5,7 +5,7 @@ module QA module Jira class JiraAPI include Scenario::Actable - include Support::Api + include Support::API def base_url host = QA::Runtime::Env.jira_hostname || 'localhost' diff --git a/qa/qa/vendor/saml_idp/page/base.rb b/qa/qa/vendor/saml_idp/page/base.rb index 286cb0a8cd8..39413a64d5a 100644 --- a/qa/qa/vendor/saml_idp/page/base.rb +++ b/qa/qa/vendor/saml_idp/page/base.rb @@ -2,7 +2,7 @@ module QA module Vendor - module SAMLIdp + module SamlIdp module Page class Base include Capybara::DSL diff --git a/qa/qa/vendor/saml_idp/page/login.rb b/qa/qa/vendor/saml_idp/page/login.rb index 041b4a0feee..dc6925109f7 100644 --- a/qa/qa/vendor/saml_idp/page/login.rb +++ b/qa/qa/vendor/saml_idp/page/login.rb @@ -4,7 +4,7 @@ require 'capybara/dsl' module QA module Vendor - module SAMLIdp + module SamlIdp module Page class Login < Page::Base def login(username, password) -- cgit v1.2.1