summaryrefslogtreecommitdiff
path: root/qa/qa/page/admin
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/admin')
-rw-r--r--qa/qa/page/admin/settings.rb26
-rw-r--r--qa/qa/page/admin/settings/main.rb37
-rw-r--r--qa/qa/page/admin/settings/repo_storage.rb33
3 files changed, 70 insertions, 26 deletions
diff --git a/qa/qa/page/admin/settings.rb b/qa/qa/page/admin/settings.rb
deleted file mode 100644
index 1f646103e7f..00000000000
--- a/qa/qa/page/admin/settings.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module QA
- module Page
- module Admin
- class Settings < Page::Base
- view 'app/views/admin/application_settings/_form.html.haml' do
- element :form_actions, '.form-actions'
- element :submit, "submit 'Save'"
- element :repository_storage, '%legend Repository Storage'
- element :hashed_storage,
- 'Create new projects using hashed storage paths'
- end
-
- def enable_hashed_storage
- scroll_to 'legend', text: 'Repository Storage'
- check 'Create new projects using hashed storage paths'
- end
-
- def save_settings
- scroll_to '.form-actions' do
- click_button 'Save'
- end
- end
- end
- end
- end
-end
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
diff --git a/qa/qa/page/admin/settings/repo_storage.rb b/qa/qa/page/admin/settings/repo_storage.rb
new file mode 100644
index 00000000000..dc648c77abd
--- /dev/null
+++ b/qa/qa/page/admin/settings/repo_storage.rb
@@ -0,0 +1,33 @@
+module QA
+ module Page
+ module Admin
+ module Settings
+ class RepoStorage < Page::Base
+ view 'app/views/admin/application_settings/_repo_storage.html.haml' do
+ element :submit, "submit 'Save changes'"
+ element :hashed_storage,
+ 'Create new projects using hashed storage paths'
+ end
+
+ def enable_hashed_storage
+ within_repo_storage do
+ check 'Create new projects using hashed storage paths'
+ end
+ end
+
+ def save_settings
+ within_repo_storage do
+ click_button 'Save changes'
+ end
+ end
+
+ def within_repo_storage
+ page.within('.as-repo-storage') do
+ yield
+ end
+ end
+ end
+ end
+ end
+ end
+end