Commit 8586391e authored by Lin Jen-Shin's avatar Lin Jen-Shin

Respect the latest changes from master

Basically using the new expand_section
parent 209c4c5e
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
.settings-content .settings-content
= render 'projects/runners/index' = render 'projects/runners/index'
%section.settings.no-animate.qa-secret-variables{ class: ('expanded' if expanded) } %section.settings.no-animate{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
Secret variables Secret variables
= link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'secret-variables'), target: '_blank' = link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'secret-variables'), target: '_blank'
%button.btn.js-settings-toggle.qa-expand-secret-variables %button.btn.js-settings-toggle
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
= render "ci/variables/content" = render "ci/variables/content"
......
...@@ -112,7 +112,6 @@ module QA ...@@ -112,7 +112,6 @@ module QA
autoload :Repository, 'qa/page/project/settings/repository' autoload :Repository, 'qa/page/project/settings/repository'
autoload :CICD, 'qa/page/project/settings/ci_cd' autoload :CICD, 'qa/page/project/settings/ci_cd'
autoload :DeployKeys, 'qa/page/project/settings/deploy_keys' autoload :DeployKeys, 'qa/page/project/settings/deploy_keys'
autoload :CICD, 'qa/page/project/settings/cicd'
autoload :SecretVariables, 'qa/page/project/settings/secret_variables' autoload :SecretVariables, 'qa/page/project/settings/secret_variables'
autoload :Runners, 'qa/page/project/settings/runners' autoload :Runners, 'qa/page/project/settings/runners'
end end
......
...@@ -24,9 +24,7 @@ module QA ...@@ -24,9 +24,7 @@ module QA
def fabricate! def fabricate!
project.visit! project.visit!
Page::Menu::Side.act do Page::Menu::Side.act { click_ci_cd_settings }
click_ci_cd_settings
end
Page::Project::Settings::CICD.perform do |setting| Page::Project::Settings::CICD.perform do |setting|
setting.expand_secret_variables do |page| setting.expand_secret_variables do |page|
......
...@@ -29,15 +29,19 @@ module QA ...@@ -29,15 +29,19 @@ module QA
end end
end end
def click_ci_cd_pipelines
within_sidebar do
click_link('CI / CD')
end
end
private private
def hover_settings def hover_settings
within_sidebar do within_sidebar do
find('.qa-settings-item').hover find('.qa-settings-item').hover
within_fly_out do yield
yield
end
end end
end end
......
...@@ -7,6 +7,7 @@ module QA ...@@ -7,6 +7,7 @@ module QA
view 'app/views/projects/settings/ci_cd/show.html.haml' do view 'app/views/projects/settings/ci_cd/show.html.haml' do
element :runners_settings, 'Runners settings' element :runners_settings, 'Runners settings'
element :secret_variables, 'Secret variables'
end end
def expand_runners_settings(&block) def expand_runners_settings(&block)
...@@ -14,6 +15,12 @@ module QA ...@@ -14,6 +15,12 @@ module QA
Settings::Runners.perform(&block) Settings::Runners.perform(&block)
end end
end end
def expand_secret_variables(&block)
expand_section('Secret variables') do
Settings::SecretVariables.perform(&block)
end
end
end end
end end
end end
......
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
...@@ -12,10 +12,17 @@ module QA ...@@ -12,10 +12,17 @@ module QA
end end
def expand_section(name) 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('#content-body') do
page.within('section', text: name) do page.within('section', text: name) do
click_button 'Expand'
yield yield
end end
end end
......
...@@ -3,15 +3,13 @@ module QA ...@@ -3,15 +3,13 @@ module QA
module Project module Project
module Settings module Settings
class SecretVariables < Page::Base class SecretVariables < Page::Base
include Common
view 'app/views/ci/variables/_table.html.haml' do view 'app/views/ci/variables/_table.html.haml' do
element :variable_key, '.variable-key' element :variable_key, '.variable-key'
element :variable_value, '.variable-value' element :variable_value, '.variable-value'
end end
view 'app/views/projects/settings/ci_cd/show.html.haml' do
element :secret_variable
end
def fill_variable_key(key) def fill_variable_key(key)
fill_in 'variable_key', with: key fill_in 'variable_key', with: key
end end
...@@ -36,21 +34,11 @@ module QA ...@@ -36,21 +34,11 @@ module QA
private private
def within_section
page.within('.qa-secret-variables') do
yield
end
end
def reveal_value def reveal_value
within_section do click_button('Reveal value')
click_button('Reveal value')
end
yield.tap do yield.tap do
within_section do click_button('Hide value')
click_button('Hide value')
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment