Commit bb5bbbaa authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'dd-qa-api-delegation-project-cicd-vars' into 'master'

Delegate CiVariable fabrication to API

See merge request gitlab-org/gitlab-ce!27924
parents 9d985356 6429ef77
......@@ -25,6 +25,33 @@ module QA
end
end
end
def fabricate_via_api!
resource_web_url(api_get)
rescue ResourceNotFoundError
super
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def api_get_path
"/projects/#{project.id}/variables/#{key}"
end
def api_post_path
"/projects/#{project.id}/variables"
end
def api_post_body
{
key: key,
value: value
}
end
end
end
end
......@@ -7,6 +7,7 @@ module QA
class Project < Base
include Events::Project
attribute :id
attribute :name
attribute :description
......
......@@ -3,15 +3,25 @@
module QA
context 'Verify' do
describe 'CI variable support' do
it 'user adds a CI variable' do
it 'user adds a CI variable', :smoke do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
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'
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')
......
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