Welcome to mirror list, hosted at ThFree Co, Russian Federation.

server_hooks_custom_error_message_spec.rb « web_ide_old « 3_create « browser_ui « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 99be95492e6738e9feb090b72fadacefd0207982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

# TODO: remove this test when coverage is replaced or deemed irrelevant
module QA
  RSpec.describe 'Create', :skip_live_env, except: { job: 'review-qa-*' }, product_group: :ide do
    before do
      skip("Skipped but kept as reference. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115741#note_1330720944")
    end

    describe 'Git Server Hooks' do
      let(:file_path) { File.join(Runtime::Path.fixtures_path, 'web_ide', 'README.md') }

      let(:project) do
        Resource::Project.fabricate_via_api! do |project|
          # Projects that have names that include pattern 'reject-prereceive' trigger a server hook on orchestrated env
          # that returns an error string using GL-HOOK-ERR
          project.name = "project-reject-prereceive-#{SecureRandom.hex(8)}"
        end
      end

      before do
        Flow::Login.sign_in
        project.visit!
      end

      context 'with custom error messages' do
        it 'renders preconfigured error message when user hook failed on commit in WebIDE',
          testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/364751' do
          Page::Project::Show.perform(&:open_web_ide_via_shortcut)
          Page::Project::WebIDE::Edit.perform do |ide|
            ide.wait_until_ide_loads
            ide.upload_file(file_path)
            ide.commit_changes(wait_for_success: false)
            expect(ide).to have_text('Custom error message rejecting prereceive hook for projects with GL_PROJECT_PATH')
          end
        end
      end
    end
  end
end