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

auto_devops_templates_spec.rb « auto_devops « 7_configure « 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: 4cadeb4b8420327e422a90642a42e8fbbf05b481 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# frozen_string_literal: true

module QA
  RSpec.describe 'Configure' do
    describe 'AutoDevOps Templates', only: { subdomain: %i[staging staging-canary] }, product_group: :configure do
      using RSpec::Parameterized::TableSyntax

      # specify jobs to be disabled in the pipeline.
      # CANARY_ENABLED will allow the pipeline to be
      # blocked by a manual job, rather than fail
      # during the production run
      let(:optional_jobs) do
        %w[
          LICENSE_MANAGEMENT_DISABLED
          SAST_DISABLED DAST_DISABLED
          DEPENDENCY_SCANNING_DISABLED
          CONTAINER_SCANNING_DISABLED
          CANARY_ENABLED
        ]
      end

      where(:case_name, :template, :testcase) do
        'using express template' | 'express' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348075'
      end

      with_them do
        let!(:project) do
          create(:project,
            :auto_devops,
            name: "#{template}-autodevops-project-template",
            template_name: template,
            description: "Let's see if the #{template} project works")
        end

        let(:pipeline) do
          create(:pipeline,
            project: project,
            variables: optional_jobs.map do |job|
              { key: job, value: '1', variable_type: 'env_var' }
            end)
        end

        before do
          Flow::Login.sign_in
        end

        it 'works with Auto DevOps', testcase: params[:testcase] do
          %w[build code_quality test].each do |job|
            pipeline.visit!

            Page::Project::Pipeline::Show.perform do |show_page|
              show_page.click_job(job)
            end

            Page::Project::Job::Show.perform do |show|
              expect(show).to have_passed(timeout: 800)
            end
          end
        end
      end
    end
  end
end