Commit 7ffe28eb authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'qa-define-selectors-ee' into 'master'

EE: Define QA selectors and remove EE only code

See merge request gitlab-org/gitlab-ee!4303
parents cdefac3a 16dd5a02
...@@ -4,6 +4,10 @@ module QA ...@@ -4,6 +4,10 @@ module QA
# #
module EE module EE
module Page module Page
module Menu
autoload :Admin, 'qa/ee/page/menu/admin'
end
module Admin module Admin
autoload :License, 'qa/ee/page/admin/license' autoload :License, 'qa/ee/page/admin/license'
......
module QA
module EE
module Page
module Menu
module Admin
def self.prepended(page)
page.module_eval do
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :license, "_('License')"
element :geo_node, "_('Geo Nodes')"
end
end
end
def go_to_geo_nodes
click_link 'Geo Nodes'
end
def go_to_license
click_link 'License'
end
end
end
end
end
end
...@@ -2,12 +2,13 @@ module QA ...@@ -2,12 +2,13 @@ module QA
module Page module Page
module Admin module Admin
class Settings < Page::Base class Settings < Page::Base
## view 'app/views/admin/application_settings/_form.html.haml' do
# TODO, define all selectors required by this page object element :form_actions, '.form-actions'
# element :submit, "submit 'Save'"
# See gitlab-org/gitlab-qa#154 element :repository_storage, '%legend Repository Storage'
# element :hashed_storage,
view 'app/views/admin/application_settings/show.html.haml' 'Create new projects using hashed storage paths'
end
def enable_hashed_storage def enable_hashed_storage
scroll_to 'legend', text: 'Repository Storage' scroll_to 'legend', text: 'Repository Storage'
......
...@@ -28,31 +28,32 @@ module QA ...@@ -28,31 +28,32 @@ module QA
end end
def go_to_new_subgroup def go_to_new_subgroup
within '.new-project-subgroup' do click_new('subgroup')
# May need to click again because it is possible to click the button quicker than the JS is bound
wait(reload: false) do
find('.dropdown-toggle').click
page.has_css?("li[data-value='new-subgroup']")
end
find("li[data-value='new-subgroup']").click
end
find("input[data-action='new-subgroup']").click find("input[data-action='new-subgroup']").click
end end
def go_to_new_project def go_to_new_project
click_new('project')
find("input[data-action='new-project']").click
end
private
def click_new(kind)
within '.new-project-subgroup' do within '.new-project-subgroup' do
css = "li[data-value='new-#{kind}']"
# May need to click again because it is possible to click the button quicker than the JS is bound # May need to click again because it is possible to click the button quicker than the JS is bound
wait(reload: false) do wait(reload: false) do
find('.dropdown-toggle').click find('.dropdown-toggle').click
page.has_css?("li[data-value='new-project']") page.has_css?(css)
end end
find("li[data-value='new-project']").click
end
find("input[data-action='new-project']").click find(css).click
end
end end
end end
end end
......
...@@ -2,19 +2,10 @@ module QA ...@@ -2,19 +2,10 @@ module QA
module Page module Page
module Menu module Menu
class Admin < Page::Base class Admin < Page::Base
## prepend EE::Page::Menu::Admin
# TODO, define all selectors required by this page object
#
# See gitlab-org/gitlab-qa#154
#
view 'app/views/admin/dashboard/index.html.haml'
def go_to_geo_nodes view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
click_link 'Geo Nodes' element :settings, "_('Settings')"
end
def go_to_license
click_link 'License'
end end
def go_to_settings def go_to_settings
......
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