diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-22 18:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-22 18:09:28 +0300 |
commit | d1cb802bac5dc182342adb9b8f71dbf466cfa501 (patch) | |
tree | 9dc47ce978df2b05a973555a88a1f0b835f4645f /qa | |
parent | 2c171fdd723a6a1f45dedd12e62f93745318b40e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/dashboard/projects.rb | 11 | ||||
-rw-r--r-- | qa/qa/page/group/members.rb | 81 | ||||
-rw-r--r-- | qa/qa/page/group/sub_menus/members.rb | 51 | ||||
-rw-r--r-- | qa/qa/page/main/menu.rb | 15 | ||||
-rw-r--r-- | qa/qa/page/search/results.rb | 4 |
6 files changed, 110 insertions, 54 deletions
@@ -208,6 +208,7 @@ module QA autoload :New, 'qa/page/group/new' autoload :Show, 'qa/page/group/show' autoload :Menu, 'qa/page/group/menu' + autoload :Members, 'qa/page/group/members' module Milestone autoload :Index, 'qa/page/group/milestone/index' @@ -216,7 +217,6 @@ module QA module SubMenus autoload :Common, 'qa/page/group/sub_menus/common' - autoload :Members, 'qa/page/group/sub_menus/members' end module Settings diff --git a/qa/qa/page/dashboard/projects.rb b/qa/qa/page/dashboard/projects.rb index c103bc26a36..b9e2383a3eb 100644 --- a/qa/qa/page/dashboard/projects.rb +++ b/qa/qa/page/dashboard/projects.rb @@ -8,6 +8,17 @@ module QA element :project_filter_form, required: true end + view 'app/views/shared/projects/_project.html.haml' do + element :project_content + element :user_role_content + end + + def has_project_with_access_role?(project_name, access_role) + within_element(:project_content, text: project_name) do + has_element?(:user_role_content, text: access_role) + end + end + def go_to_project(name) filter_by_name(name) diff --git a/qa/qa/page/group/members.rb b/qa/qa/page/group/members.rb new file mode 100644 index 00000000000..20caa7e839f --- /dev/null +++ b/qa/qa/page/group/members.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module QA + module Page + module Group + class Members < Page::Base + include QA::Page::Component::Select2 + include Page::Component::UsersSelect + + view 'app/assets/javascripts/vue_shared/components/remove_member_modal.vue' do + element :remove_member_modal_content + end + + view 'app/views/shared/members/_invite_member.html.haml' do + element :member_select_field + element :invite_member_button + end + + view 'app/views/shared/members/_member.html.haml' do + element :member_row + element :access_level_dropdown + element :delete_member_button + element :developer_access_level_link, 'qa_selector: "#{role.downcase}_access_level_link"' # rubocop:disable QA/ElementWithPattern, Lint/InterpolationCheck + end + + view 'app/views/groups/group_members/index.html.haml' do + element :invite_group_tab + element :groups_list + end + + view 'app/views/shared/members/_invite_group.html.haml' do + element :group_select_field + element :invite_group_button + end + + view 'app/views/shared/members/_group.html.haml' do + element :group_row + end + + def select_group(group_name) + click_element :group_select_field + search_and_select(group_name) + end + + def invite_group(group_name) + click_element :invite_group_tab + select_group(group_name) + click_element :invite_group_button + end + + def add_member(username) + select_user :member_select_field, username + click_element :invite_member_button + end + + def update_access_level(username, access_level) + within_element(:member_row, text: username) do + click_element :access_level_dropdown + click_element "#{access_level.downcase}_access_level_link" + end + end + + def remove_member(username) + within_element(:member_row, text: username) do + click_element :delete_member_button + end + + within_element(:remove_member_modal_content) do + click_button("Remove member") + end + end + + def has_existing_group_share?(group_name) + within_element(:groups_list) do + has_element?(:group_row, text: group_name) + end + end + end + end + end +end diff --git a/qa/qa/page/group/sub_menus/members.rb b/qa/qa/page/group/sub_menus/members.rb deleted file mode 100644 index 895da639c02..00000000000 --- a/qa/qa/page/group/sub_menus/members.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -module QA - module Page - module Group - module SubMenus - class Members < Page::Base - include Page::Component::UsersSelect - - view 'app/assets/javascripts/vue_shared/components/remove_member_modal.vue' do - element :remove_member_modal_content - end - - view 'app/views/shared/members/_invite_member.html.haml' do - element :member_select_field - element :invite_member_button - end - - view 'app/views/shared/members/_member.html.haml' do - element :member_row - element :access_level_dropdown - element :delete_member_button - element :developer_access_level_link, 'qa_selector: "#{role.downcase}_access_level_link"' # rubocop:disable QA/ElementWithPattern, Lint/InterpolationCheck - end - - def add_member(username) - select_user :member_select_field, username - click_element :invite_member_button - end - - def update_access_level(username, access_level) - within_element(:member_row, text: username) do - click_element :access_level_dropdown - click_element "#{access_level.downcase}_access_level_link" - end - end - - def remove_member(username) - within_element(:member_row, text: username) do - click_element :delete_member_button - end - - within_element(:remove_member_modal_content) do - click_button("Remove member") - end - end - end - end - end - end -end diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb index 416946f44f0..9c63ddee890 100644 --- a/qa/qa/page/main/menu.rb +++ b/qa/qa/page/main/menu.rb @@ -14,6 +14,9 @@ module QA element :user_avatar, required: true element :user_menu, required: true element :stop_impersonation_link + element :issues_shortcut_button, required: true + element :merge_requests_shortcut_button, required: true + element :todos_shortcut_button, required: true end view 'app/views/layouts/nav/_dashboard.html.haml' do @@ -63,6 +66,18 @@ module QA end end + # To go to one of the popular pages using the provided shortcut buttons within top menu + # @param [Symbol] the name of the element (e.g: `:issues_shortcut button`) + # @example: + # Menu.perform do |menu| + # menu.go_to_page_by_shortcut(:issues_shortcut_button) #=> Go to Issues page using shortcut button + # end + def go_to_page_by_shortcut(button) + within_top_menu do + click_element(button) + end + end + def go_to_admin_area click_admin_area diff --git a/qa/qa/page/search/results.rb b/qa/qa/page/search/results.rb index 55477db8804..3f7aa837d3c 100644 --- a/qa/qa/page/search/results.rb +++ b/qa/qa/page/search/results.rb @@ -16,7 +16,7 @@ module QA end view 'app/views/shared/projects/_project.html.haml' do - element :project + element :project_content end def switch_to_code @@ -40,7 +40,7 @@ module QA end def has_project?(project_name) - has_element?(:project, project_name: project_name) + has_element?(:project_content, project_name: project_name) end private |