summaryrefslogtreecommitdiff
path: root/qa/qa/factory/resource/ci_variable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/factory/resource/ci_variable.rb')
-rw-r--r--qa/qa/factory/resource/ci_variable.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/qa/qa/factory/resource/ci_variable.rb b/qa/qa/factory/resource/ci_variable.rb
new file mode 100644
index 00000000000..a0aefc61f9f
--- /dev/null
+++ b/qa/qa/factory/resource/ci_variable.rb
@@ -0,0 +1,30 @@
+module QA
+ module Factory
+ module Resource
+ class CiVariable < Factory::Base
+ attr_accessor :key, :value
+
+ attribute :project do
+ Factory::Resource::Project.fabricate! do |resource|
+ resource.name = 'project-with-ci-variables'
+ resource.description = 'project for adding CI variable test'
+ end
+ end
+
+ def fabricate!
+ project.visit!
+
+ Page::Project::Menu.perform(&:click_ci_cd_settings)
+
+ Page::Project::Settings::CICD.perform do |setting|
+ setting.expand_ci_variables do |page|
+ page.fill_variable(key, value)
+
+ page.save_variables
+ end
+ end
+ end
+ end
+ end
+ end
+end