Commit 83796443 authored by Tiffany Rea's avatar Tiffany Rea Committed by Dan Davison

Apply suggestion to...

Apply suggestion to qa/qa/specs/features/browser_ui/4_verify/ci_variable/add_remove_ci_variable_spec.rb
parent 864f17cf
......@@ -2,26 +2,21 @@
module QA
context 'Verify' do
describe 'CI variable support' do
it 'user adds a CI variable', :smoke do
Flow::Login.sign_in
project = Resource::Project.fabricate_via_api! do |project|
describe 'Add or Remove CI variable via UI', :smoke do
let!(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-ci-variables'
project.description = 'project with CI variables'
end
end
Resource::CiVariable.fabricate_via_api! 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)
before do
Flow::Login.sign_in
add_ci_variable
open_ci_cd_settings
end
it 'user adds a CI variable' do
Page::Project::Settings::CICD.perform do |settings|
settings.expand_ci_variables do |page|
expect(page).to have_field(with: 'VARIABLE_KEY')
......@@ -33,6 +28,32 @@ module QA
end
end
end
it 'user removes a CI variable' do
Page::Project::Settings::CICD.perform do |settings|
settings.expand_ci_variables do |page|
page.remove_variable
expect(page).not_to have_field(with: 'VARIABLE_KEY')
end
end
end
private
def add_ci_variable
Resource::CiVariable.fabricate_via_browser_ui! do |ci_variable|
ci_variable.project = project
ci_variable.key = 'VARIABLE_KEY'
ci_variable.value = 'some_CI_variable'
ci_variable.masked = false
end
end
def open_ci_cd_settings
project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment