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 @@ ...@@ -2,26 +2,21 @@
module QA module QA
context 'Verify' do context 'Verify' do
describe 'CI variable support' do describe 'Add or Remove CI variable via UI', :smoke do
it 'user adds a CI variable', :smoke do let!(:project) do
Flow::Login.sign_in Resource::Project.fabricate_via_api! do |project|
project = Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-ci-variables' project.name = 'project-with-ci-variables'
project.description = 'project with CI variables' project.description = 'project with CI variables'
end end
end
Resource::CiVariable.fabricate_via_api! do |resource| before do
resource.project = project Flow::Login.sign_in
resource.key = 'VARIABLE_KEY' add_ci_variable
resource.value = 'some_CI_variable' open_ci_cd_settings
resource.masked = false end
end
project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
it 'user adds a CI variable' do
Page::Project::Settings::CICD.perform do |settings| Page::Project::Settings::CICD.perform do |settings|
settings.expand_ci_variables do |page| settings.expand_ci_variables do |page|
expect(page).to have_field(with: 'VARIABLE_KEY') expect(page).to have_field(with: 'VARIABLE_KEY')
...@@ -33,6 +28,32 @@ module QA ...@@ -33,6 +28,32 @@ module QA
end end
end 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 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