summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-07 12:23:36 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-07 12:23:36 +0000
commita55cfc1e6316232e25a46416b0a60be7c1282da7 (patch)
tree26ea2ed9e04c2110e718441577aec2489ea76642 /qa
parent024c8a427eaf3267daf92359dcb9668f28fa8384 (diff)
parentefcdc269e03836e78dcc8d460621c948ac02bc24 (diff)
downloadgitlab-ce-a55cfc1e6316232e25a46416b0a60be7c1282da7.tar.gz
Merge branch 'ce-39118-dynamic-pipeline-variables-fe' into 'master'
Dynamic CI secret variables -- CE backport See merge request gitlab-org/gitlab-ce!16842
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/factory/resource/secret_variable.rb2
-rw-r--r--qa/qa/page/project/settings/secret_variables.rb43
2 files changed, 18 insertions, 27 deletions
diff --git a/qa/qa/factory/resource/secret_variable.rb b/qa/qa/factory/resource/secret_variable.rb
index 54ef4d8d964..af0fa8af2df 100644
--- a/qa/qa/factory/resource/secret_variable.rb
+++ b/qa/qa/factory/resource/secret_variable.rb
@@ -31,7 +31,7 @@ module QA
page.fill_variable_key(key)
page.fill_variable_value(value)
- page.add_variable
+ page.save_variables
end
end
end
diff --git a/qa/qa/page/project/settings/secret_variables.rb b/qa/qa/page/project/settings/secret_variables.rb
index e3bfbfcf080..fea4acb389a 100644
--- a/qa/qa/page/project/settings/secret_variables.rb
+++ b/qa/qa/page/project/settings/secret_variables.rb
@@ -5,49 +5,40 @@ module QA
class SecretVariables < Page::Base
include Common
- view 'app/views/ci/variables/_table.html.haml' do
- element :variable_key, '.variable-key'
- element :variable_value, '.variable-value'
+ view 'app/views/ci/variables/_variable_row.html.haml' do
+ element :variable_key, '.js-ci-variable-input-key'
+ element :variable_value, '.js-ci-variable-input-value'
end
view 'app/views/ci/variables/_index.html.haml' do
- element :add_new_variable, 'btn_text: "Add new variable"'
- end
-
- view 'app/assets/javascripts/behaviors/secret_values.js' do
- element :reveal_value, 'Reveal value'
- element :hide_value, 'Hide value'
+ element :save_variables, '.js-secret-variables-save-button'
end
def fill_variable_key(key)
- fill_in 'variable_key', with: key
+ page.within('.js-ci-variable-list-section .js-row:nth-child(1)') do
+ page.find('.js-ci-variable-input-key').set(key)
+ end
end
def fill_variable_value(value)
- fill_in 'variable_value', with: value
+ page.within('.js-ci-variable-list-section .js-row:nth-child(1)') do
+ page.find('.js-ci-variable-input-value').set(value)
+ end
end
- def add_variable
- click_on 'Add new variable'
+ def save_variables
+ click_button('Save variables')
end
def variable_key
- page.find('.variable-key').text
- end
-
- def variable_value
- reveal_value do
- page.find('.variable-value').text
+ page.within('.js-ci-variable-list-section .js-row:nth-child(1)') do
+ page.find('.js-ci-variable-input-key').value
end
end
- private
-
- def reveal_value
- click_button('Reveal value')
-
- yield.tap do
- click_button('Hide value')
+ def variable_value
+ page.within('.js-ci-variable-list-section .js-row:nth-child(1)') do
+ page.find('.js-ci-variable-input-value').value
end
end
end