diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-01-25 16:11:44 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-01-25 16:11:44 +0300 |
commit | 8586391e073901ef7dcd70e20f3ccc00774006d2 (patch) | |
tree | 4c603596febbeb93502b3b17323d42c01dcb86e0 /qa | |
parent | 209c4c5e3ef0f6f0fe1c0c0cd2271e450d8790bc (diff) |
Respect the latest changes from master
Basically using the new expand_section
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa.rb | 1 | ||||
-rw-r--r-- | qa/qa/factory/resource/secret_variable.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/menu/side.rb | 10 | ||||
-rw-r--r-- | qa/qa/page/project/settings/ci_cd.rb | 7 | ||||
-rw-r--r-- | qa/qa/page/project/settings/cicd.rb | 21 | ||||
-rw-r--r-- | qa/qa/page/project/settings/common.rb | 11 | ||||
-rw-r--r-- | qa/qa/page/project/settings/secret_variables.rb | 20 |
7 files changed, 28 insertions, 46 deletions
@@ -112,7 +112,6 @@ module QA autoload :Repository, 'qa/page/project/settings/repository' autoload :CICD, 'qa/page/project/settings/ci_cd' autoload :DeployKeys, 'qa/page/project/settings/deploy_keys' - autoload :CICD, 'qa/page/project/settings/cicd' autoload :SecretVariables, 'qa/page/project/settings/secret_variables' autoload :Runners, 'qa/page/project/settings/runners' end diff --git a/qa/qa/factory/resource/secret_variable.rb b/qa/qa/factory/resource/secret_variable.rb index 0b84d6fec60..54ef4d8d964 100644 --- a/qa/qa/factory/resource/secret_variable.rb +++ b/qa/qa/factory/resource/secret_variable.rb @@ -24,9 +24,7 @@ module QA def fabricate! project.visit! - Page::Menu::Side.act do - click_ci_cd_settings - end + Page::Menu::Side.act { click_ci_cd_settings } Page::Project::Settings::CICD.perform do |setting| setting.expand_secret_variables do |page| diff --git a/qa/qa/page/menu/side.rb b/qa/qa/page/menu/side.rb index 0ca428e8b5a..239f2872228 100644 --- a/qa/qa/page/menu/side.rb +++ b/qa/qa/page/menu/side.rb @@ -29,15 +29,19 @@ module QA end end + def click_ci_cd_pipelines + within_sidebar do + click_link('CI / CD') + end + end + private def hover_settings within_sidebar do find('.qa-settings-item').hover - within_fly_out do - yield - end + yield end end diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb index 5270dde7411..99be21bbe89 100644 --- a/qa/qa/page/project/settings/ci_cd.rb +++ b/qa/qa/page/project/settings/ci_cd.rb @@ -7,6 +7,7 @@ module QA view 'app/views/projects/settings/ci_cd/show.html.haml' do element :runners_settings, 'Runners settings' + element :secret_variables, 'Secret variables' end def expand_runners_settings(&block) @@ -14,6 +15,12 @@ module QA Settings::Runners.perform(&block) end end + + def expand_secret_variables(&block) + expand_section('Secret variables') do + Settings::SecretVariables.perform(&block) + end + end end end end diff --git a/qa/qa/page/project/settings/cicd.rb b/qa/qa/page/project/settings/cicd.rb deleted file mode 100644 index 045a0826522..00000000000 --- a/qa/qa/page/project/settings/cicd.rb +++ /dev/null @@ -1,21 +0,0 @@ -module QA - module Page - module Project - module Settings - class CICD < Page::Base - include Common - - view 'app/views/projects/settings/ci_cd/show.html.haml' do - element :expand_secret_variables - end - - def expand_secret_variables(&block) - expand(:expand_secret_variables) do - SecretVariables.perform(&block) - end - end - end - end - end - end -end diff --git a/qa/qa/page/project/settings/common.rb b/qa/qa/page/project/settings/common.rb index 1357bf031d5..7fa04b62fde 100644 --- a/qa/qa/page/project/settings/common.rb +++ b/qa/qa/page/project/settings/common.rb @@ -12,10 +12,17 @@ module QA end def expand_section(name) + within_section(name) do + # Don't expand if it's already expanded + click_button 'Expand' unless first('button', text: 'Collapse') + + yield + end + end + + def within_section(name) page.within('#content-body') do page.within('section', text: name) do - click_button 'Expand' - yield end end diff --git a/qa/qa/page/project/settings/secret_variables.rb b/qa/qa/page/project/settings/secret_variables.rb index 880ef58ab54..846fd893f94 100644 --- a/qa/qa/page/project/settings/secret_variables.rb +++ b/qa/qa/page/project/settings/secret_variables.rb @@ -3,15 +3,13 @@ module QA module Project module Settings 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' end - view 'app/views/projects/settings/ci_cd/show.html.haml' do - element :secret_variable - end - def fill_variable_key(key) fill_in 'variable_key', with: key end @@ -36,21 +34,11 @@ module QA private - def within_section - page.within('.qa-secret-variables') do - yield - end - end - def reveal_value - within_section do - click_button('Reveal value') - end + click_button('Reveal value') yield.tap do - within_section do - click_button('Hide value') - end + click_button('Hide value') end end end |