summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/4_verify/ci_variable/add_ci_variable_spec.rb
blob: b060f15168cd427f69151627bd4f2a7bfb2b8eb0 (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
# frozen_string_literal: true

module QA
  context 'Verify' do
    describe 'CI variable support' do
      it 'user adds a CI variable', :smoke do
        Runtime::Browser.visit(:gitlab, Page::Main::Login)
        Page::Main::Login.perform(&:sign_in_using_credentials)

        project = Resource::Project.fabricate! do |project|
          project.name = 'project-with-ci-variables'
          project.description = 'project with CI variables'
        end

        Resource::CiVariable.fabricate! do |resource|
          resource.project = project
          resource.key = 'VARIABLE_KEY'
          resource.value = 'some_CI_variable'
          resource.masked = false
        end

        project.visit!

        Page::Project::Menu.perform(&:go_to_ci_cd_settings)

        Page::Project::Settings::CICD.perform do |settings|
          settings.expand_ci_variables do |page|
            expect(page).to have_field(with: 'VARIABLE_KEY')
            expect(page).not_to have_field(with: 'some_CI_variable')

            page.reveal_variables

            expect(page).to have_field(with: 'some_CI_variable')
          end
        end
      end
    end
  end
end