2021-01-29 00:20:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
module Features
|
|
|
|
module MembersHelpers
|
|
|
|
def members_table
|
|
|
|
page.find('[data-testid="members-table"]')
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def all_rows
|
|
|
|
page.within(members_table) do
|
|
|
|
page.all('tbody > tr')
|
|
|
|
end
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def first_row
|
|
|
|
all_rows[0]
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def second_row
|
|
|
|
all_rows[1]
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def third_row
|
|
|
|
all_rows[2]
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def find_row(name)
|
|
|
|
page.within(members_table) do
|
|
|
|
page.find('tbody > tr', text: name)
|
|
|
|
end
|
|
|
|
end
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def find_member_row(user)
|
|
|
|
find_row(user.name)
|
|
|
|
end
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def find_username_row(user)
|
|
|
|
find_row(user.username)
|
|
|
|
end
|
2021-12-07 22:27:20 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def find_invited_member_row(email)
|
|
|
|
find_row(email)
|
|
|
|
end
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def find_group_row(group)
|
|
|
|
find_row(group.full_name)
|
|
|
|
end
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def fill_in_filtered_search(label, with:)
|
|
|
|
page.within '[data-testid="members-filtered-search-bar"]' do
|
|
|
|
find_field(label).click
|
|
|
|
find('input').native.send_keys(with)
|
|
|
|
click_button 'Search'
|
|
|
|
end
|
|
|
|
end
|
2023-03-17 16:20:25 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def user_action_dropdown
|
|
|
|
'[data-testid="user-action-dropdown"]'
|
|
|
|
end
|
2023-03-17 16:20:25 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def show_actions
|
|
|
|
within user_action_dropdown do
|
|
|
|
find('button').click
|
|
|
|
end
|
|
|
|
end
|
2023-03-17 16:20:25 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def show_actions_for_username(user)
|
|
|
|
within find_username_row(user) do
|
|
|
|
show_actions
|
2021-01-29 00:20:46 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|