summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-10-02 15:40:52 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-10-02 15:40:52 +0000
commitbf37ff071fca1b61681e42522ffb6a6dcf5c0e8d (patch)
tree2c15145935bd341b44bb770a6d0c31f472596d4c /qa
parent6c30d9b4ede4152518fd3655e1862d54dfef6973 (diff)
parent182966312f88be877d290dd5606a8ab38efaf05c (diff)
downloadgitlab-ce-bf37ff071fca1b61681e42522ffb6a6dcf5c0e8d.tar.gz
Merge branch 'ce-7763-failure-in-geo-rb' into 'master'
[QA] Improve admin hashed-storage settings See merge request gitlab-org/gitlab-ce!22045
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb7
-rw-r--r--qa/qa/page/admin/settings/component/repository_storage.rb26
-rw-r--r--qa/qa/page/admin/settings/main.rb21
-rw-r--r--qa/qa/page/admin/settings/repository.rb23
-rw-r--r--qa/qa/page/admin/settings/repository_storage.rb23
-rw-r--r--qa/qa/page/base.rb8
-rw-r--r--qa/qa/page/menu/admin.rb36
-rw-r--r--qa/spec/page/validator_spec.rb2
8 files changed, 96 insertions, 50 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 952084085d5..227d4424b09 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -236,8 +236,11 @@ module QA
module Admin
module Settings
- autoload :RepositoryStorage, 'qa/page/admin/settings/repository_storage'
- autoload :Main, 'qa/page/admin/settings/main'
+ autoload :Repository, 'qa/page/admin/settings/repository'
+
+ module Component
+ autoload :RepositoryStorage, 'qa/page/admin/settings/component/repository_storage'
+ end
end
end
diff --git a/qa/qa/page/admin/settings/component/repository_storage.rb b/qa/qa/page/admin/settings/component/repository_storage.rb
new file mode 100644
index 00000000000..2ed0cd73aa3
--- /dev/null
+++ b/qa/qa/page/admin/settings/component/repository_storage.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Admin
+ module Settings
+ module Component
+ class RepositoryStorage < Page::Base
+ view 'app/views/admin/application_settings/_repository_storage.html.haml' do
+ element :hashed_storage_checkbox
+ element :save_changes_button
+ end
+
+ def enable_hashed_storage
+ check_element :hashed_storage_checkbox
+ end
+
+ def save_settings
+ click_element :save_changes_button
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/admin/settings/main.rb b/qa/qa/page/admin/settings/main.rb
deleted file mode 100644
index 73034ffe0d8..00000000000
--- a/qa/qa/page/admin/settings/main.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-module QA
- module Page
- module Admin
- module Settings
- class Main < Page::Base
- include QA::Page::Settings::Common
-
- view 'app/views/admin/application_settings/show.html.haml' do
- element :terms_settings
- end
-
- def expand_repository_storage(&block)
- expand_section(:terms_settings) do
- RepositoryStorage.perform(&block)
- end
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/page/admin/settings/repository.rb b/qa/qa/page/admin/settings/repository.rb
new file mode 100644
index 00000000000..b7f1deb21bd
--- /dev/null
+++ b/qa/qa/page/admin/settings/repository.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Admin
+ module Settings
+ class Repository < Page::Base
+ include QA::Page::Settings::Common
+
+ view 'app/views/admin/application_settings/repository.html.haml' do
+ element :repository_storage_settings
+ end
+
+ def expand_repository_storage(&block)
+ expand_section(:repository_storage_settings) do
+ Component::RepositoryStorage.perform(&block)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/admin/settings/repository_storage.rb b/qa/qa/page/admin/settings/repository_storage.rb
deleted file mode 100644
index 68dd23a41e1..00000000000
--- a/qa/qa/page/admin/settings/repository_storage.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-module QA
- module Page
- module Admin
- module Settings
- class RepositoryStorage < Page::Base
- view 'app/views/admin/application_settings/_repository_storage.html.haml' do
- element :submit, "submit 'Save changes'"
- element :hashed_storage,
- 'Use hashed storage paths for newly created and renamed projects'
- end
-
- def enable_hashed_storage
- check 'Use hashed storage paths for newly created and renamed projects'
- end
-
- def save_settings
- click_button 'Save changes'
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb
index a87536671c6..142707521df 100644
--- a/qa/qa/page/base.rb
+++ b/qa/qa/page/base.rb
@@ -68,6 +68,10 @@ module QA
all(element_selector_css(name))
end
+ def check_element(name)
+ find_element(name).set(true)
+ end
+
def click_element(name)
find_element(name).click
end
@@ -86,6 +90,10 @@ module QA
end
end
+ def scroll_to_element(name, *args)
+ scroll_to(element_selector_css(name), *args)
+ end
+
def element_selector_css(name)
Page::Element.new(name).selector_css
end
diff --git a/qa/qa/page/menu/admin.rb b/qa/qa/page/menu/admin.rb
index 573b98f7386..bf05a912bc6 100644
--- a/qa/qa/page/menu/admin.rb
+++ b/qa/qa/page/menu/admin.rb
@@ -3,11 +3,41 @@ module QA
module Menu
class Admin < Page::Base
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
- element :settings, "_('Settings')"
+ element :admin_sidebar
+ element :admin_sidebar_submenu
+ element :admin_settings_item
+ element :admin_settings_repository_item
end
- def go_to_settings
- click_link 'Settings'
+ def go_to_repository_settings
+ hover_settings do
+ within_submenu do
+ click_element :admin_settings_repository_item
+ end
+ end
+ end
+
+ private
+
+ def hover_settings
+ within_sidebar do
+ scroll_to_element(:admin_settings_item)
+ find_element(:admin_settings_item).hover
+
+ yield
+ end
+ end
+
+ def within_sidebar
+ within_element(:admin_sidebar) do
+ yield
+ end
+ end
+
+ def within_submenu
+ within_element(:admin_sidebar_submenu) do
+ yield
+ end
end
end
end
diff --git a/qa/spec/page/validator_spec.rb b/qa/spec/page/validator_spec.rb
index 55957649904..0ae6e66d767 100644
--- a/qa/spec/page/validator_spec.rb
+++ b/qa/spec/page/validator_spec.rb
@@ -30,7 +30,7 @@ describe QA::Page::Validator do
let(:view) { spy('view') }
before do
- allow(QA::Page::Admin::Settings::Main)
+ allow(QA::Page::Admin::Settings::Repository)
.to receive(:views).and_return([view])
end