diff options
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/factory/resource/secret_variable.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/project/settings/secret_variables.rb | 43 |
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 |