diff options
Diffstat (limited to 'qa')
58 files changed, 650 insertions, 166 deletions
diff --git a/qa/Dockerfile b/qa/Dockerfile index d040bddfc7f..76c81d03071 100644 --- a/qa/Dockerfile +++ b/qa/Dockerfile @@ -3,8 +3,8 @@ LABEL maintainer="GitLab Quality Department <quality@gitlab.com>" ENV DEBIAN_FRONTEND="noninteractive" ENV DOCKER_VERSION="17.09.0-ce" -ENV CHROME_VERSION="84.0.4147.89-1" -ENV CHROME_DRIVER_VERSION="84.0.4147.30" +ENV CHROME_VERSION="87.0.4280.141-1" +ENV CHROME_DRIVER_VERSION="87.0.4280.88" ENV CHROME_DEB="google-chrome-stable_${CHROME_VERSION}_amd64.deb" ENV CHROME_URL="https://s3.amazonaws.com/gitlab-google-chrome-stable/${CHROME_DEB}" diff --git a/qa/README.md b/qa/README.md index 5070e1ee9bd..f959acbc366 100644 --- a/qa/README.md +++ b/qa/README.md @@ -104,6 +104,15 @@ bundle exec bin/qa Test::Instance::All http://localhost:3000 -- qa/specs/feature Note that the separator `--` is required; all subsequent options will be ignored by the QA framework and passed to `rspec`. +#### Running tests for transient bugs + +A suite of tests have been written to test for [transient bugs](https://about.gitlab.com/handbook/engineering/quality/issue-triage/#transient-bugs). +Those tests are tagged `:transient` and therefore can be run via: + +```shell +bundle exec bin/qa Test::Instance::All http://localhost:3000 -- --tag transient +``` + ### Overriding the authenticated user Unless told otherwise, the QA tests will run as the default `root` user seeded @@ -156,6 +156,7 @@ module QA autoload :Mattermost, 'qa/scenario/test/integration/mattermost' autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage' autoload :SMTP, 'qa/scenario/test/integration/smtp' + autoload :SSHTunnel, 'qa/scenario/test/integration/ssh_tunnel' end module Sanity diff --git a/qa/qa/flow/project.rb b/qa/qa/flow/project.rb index db42a3a3594..8a9e2c86332 100644 --- a/qa/qa/flow/project.rb +++ b/qa/qa/flow/project.rb @@ -5,16 +5,6 @@ module QA module Project module_function - def add_member(project:, username:) - project.visit! - - Page::Project::Menu.perform(&:click_members) - - Page::Project::Members.perform do |member_settings| - member_settings.add_member(username) - end - end - def go_to_create_project_from_template if Page::Project::NewExperiment.perform(&:shown?) Page::Project::NewExperiment.perform(&:click_create_from_template_link) diff --git a/qa/qa/flow/sign_up.rb b/qa/qa/flow/sign_up.rb index b367b7976e8..a2a62371092 100644 --- a/qa/qa/flow/sign_up.rb +++ b/qa/qa/flow/sign_up.rb @@ -5,6 +5,10 @@ module QA module SignUp module_function + def page + Capybara.current_session + end + def sign_up!(user) Page::Main::Menu.perform(&:sign_out_if_signed_in) Page::Main::Login.perform(&:switch_to_register_page) @@ -14,6 +18,11 @@ module QA sign_up.fill_new_user_username_field(user.username) sign_up.fill_new_user_email_field(user.email) sign_up.fill_new_user_password_field(user.password) + + Support::Waiter.wait_until(sleep_interval: 0.5) do + page.has_content?("Username is available.") + end + sign_up.click_new_user_register_button end diff --git a/qa/qa/page/admin/overview/users/index.rb b/qa/qa/page/admin/overview/users/index.rb index fea95fdb84a..1885644d226 100644 --- a/qa/qa/page/admin/overview/users/index.rb +++ b/qa/qa/page/admin/overview/users/index.rb @@ -6,7 +6,7 @@ module QA module Overview module Users class Index < QA::Page::Base - view 'app/views/admin/users/index.html.haml' do + view 'app/views/admin/users/_users.html.haml' do element :user_search_field element :pending_approval_tab end diff --git a/qa/qa/page/component/issue_board/show.rb b/qa/qa/page/component/issue_board/show.rb index 15c1c25cbf9..4c1f03fbe86 100644 --- a/qa/qa/page/component/issue_board/show.rb +++ b/qa/qa/page/component/issue_board/show.rb @@ -39,7 +39,7 @@ module QA element :boards_list end - view 'app/assets/javascripts/boards/toggle_focus.js' do + view 'app/assets/javascripts/boards/components/toggle_focus.vue' do element :focus_mode_button end diff --git a/qa/qa/page/component/note.rb b/qa/qa/page/component/note.rb index 0454042289b..50567796bdb 100644 --- a/qa/qa/page/component/note.rb +++ b/qa/qa/page/component/note.rb @@ -162,10 +162,6 @@ module QA fill_element :reply_field, reply_text end - def wait_for_loading - has_no_element?(:skeleton_note_placeholer) - end - private def select_filter_with_text(text) @@ -174,7 +170,7 @@ module QA click_element :discussion_filter_dropdown find_element(:filter_menu_item, text: text).click - wait_for_loading + wait_for_requests end end end diff --git a/qa/qa/page/issuable/new.rb b/qa/qa/page/issuable/new.rb index 7891074092e..c549190c65b 100644 --- a/qa/qa/page/issuable/new.rb +++ b/qa/qa/page/issuable/new.rb @@ -28,6 +28,10 @@ module QA element :assign_to_me_link end + view 'app/views/shared/issuable/form/_template_selector.html.haml' do + element :template_dropdown + end + def fill_title(title) fill_element :issuable_form_title, title end @@ -43,6 +47,13 @@ module QA end end + def choose_template(template_name) + click_element :template_dropdown + within_element(:template_dropdown) do + click_on template_name + end + end + def select_label(label) click_element :issuable_label diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index ac4d38e5918..18676807fd6 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -58,6 +58,9 @@ module QA view 'app/assets/javascripts/diffs/components/diff_file_header.vue' do element :file_name_content + element :file_title_container + element :dropdown_button + element :edit_in_ide_button end view 'app/assets/javascripts/diffs/components/inline_diff_table_row.vue' do @@ -87,6 +90,15 @@ module QA element :review_preview_toggle end + view 'app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue' do + element :apply_suggestions_batch_button + element :add_suggestion_batch_button + end + + view 'app/assets/javascripts/vue_shared/components/markdown/header.vue' do + element :suggestion_button + end + def start_review click_element(:start_review_button) @@ -150,15 +162,12 @@ module QA def click_discussions_tab click_element(:notes_tab) - wait_for_loading + wait_for_requests end def click_diffs_tab click_element(:diffs_tab) - - wait_for_loading - - click_element(:dismiss_popover_button) if has_element?(:dismiss_popover_button) + click_element(:dismiss_popover_button) if has_element?(:dismiss_popover_button, wait: 1) end def click_pipeline_link @@ -296,6 +305,31 @@ module QA click_element(:open_in_web_ide_button) wait_for_requests end + + def edit_file_in_web_ide(file_name) + within_element(:file_title_container, file_name: file_name) do + click_element(:dropdown_button) + click_element(:edit_in_ide_button) + end + end + + def add_suggestion_to_diff(suggestion, line) + find("a[data-linenumber='#{line}']").hover + click_element(:diff_comment) + click_element(:suggestion_button) + initial_content = find_element(:reply_field).value + fill_element(:reply_field, '') + fill_element(:reply_field, initial_content.gsub(/(```suggestion:-0\+0\n).*(\n```)/, "\\1#{suggestion}\\2")) + click_element(:comment_now_button) + end + + def add_suggestion_to_batch + all_elements(:add_suggestion_batch_button, minimum: 1).first.click + end + + def apply_suggestions_batch + all_elements(:apply_suggestions_batch_button, minimum: 1).first.click + end end end end diff --git a/qa/qa/page/project/members.rb b/qa/qa/page/project/members.rb index 447049ce22a..7e722e02ad0 100644 --- a/qa/qa/page/project/members.rb +++ b/qa/qa/page/project/members.rb @@ -11,10 +11,6 @@ module QA element :invite_member_button end - view 'app/views/projects/project_members/_team.html.haml' do - element :members_list - end - view 'app/views/projects/project_members/index.html.haml' do element :invite_group_tab element :groups_list_tab @@ -25,11 +21,18 @@ module QA element :invite_group_button end - view 'app/views/shared/members/_group.html.haml' do + view 'app/assets/javascripts/pages/projects/project_members/index.js' do element :group_row + end + + view 'app/assets/javascripts/members/components/action_buttons/remove_group_link_button.vue' do element :delete_group_access_link end + view 'app/assets/javascripts/members/components/modals/remove_group_link_modal.vue' do + element :remove_group_link_modal_content + end + def select_group(group_name) click_element :group_select_field search_and_select(group_name) @@ -50,10 +53,13 @@ module QA def remove_group(group_name) click_element :invite_group_tab click_element :groups_list_tab - page.accept_alert do - within_element(:group_row, text: group_name) do - click_element :delete_group_access_link - end + + within_element(:group_row, text: group_name) do + click_element :delete_group_access_link + end + + within_element(:remove_group_link_modal_content) do + click_button 'Remove group' end end end diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb index a8b30922bd2..45c46004790 100644 --- a/qa/qa/page/project/web_ide/edit.rb +++ b/qa/qa/page/project/web_ide/edit.rb @@ -18,7 +18,8 @@ module QA end view 'app/assets/javascripts/ide/components/ide_tree.vue' do - element :new_file + element :new_file_button + element :new_directory_button end view 'app/assets/javascripts/ide/components/ide_tree_list.vue' do @@ -63,6 +64,7 @@ module QA view 'app/assets/javascripts/ide/components/new_dropdown/index.vue' do element :dropdown_button element :rename_move_button + element :delete_button end view 'app/views/shared/_confirm_fork_modal.html.haml' do @@ -82,6 +84,10 @@ module QA element :changed_file_icon_content end + view 'app/assets/javascripts/vue_shared/components/file_icon.vue' do + element :folder_icon_content + end + view 'app/assets/javascripts/vue_shared/components/content_viewer/content_viewer.vue' do element :preview_container end @@ -98,12 +104,20 @@ module QA element :file_upload_field end + view 'app/assets/javascripts/ide/components/commit_sidebar/list_item.vue' do + element :file_to_commit_content + end + def has_file?(file_name) within_element(:file_list) do - has_text?(file_name) + has_element?(:file_name_content, file_name: file_name) end end + def has_file_to_commit?(file_name) + has_element?(:file_to_commit_content, file_name: file_name) + end + def has_project_path?(project_path) has_element?(:project_path_content, project_path: project_path) end @@ -114,6 +128,12 @@ module QA end end + def has_folder_icon?(file_name) + within_element(:file_row_container, file_name: file_name) do + has_element?(:folder_icon_content) + end + end + def has_download_button?(file_name) click_element(:file_row_container, file_name: file_name) within_element(:preview_container) do @@ -128,12 +148,19 @@ module QA end end + def has_file_content?(file_name, file_content) + click_element(:file_row_container, file_name: file_name) + within_element(:editor_container) do + has_text?(file_content) + end + end + def go_to_project click_element(:project_path_content, Page::Project::Show) end def create_new_file_from_template(file_name, template) - click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile) + click_element(:new_file_button, Page::Component::WebIDE::Modal::CreateNewFile) within_element(:template_list) do click_on file_name @@ -226,7 +253,7 @@ module QA end def add_file(file_name, file_text) - click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile) + click_element(:new_file_button, Page::Component::WebIDE::Modal::CreateNewFile) fill_element(:file_name_field, file_name) click_button('Create file') wait_until(reload: false) { has_file?(file_name) } @@ -235,8 +262,15 @@ module QA end end + def add_directory(directory_name) + click_element(:new_directory_button, Page::Component::WebIDE::Modal::CreateNewFile) + fill_element(:file_name_field, directory_name) + click_button('Create directory') + wait_until(reload: false) { has_file?(directory_name) } + end + def rename_file(file_name, new_file_name) - click_element(:file_name_content, text: file_name) + click_element(:file_name_content, file_name: file_name) click_element(:dropdown_button) click_element(:rename_move_button, Page::Component::WebIDE::Modal::CreateNewFile) fill_element(:file_name_field, new_file_name) @@ -259,6 +293,16 @@ module QA find_element(:file_upload_field, visible: false).send_keys(file_path) end end + + def delete_file(file_name) + click_element(:file_name_content, file_name: file_name) + click_element(:dropdown_button) + click_element(:delete_button) + end + + def switch_to_commit_tab + click_element(:commit_mode_tab) + end end end end diff --git a/qa/qa/resource/issue.rb b/qa/qa/resource/issue.rb index a6bd8987077..ffffa0eecda 100644 --- a/qa/qa/resource/issue.rb +++ b/qa/qa/resource/issue.rb @@ -5,7 +5,7 @@ require 'securerandom' module QA module Resource class Issue < Base - attr_writer :description, :milestone, :weight + attr_writer :description, :milestone, :template, :weight attribute :project do Project.fabricate! do |resource| @@ -33,7 +33,8 @@ module QA Page::Project::Issue::New.perform do |new_page| new_page.fill_title(@title) - new_page.fill_description(@description) + new_page.choose_template(@template) if @template + new_page.fill_description(@description) if @description new_page.choose_milestone(@milestone) if @milestone new_page.create_new_issue end diff --git a/qa/qa/resource/members.rb b/qa/qa/resource/members.rb index 52928afa7db..a88980f26d8 100644 --- a/qa/qa/resource/members.rb +++ b/qa/qa/resource/members.rb @@ -31,12 +31,13 @@ module QA end class AccessLevel - NO_ACCESS = 0 - GUEST = 10 - REPORTER = 20 - DEVELOPER = 30 - MAINTAINER = 40 - OWNER = 50 + NO_ACCESS = 0 + MINIMAL_ACCESS = 5 + GUEST = 10 + REPORTER = 20 + DEVELOPER = 30 + MAINTAINER = 40 + OWNER = 50 end end end diff --git a/qa/qa/resource/merge_request.rb b/qa/qa/resource/merge_request.rb index ecf25b797a8..fd5f454f134 100644 --- a/qa/qa/resource/merge_request.rb +++ b/qa/qa/resource/merge_request.rb @@ -19,7 +19,8 @@ module QA :file_name, :file_content attr_writer :no_preparation, - :wait_for_merge + :wait_for_merge, + :template attribute :merge_when_pipeline_succeeds attribute :merge_status @@ -73,7 +74,8 @@ module QA Page::Project::Show.perform(&:new_merge_request) Page::MergeRequest::New.perform do |new_page| new_page.fill_title(@title) - new_page.fill_description(@description) + new_page.choose_template(@template) if @template + new_page.fill_description(@description) unless @template new_page.choose_milestone(@milestone) if @milestone new_page.assign_to_me if @assignee == 'me' labels.each do |label| @@ -86,6 +88,8 @@ module QA end def fabricate_via_api! + raise ResourceNotFoundError unless id + resource_web_url(api_get) rescue ResourceNotFoundError populate_target_and_source_if_required diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 1c637db5385..6c4139da83f 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -411,6 +411,10 @@ module QA ENV.fetch('GITLAB_AGENTK_VERSION', 'v13.7.0') end + def transient_trials + ENV.fetch('GITLAB_QA_TRANSIENT_TRIALS', 10).to_i + end + private def remote_grid_credentials 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 e71cbeb9837..85cfefd6c5c 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 @@ -1,8 +1,16 @@ # frozen_string_literal: true module QA - RSpec.describe 'Manage' do + RSpec.describe 'Manage', :requires_admin do describe 'Add project member' do + before do + Runtime::Feature.enable('vue_project_members_list') + end + + after do + Runtime::Feature.disable('vue_project_members_list') + end + it 'user adds project member', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/482' do Flow::Login.sign_in @@ -16,7 +24,7 @@ module QA Page::Project::Members.perform do |members| members.add_member(user.username) - expect(members).to have_content(/@#{user.username}( Is using seat)?(\n| )?Given access/) + expect(members).to have_content("@#{user.username}") end end end 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 a2e01398c94..e722710ee00 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 @@ -4,7 +4,7 @@ module QA RSpec.describe 'Manage', :smoke do describe 'Project creation' do it 'user creates a new project', - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/429' do + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1234' do Flow::Login.sign_in created_project = Resource::Project.fabricate_via_browser_ui! do |project| 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 418865a63d2..f623efe5a3a 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 @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Plan', :orchestrated, :smtp do + RSpec.describe 'Plan', :orchestrated, :smtp, :requires_admin do describe 'Email Notification' do include Support::Api @@ -16,13 +16,23 @@ module QA end before do + Runtime::Feature.enable('vue_project_members_list', project: project) Flow::Login.sign_in end + after do + Runtime::Feature.disable('vue_project_members_list', project: project) + end + it 'is received by a user for project invitation', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/676' do - Flow::Project.add_member(project: project, username: user.username) + project.visit! + + Page::Project::Menu.perform(&:click_members) + Page::Project::Members.perform do |member_settings| + member_settings.add_member(user.username) + end - expect(page).to have_content(/@#{user.username}(\n| )?Given access/) + expect(page).to have_content("@#{user.username}") mailhog_items = mailhog_json.dig('items') 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 e394f6b1e9c..a7f862e8911 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 @@ -20,7 +20,7 @@ module QA before do Flow::Login.sign_in - Flow::Project.add_member(project: project, username: user.username) + project.add_member(user) Resource::Issue.fabricate_via_api! do |issue| issue.project = project 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 6ed204a98d4..72c990cbbc2 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/434' do + it 'collapses and expands reply for comments in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1163' 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 d3780186f36..c5cd495f607 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/450' do + it 'comments on an issue and edits the comment', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1151' 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 688f42c48c6..de6b24e8477 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', :reliable, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/432' do + it 'creates an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1167' do issue = Resource::Issue.fabricate_via_browser_ui! Page::Project::Menu.perform(&:click_issues) 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 new file mode 100644 index 00000000000..5f5fe161e71 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Plan' do + describe 'Custom issue templates' do + let(:template_name) { 'custom_issue_template'} + let(:template_content) { 'This is a custom issue template test' } + + let(:template_project) do + Resource::Project.fabricate_via_api! do |project| + project.name = "custom-issue-template-project" + project.initialize_with_readme = true + end + end + + before do + Flow::Login.sign_in + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = template_project + commit.commit_message = 'Add custom issue template' + commit.add_files([ + { + file_path: ".gitlab/issue_templates/#{template_name}.md", + content: template_content + } + ]) + end + end + + it 'creates an issue via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1229' do + Resource::Issue.fabricate_via_browser_ui! do |issue| + issue.project = template_project + issue.template = template_name + end + + Page::Project::Issue::Show.perform do |issue_page| + expect(issue_page).to have_content(template_content) + end + end + end + end +end 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 c1113e7ec35..a23474ad6f2 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 @@ -24,7 +24,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/764' do + it 'successfully exports issues list as CSV', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1141' 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/issue_suggestions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb index 7c675862e26..ff33f9d4824 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/412' do + it 'shows issue suggestions when creating a new issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1175' 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 42b3e5364b7..1455847277e 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 @@ -39,27 +39,22 @@ module QA private def set_up_jira_integration - # Retry is required because allow_local_requests_from_web_hooks_and_services - # takes some time to get enabled. - # Bug issue: https://gitlab.com/gitlab-org/gitlab/-/issues/217010 - QA::Support::Retrier.retry_on_exception(max_attempts: 5, sleep_interval: 3) do - Runtime::ApplicationSettings.set_application_settings(allow_local_requests_from_web_hooks_and_services: true) + Runtime::ApplicationSettings.set_application_settings(allow_local_requests_from_web_hooks_and_services: true) - page.visit Runtime::Scenario.gitlab_address - Flow::Login.sign_in_unless_signed_in + page.visit Runtime::Scenario.gitlab_address + Flow::Login.sign_in_unless_signed_in - project.visit! + project.visit! - Page::Project::Menu.perform(&:go_to_integrations_settings) - QA::Page::Project::Settings::Integrations.perform(&:click_jira_link) + Page::Project::Menu.perform(&:go_to_integrations_settings) + QA::Page::Project::Settings::Integrations.perform(&:click_jira_link) - QA::Page::Project::Settings::Services::Jira.perform do |jira| - jira.setup_service_with(url: Vendor::Jira::JiraAPI.perform(&:base_url)) - end - - expect(page).not_to have_text("Url is blocked") - expect(page).to have_text("Jira settings saved and active.") + QA::Page::Project::Settings::Services::Jira.perform do |jira| + jira.setup_service_with(url: Vendor::Jira::JiraAPI.perform(&:base_url)) end + + expect(page).not_to have_text("Url is blocked") + expect(page).to have_text("Jira settings saved and active.") end def 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 5a8c9a4601a..cc815fd0e67 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 @@ -21,7 +21,7 @@ module QA end.visit! end - it 'mentions another user in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/446' do + it 'mentions another user in an issue', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1166' do Page::Project::Issue::Show.perform do |show| at_username = "@#{user.username}" 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 7f60726af0e..8f17a25012b 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/820' do + it 'focuses on issue board', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1176' 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 564cfbb8399..8c328abcbe9 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/922' do + it 'creates a group milestone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1148' 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 99d547acb26..78d1471f484 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/901' do + it 'creates a project milestone', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1165' 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 6a133540f87..d907cfaab6d 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/541' do + it 'relates and unrelates one issue to/from another', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1172' do issue_1.visit! Page::Project::Issue::Show.perform do |show| 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 d53e7fcf69a..449795f9707 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 @@ -19,26 +19,21 @@ module QA page.has_text? 'Welcome to Jira' end - # Retry is required because allow_local_requests_from_web_hooks_and_services - # takes some time to get enabled. - # Bug issue: https://gitlab.com/gitlab-org/gitlab/-/issues/217010 - QA::Support::Retrier.retry_on_exception(max_attempts: 5, sleep_interval: 3) do - Runtime::ApplicationSettings.set_application_settings(allow_local_requests_from_web_hooks_and_services: true) + Runtime::ApplicationSettings.set_application_settings(allow_local_requests_from_web_hooks_and_services: true) - page.visit Runtime::Scenario.gitlab_address - Flow::Login.sign_in_unless_signed_in + page.visit Runtime::Scenario.gitlab_address + Flow::Login.sign_in_unless_signed_in - project.visit! + project.visit! - Page::Project::Menu.perform(&:go_to_integrations_settings) - QA::Page::Project::Settings::Integrations.perform(&:click_jira_link) + Page::Project::Menu.perform(&:go_to_integrations_settings) + QA::Page::Project::Settings::Integrations.perform(&:click_jira_link) - QA::Page::Project::Settings::Services::Jira.perform do |jira| - jira.setup_service_with(url: Vendor::Jira::JiraAPI.perform(&:base_url)) - end - - expect(page).not_to have_text("Requests to the local network are not allowed") + QA::Page::Project::Settings::Services::Jira.perform do |jira| + jira.setup_service_with(url: Vendor::Jira::JiraAPI.perform(&:base_url)) end + + 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 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 510fc0c9a16..81ad1896075 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 @@ -16,7 +16,7 @@ module QA Flow::Login.sign_in end - it 'creates a basic merge request', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/409' do + it 'creates a basic merge request', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1276' do Resource::MergeRequest.fabricate_via_browser_ui! do |merge_request| merge_request.project = project merge_request.title = merge_request_title 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 new file mode 100644 index 00000000000..d8341eff41d --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + describe 'Merge request custom templates' do + let(:template_name) { 'custom_merge_request_template'} + let(:template_content) { 'This is a custom merge request template test' } + let(:template_project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'custom-mr-template-project' + project.initialize_with_readme = true + end + end + + let(:merge_request_title) { 'One merge request to rule them all' } + + before do + Flow::Login.sign_in + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = template_project + commit.commit_message = 'Add custom merge request template' + commit.add_files([ + { + file_path: ".gitlab/merge_request_templates/#{template_name}.md", + content: template_content + } + ]) + end + end + + it 'creates a merge request via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1230' do + Resource::MergeRequest.fabricate_via_browser_ui! do |merge_request| + merge_request.project = template_project + merge_request.title = merge_request_title + merge_request.template = template_name + merge_request.target_new_branch = false + end + + Page::MergeRequest::Show.perform do |merge_request| + expect(merge_request).to have_title(merge_request_title) + expect(merge_request).to have_description(template_content) + end + end + end + 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 823a033ab6d..3414584bae3 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 @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/30226', type: :bug } do describe 'Merge request rebasing' do - it 'user rebases source branch of merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/398' do + it 'user rebases source branch of merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1274' do Flow::Login.sign_in project = Resource::Project.fabricate_via_api! do |project| 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 08af18a992e..35ec2135491 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', :ldap_no_tls, :smoke do - it 'user using a personal access token pushes code to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/430' do + it 'user using a personal access token pushes code to the repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1278' do Flow::Login.sign_in access_token = Resource::PersonalAccessToken.fabricate!.access_token diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/add_file_to_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/add_file_to_snippet_spec.rb index 469335db5ab..604c98ca21e 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/add_file_to_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/add_file_to_snippet_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - describe 'Multiple file snippet' do + describe 'Multiple file snippet', quarantine: { only: { pipeline: :master }, issue: 'https://gitlab.com/gitlab-org/gitaly/-/issues/3143', type: :bug } do let(:personal_snippet) do Resource::Snippet.fabricate_via_api! do |snippet| snippet.title = 'Personal snippet to add file to' 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 a21c5d58aad..2940b2067a1 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 @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - describe 'Version control for personal snippets' do + describe 'Version control for personal snippets', quarantine: { only: { pipeline: :master }, issue: 'https://gitlab.com/gitlab-org/gitaly/-/issues/3143', type: :bug } do let(:new_file) { 'new_snippet_file' } let(:changed_content) { 'changes' } let(:commit_message) { 'Changes to snippets' } 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 4ce6c3fdcd3..b91424d5b65 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 @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - describe 'Version control for project snippets' do + describe 'Version control for project snippets', quarantine: { only: { pipeline: :master }, issue: 'https://gitlab.com/gitlab-org/gitaly/-/issues/3143', type: :bug } do let(:new_file) { 'new_snippet_file' } let(:changed_content) { 'changes' } let(:commit_message) { 'Changes to snippets' } diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/delete_file_from_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/delete_file_from_snippet_spec.rb index 8002e95cf0d..5c0983dabb6 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/delete_file_from_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/delete_file_from_snippet_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - describe 'Multiple file snippet' do + describe 'Multiple file snippet', quarantine: { only: { pipeline: :master }, issue: 'https://gitlab.com/gitlab-org/gitaly/-/issues/3143', type: :bug } do let(:personal_snippet) do Resource::Snippet.fabricate_via_api! do |snippet| snippet.title = 'Personal snippet to delete file from' diff --git a/qa/qa/specs/features/browser_ui/3_create/transient/apply_suggestion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/transient/apply_suggestion_spec.rb new file mode 100644 index 00000000000..eab2729af83 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/transient/apply_suggestion_spec.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + context 'Transient tests', :transient do + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'project-for-transient-test' + end + end + + let(:code_for_merge) do + Pathname + .new(__dir__) + .join('../../../../../fixtures/metrics_dashboards/templating.yml') + end + + let(:merge_request) do + Resource::MergeRequest.fabricate_via_api! do |merge_request| + merge_request.project = project + merge_request.title = 'Transient MR' + merge_request.description = 'detecting transient bugs' + merge_request.file_content = File.read(code_for_merge) + end + end + + let(:dev_user) do + Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) + end + + before do + project.add_member(dev_user) + Flow::Login.sign_in(as: dev_user, skip_page_validation: true) + + merge_request.visit! + + Page::MergeRequest::Show.perform(&:click_diffs_tab) + + [4, 6, 10, 13].each do |line_number| + Page::MergeRequest::Show.perform do |merge_request| + merge_request.add_suggestion_to_diff("This is the #{line_number} suggestion!", line_number) + end + end + + Flow::Login.sign_in + + merge_request.visit! + end + + it 'applies multiple suggestions', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1177' do + Page::MergeRequest::Show.perform do |merge_request| + merge_request.click_diffs_tab + 4.times { merge_request.add_suggestion_to_batch } + merge_request.apply_suggestions_batch + + expect(merge_request).to have_css('.badge-success', text: "Applied", count: 4) + end + end + end + end +end 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 new file mode 100644 index 00000000000..293c9043266 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + describe 'Add a directory in Web IDE' do + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'add-directory-project' + project.initialize_with_readme = true + end + end + + before do + Flow::Login.sign_in + + project.visit! + end + + context 'when a directory with the same name already exists' do + let(:directory_name) { 'first_directory' } + + before do + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.add_files([ + { + file_path: 'first_directory/test_file.txt', + content: "Test file content" + } + ]) + end + + project.visit! + + Page::Project::Show.perform(&:open_web_ide!) + end + + it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1615' do + Page::Project::WebIDE::Edit.perform do |ide| + ide.add_directory(directory_name) + end + + expect(page).to have_content('The name "first_directory" is already taken in this directory.') + end + end + + context 'when user adds a new empty directory' do + let(:directory_name) { 'new_empty_directory' } + + before do + 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 + Page::Project::WebIDE::Edit.perform do |ide| + ide.add_directory(directory_name) + + expect(ide).to have_file(directory_name) + expect(ide).to have_folder_icon(directory_name) + expect(ide).not_to have_file_addition_icon(directory_name) + + ide.switch_to_commit_tab + + expect(ide).not_to have_file_to_commit(directory_name) + end + end + end + end + end +end 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 new file mode 100644 index 00000000000..1789e20e216 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + describe 'Open Web IDE from Diff Tab' do + files = [ + { + file_path: 'file1', + content: 'test1' + }, + { + file_path: 'file2', + content: 'test2' + }, + { + file_path: 'file3', + content: 'test3' + } + ] + + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.initialize_with_readme = true + end + end + + let(:source) do + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.branch = 'new-mr' + commit.start_branch = project.default_branch + commit.commit_message = 'Add new files' + commit.add_files(files) + end + end + + let(:merge_request) do + Resource::MergeRequest.fabricate_via_api! do |mr| + mr.source = source + mr.project = project + mr.source_branch = 'new-mr' + mr.target_new_branch = false + end + end + + before do + Flow::Login.sign_in + + 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 + Page::MergeRequest::Show.perform do |show| + show.click_diffs_tab + show.edit_file_in_web_ide('file1') + end + + Page::Project::WebIDE::Edit.perform do |ide| + files.each do |files| + expect(ide).to have_file(files[:file_path]) + expect(ide).to have_file_content(files[:file_path], files[:content]) + end + + ide.delete_file('file1') + ide.commit_changes + end + + merge_request.visit! + + Page::MergeRequest::Show.perform do |show| + show.click_diffs_tab + + expect(show).not_to have_file('file1') + expect(show).to have_file('file2') + expect(show).to have_file('file3') + end + end + end + end +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 d62f894279f..0a342664dd2 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' do + it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1136' 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' do + it 'shows the Edit tab with the text', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1138' 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' do + it 'shows a Download button', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1137' 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' do + it 'shows an image viewer', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1139' do Page::Project::WebIDE::Edit.perform do |ide| ide.upload_file(file_path) 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 1e6cb4047f9..8617e05f912 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', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/391' do + it 'users creates a pipeline which gets processed', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1279' do Flow::Login.sign_in Resource::Repository::Commit.fabricate_via_api! do |commit| 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 be6f3b17ccd..6c1a0cea209 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 @@ -104,9 +104,7 @@ module QA index.click_package(package_name) end - Page::Project::Packages::Show.perform do |package| - package.click_delete - end + Page::Project::Packages::Show.perform(&:click_delete) Page::Project::Packages::Index.perform do |index| aggregate_failures 'package deletion' do 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 ae0580ff51b..7effefc4d73 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 @@ -75,9 +75,7 @@ module QA index.click_package(package_name) end - Page::Project::Packages::Show.perform do |package| - package.click_delete - end + Page::Project::Packages::Show.perform(&:click_delete) Page::Project::Packages::Index.perform do |index| expect(index).to have_content("Package deleted successfully") 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 9a0d832de09..3e3addf9eeb 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 @@ -100,9 +100,7 @@ module QA index.click_package(package_name) end - Page::Project::Packages::Show.perform do |package| - package.click_delete - end + Page::Project::Packages::Show.perform(&:click_delete) Page::Project::Packages::Index.perform do |index| aggregate_failures 'package deletion' do 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 552302addf9..6ab4a957c57 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 @@ -112,9 +112,7 @@ module QA index.click_package(package_name) end - Page::Project::Packages::Show.perform do |show| - show.click_delete - end + Page::Project::Packages::Show.perform(&:click_delete) Page::Project::Packages::Index.perform do |index| expect(index).to have_content("Package deleted successfully") 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 be806fcbb3e..8c3f0930207 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 @@ -13,6 +13,13 @@ module QA end end + let(:another_project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'nuget-package-install-project' + project.template_name = 'dotnetcore' + end + end + let!(:runner) do Resource::Runner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" @@ -22,11 +29,21 @@ module QA end end + let!(:another_runner) do + Resource::Runner.fabricate! do |runner| + runner.name = "qa-runner-#{Time.now.to_i}" + runner.tags = ["runner-for-#{another_project.name}"] + runner.executor = :docker + runner.project = another_project + end + end + after do runner.remove_via_api! + another_runner.remove_via_api! end - it 'publishes a nuget package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1073' do + 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| @@ -37,23 +54,23 @@ module QA { file_path: '.gitlab-ci.yml', content: <<~YAML - image: mcr.microsoft.com/dotnet/core/sdk:3.1 - - stages: - - deploy - - deploy: - stage: deploy - script: - - dotnet restore -p:Configuration=Release - - dotnet build -c Release - - dotnet pack -c Release - - 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.name}" + image: mcr.microsoft.com/dotnet/core/sdk:3.1 + + stages: + - deploy + + deploy: + stage: deploy + script: + - dotnet restore -p:Configuration=Release + - dotnet build -c Release + - dotnet pack -c Release + - 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.name}" YAML } ] @@ -71,16 +88,74 @@ module QA expect(job).to be_successful(timeout: 800) end - Page::Project::Menu.perform(&:click_packages_link) + 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 + <Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>netcoreapp3.1</TargetFramework> + </PropertyGroup> + + </Project> + EOF + } + ] + ) + commit.update_files( + [ + { + file_path: '.gitlab-ci.yml', + content: <<~YAML + image: mcr.microsoft.com/dotnet/core/sdk:3.1 + + 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 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}" + tags: + - "runner-for-#{another_project.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.sandbox.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 do |package| - package.click_delete - end + Page::Project::Packages::Show.perform(&:click_delete) Page::Project::Packages::Index.perform do |index| expect(index).to have_content("Package deleted successfully") 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 d5eca171d6c..396863b33c4 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 @@ -98,9 +98,7 @@ module QA index.click_package(package_name) end - Page::Project::Packages::Show.perform do |package| - package.click_delete - end + Page::Project::Packages::Show.perform(&:click_delete) Page::Project::Packages::Index.perform do |index| aggregate_failures do 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 17c53b3ddc9..5ea7a7bb4cb 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 @@ -30,7 +30,7 @@ module QA pipeline.visit! end - it 'runs a Pages-specific pipeline', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/296937' do + it 'runs a Pages-specific pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/877' 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 9ec05fcf5d3..0ef3715db5e 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/751' do + it 'parent pipelines passes if child passes', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1153' 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/752' do + it 'parent pipeline fails if child fails', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1152' 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 ed8c8baae0e..6c7ab9f2f72 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/754' do + it 'parent pipelines passes if child passes', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1161' 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/753' do + it 'parent pipeline passes even if child fails', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1162' 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 a619ccfad19..171a4776eaf 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 @@ -117,7 +117,7 @@ module QA end end - it 'runs an AutoDevOps pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/444' do + it 'runs an AutoDevOps pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1277' do Flow::Pipeline.visit_latest_pipeline Page::Project::Pipeline::Show.perform do |pipeline| diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb index 9027f17678d..04eaa02bda5 100644 --- a/qa/qa/specs/runner.rb +++ b/qa/qa/specs/runner.rb @@ -37,7 +37,7 @@ module QA if tags.any? tags.each { |tag| tags_for_rspec.push(['--tag', tag.to_s]) } else - tags_for_rspec.push(%w[--tag ~orchestrated]) unless (%w[-t --tag] & options).any? + tags_for_rspec.push(%w[--tag ~orchestrated --tag ~transient]) unless (%w[-t --tag] & options).any? end tags_for_rspec.push(%w[--tag ~geo]) unless QA::Runtime::Env.geo_environment? diff --git a/qa/spec/specs/runner_spec.rb b/qa/spec/specs/runner_spec.rb index b11054f0bd9..642d9e0745b 100644 --- a/qa/spec/specs/runner_spec.rb +++ b/qa/spec/specs/runner_spec.rb @@ -3,9 +3,9 @@ require 'active_support/core_ext/hash' RSpec.describe QA::Specs::Runner do - shared_examples 'excludes orchestrated and geo' do - it 'excludes the orchestrated and geo tags and includes default args' do - expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS]) + shared_examples 'excludes orchestrated, transient, and geo' do + it 'excludes the orchestrated, transient, and geo tags, and includes default args' do + expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS]) subject.perform end @@ -18,13 +18,13 @@ RSpec.describe QA::Specs::Runner do QA::Runtime::Scenario.define(:gitlab_address, "http://gitlab.test") end - it_behaves_like 'excludes orchestrated and geo' + it_behaves_like 'excludes orchestrated, transient, and geo' context 'when tty is set' do subject { described_class.new.tap { |runner| runner.tty = true } } it 'sets the `--tty` flag' do - expect_rspec_runner_arguments(['--tty', '--tag', '~orchestrated', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS]) + expect_rspec_runner_arguments(['--tty', '--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS]) subject.perform end @@ -43,7 +43,7 @@ RSpec.describe QA::Specs::Runner do context 'when "--tag smoke" is set as options' do subject { described_class.new.tap { |runner| runner.options = %w[--tag smoke] } } - it 'focuses on the given tag without excluded the orchestrated tag' do + it 'focuses on the given tag without excluded tags' do expect_rspec_runner_arguments(['--tag', '~geo', '--tag', 'smoke', *described_class::DEFAULT_TEST_PATH_ARGS]) subject.perform @@ -53,8 +53,8 @@ RSpec.describe QA::Specs::Runner do context 'when "qa/specs/features/foo" is set as options' do subject { described_class.new.tap { |runner| runner.options = %w[qa/specs/features/foo] } } - it 'passes the given tests path and excludes the orchestrated and geo tags' do - expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', 'qa/specs/features/foo']) + it 'passes the given tests path and excludes the orchestrated, transient, and geo tags' do + expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', 'qa/specs/features/foo']) subject.perform end @@ -63,7 +63,7 @@ RSpec.describe QA::Specs::Runner do context 'when "--tag smoke" and "qa/specs/features/foo" are set as options' do subject { described_class.new.tap { |runner| runner.options = %w[--tag smoke qa/specs/features/foo] } } - it 'focuses on the given tag and includes the path without excluding the orchestrated tag' do + it 'focuses on the given tag and includes the path without excluding the orchestrated or transient tags' do expect_rspec_runner_arguments(['--tag', '~geo', '--tag', 'smoke', 'qa/specs/features/foo']) subject.perform @@ -76,7 +76,7 @@ RSpec.describe QA::Specs::Runner do end it 'includes default args and excludes the skip_signup_disabled tag' do - expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', '--tag', '~skip_signup_disabled', *described_class::DEFAULT_TEST_PATH_ARGS]) + expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', '--tag', '~skip_signup_disabled', *described_class::DEFAULT_TEST_PATH_ARGS]) subject.perform end @@ -88,7 +88,7 @@ RSpec.describe QA::Specs::Runner do end it 'includes default args and excludes the skip_live_env tag' do - expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', '--tag', '~skip_live_env', *described_class::DEFAULT_TEST_PATH_ARGS]) + expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', '--tag', '~skip_live_env', *described_class::DEFAULT_TEST_PATH_ARGS]) subject.perform end end @@ -121,7 +121,7 @@ RSpec.describe QA::Specs::Runner do end it 'includes default args and excludes all unsupported tags' do - expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', *excluded_feature_tags_except(feature), *described_class::DEFAULT_TEST_PATH_ARGS]) + expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', *excluded_feature_tags_except(feature), *described_class::DEFAULT_TEST_PATH_ARGS]) subject.perform end @@ -146,11 +146,11 @@ RSpec.describe QA::Specs::Runner do end end - it_behaves_like 'excludes orchestrated and geo' + it_behaves_like 'excludes orchestrated, transient, and geo' end context 'when features are not specified' do - it_behaves_like 'excludes orchestrated and geo' + it_behaves_like 'excludes orchestrated, transient, and geo' end end |