diff options
Diffstat (limited to 'qa/qa/page/admin/settings/main.rb')
-rw-r--r-- | qa/qa/page/admin/settings/main.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/qa/qa/page/admin/settings/main.rb b/qa/qa/page/admin/settings/main.rb new file mode 100644 index 00000000000..9b284fe7be1 --- /dev/null +++ b/qa/qa/page/admin/settings/main.rb @@ -0,0 +1,37 @@ +module QA + module Page + module Admin + module Settings + class Main < Page::Base + view 'app/views/admin/application_settings/show.html.haml' do + element :advanced_settings_section, 'Repository storage' + end + + def expand_repo_storage(&block) + expand_section('Repository storage') do + RepoStorage.perform(&block) + end + end + + # Click the Expand button present in the specified section + # + # @param [String] name present in the container in the DOM + def expand_section(name) + page.within('#content-body') do + page.within('section', text: name) do + # Because it is possible to click the button before the JS toggle code is bound + wait(reload: false) do + click_button 'Expand' unless first('button', text: 'Collapse') + + page.has_content?('Collapse') + end + + yield if block_given? + end + end + end + end + end + end + end +end |