summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/project/add_secret_variable_spec.rb
blob: d1bf7849bd031866b6e0ab5a6d211186ec264df0 (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
module QA
  feature 'secret variables support', :core do
    scenario 'user adds a secret variable' do
      Runtime::Browser.visit(:gitlab, Page::Main::Login)
      Page::Main::Login.act { sign_in_using_credentials }

      Factory::Resource::SecretVariable.fabricate! do |resource|
        resource.key = 'VARIABLE_KEY'
        resource.value = 'some secret variable'
      end

      Page::Project::Settings::CICD.perform do |settings|
        settings.expand_secret_variables do |page|
          expect(page).to have_field(with: 'VARIABLE_KEY')
          expect(page).not_to have_field(with: 'some secret variable')

          page.reveal_variables

          expect(page).to have_field(with: 'some secret variable')
        end
      end
    end
  end
end