Commit 9cd5555e authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Ramya Authappan

E2E: Search member before performing the next action

parent e865eea7
...@@ -151,6 +151,7 @@ export default { ...@@ -151,6 +151,7 @@ export default {
:search-input-placeholder="filteredSearchBar.placeholder" :search-input-placeholder="filteredSearchBar.placeholder"
:initial-filter-value="initialFilterValue" :initial-filter-value="initialFilterValue"
data-testid="members-filtered-search-bar" data-testid="members-filtered-search-bar"
data-qa-selector="members_filtered_search_bar_content"
@onFilter="handleFilter" @onFilter="handleFilter"
/> />
</template> </template>
# frozen_string_literal: true
module QA
module Page
module Component
module MembersFilter
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue' do
element :members_filtered_search_bar_content
end
end
def search_member(username)
# TODO: Update the two actions below to use direct qa selectors once this is implemented:
# https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1688
find_element(:members_filtered_search_bar_content).find('input').set(username)
find('.gl-search-box-by-click-search-button').click
end
end
end
end
end
...@@ -6,6 +6,7 @@ module QA ...@@ -6,6 +6,7 @@ module QA
class Members < Page::Base class Members < Page::Base
include Page::Component::InviteMembersModal include Page::Component::InviteMembersModal
include Page::Component::UsersSelect include Page::Component::UsersSelect
include Page::Component::MembersFilter
view 'app/assets/javascripts/members/components/modals/remove_member_modal.vue' do view 'app/assets/javascripts/members/components/modals/remove_member_modal.vue' do
element :remove_member_modal_content element :remove_member_modal_content
...@@ -31,6 +32,8 @@ module QA ...@@ -31,6 +32,8 @@ module QA
end end
def update_access_level(username, access_level) def update_access_level(username, access_level)
search_member(username)
within_element(:member_row, text: username) do within_element(:member_row, text: username) do
click_element :access_level_dropdown click_element :access_level_dropdown
click_element :access_level_link, text: access_level click_element :access_level_link, text: access_level
......
...@@ -5,6 +5,7 @@ module QA ...@@ -5,6 +5,7 @@ module QA
module Project module Project
class Members < Page::Base class Members < Page::Base
include QA::Page::Component::InviteMembersModal include QA::Page::Component::InviteMembersModal
include QA::Page::Component::MembersFilter
view 'app/assets/javascripts/members/components/members_tabs.vue' do view 'app/assets/javascripts/members/components/members_tabs.vue' do
element :groups_list_tab element :groups_list_tab
......
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
RSpec.describe 'Manage', :requires_admin, quarantine: { RSpec.describe 'Manage', :requires_admin do
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/350598',
type: :needs_update,
only: { subdomain: :staging }
} do
describe 'Add project member' do describe 'Add project member' do
before do before do
Runtime::Feature.enable(:invite_members_group_modal) Runtime::Feature.enable(:invite_members_group_modal)
...@@ -25,7 +21,7 @@ module QA ...@@ -25,7 +21,7 @@ module QA
Page::Project::Menu.perform(&:click_members) Page::Project::Menu.perform(&:click_members)
Page::Project::Members.perform do |members| Page::Project::Members.perform do |members|
members.add_member(user.username) members.add_member(user.username)
members.search_member(user.username)
expect(members).to have_content("@#{user.username}") expect(members).to have_content("@#{user.username}")
end end
end end
......
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