summaryrefslogtreecommitdiff
path: root/qa/qa/resource/ci_variable.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-06-10 08:56:25 +0100
committerSean McGivern <sean@gitlab.com>2019-06-10 08:56:25 +0100
commit51713627f61b5897c0697f7574d8c3d7c3e93c41 (patch)
tree21cf681e4c976bd2012af21ba749f952624de9b5 /qa/qa/resource/ci_variable.rb
parent6a4aa3f9be8b31e5d76750d40f15f5fef2c792af (diff)
parente3072811475dcd563911a78fce85263b693d3fd6 (diff)
downloadgitlab-ce-51713627f61b5897c0697f7574d8c3d7c3e93c41.tar.gz
Merge remote-tracking branch 'origin/master' into patch-56
Diffstat (limited to 'qa/qa/resource/ci_variable.rb')
-rw-r--r--qa/qa/resource/ci_variable.rb32
1 files changed, 30 insertions, 2 deletions
diff --git a/qa/qa/resource/ci_variable.rb b/qa/qa/resource/ci_variable.rb
index d82de4cb816..b178a64b72d 100644
--- a/qa/qa/resource/ci_variable.rb
+++ b/qa/qa/resource/ci_variable.rb
@@ -3,7 +3,7 @@
module QA
module Resource
class CiVariable < Base
- attr_accessor :key, :value
+ attr_accessor :key, :value, :masked
attribute :project do
Project.fabricate! do |resource|
@@ -19,12 +19,40 @@ module QA
Page::Project::Settings::CICD.perform do |setting|
setting.expand_ci_variables do |page|
- page.fill_variable(key, value)
+ page.fill_variable(key, value, masked)
page.save_variables
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,
+ masked: masked
+ }
+ end
end
end
end