summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-01-29 23:46:45 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-01-29 23:46:45 +0800
commitbf01452cc361842dab7442a9ad868213d53bd212 (patch)
treed9a9660c41029f21b47880ae8d98dce1cf6ce203
parent229785d5d40470d702b1d9311c740e44ba77a83d (diff)
downloadgitlab-ce-bf01452cc361842dab7442a9ad868213d53bd212.tar.gz
Define selectors and remove EE only code
-rw-r--r--qa/qa/page/admin/settings.rb13
-rw-r--r--qa/qa/page/group/show.rb52
-rw-r--r--qa/qa/page/menu/admin.rb11
3 files changed, 42 insertions, 34 deletions
diff --git a/qa/qa/page/admin/settings.rb b/qa/qa/page/admin/settings.rb
index 1904732aee6..1f646103e7f 100644
--- a/qa/qa/page/admin/settings.rb
+++ b/qa/qa/page/admin/settings.rb
@@ -2,12 +2,13 @@ module QA
module Page
module Admin
class Settings < Page::Base
- ##
- # TODO, define all selectors required by this page object
- #
- # See gitlab-org/gitlab-qa#154
- #
- view 'app/views/admin/application_settings/show.html.haml'
+ 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'
diff --git a/qa/qa/page/group/show.rb b/qa/qa/page/group/show.rb
index f23294145dd..ac1fd9b5f90 100644
--- a/qa/qa/page/group/show.rb
+++ b/qa/qa/page/group/show.rb
@@ -2,12 +2,25 @@ module QA
module Page
module Group
class Show < Page::Base
- ##
- # TODO, define all selectors required by this page object
- #
- # See gitlab-org/gitlab-qa#154
- #
- view 'app/views/groups/show.html.haml'
+ view 'app/views/groups/show.html.haml' do
+ element :dropdown_toggle, '.dropdown-toggle'
+ element :new_project_subgroup, '.new-project-subgroup'
+
+ element :new_project_toggle,
+ /%li.+ data: { value: "new\-project"/
+ element :new_project_button,
+ /%input.+ data: { action: "new\-project"/
+
+ element :new_subgroup_toggle,
+ /%li.+ data: { value: "new\-subgroup"/
+ # TODO: input[data-action='new-subgroup'] seems to be handled by JS?
+ # See app/assets/javascripts/groups/new_group_child.js
+ end
+
+ view 'app/views/shared/groups/_search_form.html.haml' do
+ element :filter_by_name,
+ "placeholder: s_('GroupsTree|Filter by name...')"
+ end
def go_to_subgroup(name)
click_link name
@@ -24,31 +37,32 @@ module QA
end
def go_to_new_subgroup
- within '.new-project-subgroup' do
- # 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
+ click_new('subgroup')
find("input[data-action='new-subgroup']").click
end
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
+ 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
wait(reload: false) do
find('.dropdown-toggle').click
- page.has_css?("li[data-value='new-project']")
+ page.has_css?(css)
end
- find("li[data-value='new-project']").click
- end
- find("input[data-action='new-project']").click
+ find(css).click
+ end
end
end
end
diff --git a/qa/qa/page/menu/admin.rb b/qa/qa/page/menu/admin.rb
index 40da4a53e8a..573b98f7386 100644
--- a/qa/qa/page/menu/admin.rb
+++ b/qa/qa/page/menu/admin.rb
@@ -2,15 +2,8 @@ module QA
module Page
module Menu
class Admin < Page::Base
- ##
- # 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_license
- click_link 'License'
+ view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
+ element :settings, "_('Settings')"
end
def go_to_settings