diff options
Diffstat (limited to 'spec/support/helpers/features/members_helpers.rb')
-rw-r--r-- | spec/support/helpers/features/members_helpers.rb | 114 |
1 files changed, 54 insertions, 60 deletions
diff --git a/spec/support/helpers/features/members_helpers.rb b/spec/support/helpers/features/members_helpers.rb index 2d3f0902a3c..9882767cecf 100644 --- a/spec/support/helpers/features/members_helpers.rb +++ b/spec/support/helpers/features/members_helpers.rb @@ -1,78 +1,72 @@ # frozen_string_literal: true -module Spec - module Support - module Helpers - module Features - module MembersHelpers - def members_table - page.find('[data-testid="members-table"]') - end +module Features + module MembersHelpers + def members_table + page.find('[data-testid="members-table"]') + end - def all_rows - page.within(members_table) do - page.all('tbody > tr') - end - end + def all_rows + page.within(members_table) do + page.all('tbody > tr') + end + end - def first_row - all_rows[0] - end + def first_row + all_rows[0] + end - def second_row - all_rows[1] - end + def second_row + all_rows[1] + end - def third_row - all_rows[2] - end + def third_row + all_rows[2] + end - def find_row(name) - page.within(members_table) do - page.find('tbody > tr', text: name) - end - end + def find_row(name) + page.within(members_table) do + page.find('tbody > tr', text: name) + end + end - def find_member_row(user) - find_row(user.name) - end + def find_member_row(user) + find_row(user.name) + end - def find_username_row(user) - find_row(user.username) - end + def find_username_row(user) + find_row(user.username) + end - def find_invited_member_row(email) - find_row(email) - end + def find_invited_member_row(email) + find_row(email) + end - def find_group_row(group) - find_row(group.full_name) - end + def find_group_row(group) + find_row(group.full_name) + end - 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 + 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 - def user_action_dropdown - '[data-testid="user-action-dropdown"]' - end + def user_action_dropdown + '[data-testid="user-action-dropdown"]' + end - def show_actions - within user_action_dropdown do - find('button').click - end - end + def show_actions + within user_action_dropdown do + find('button').click + end + end - def show_actions_for_username(user) - within find_username_row(user) do - show_actions - end - end - end + def show_actions_for_username(user) + within find_username_row(user) do + show_actions end end end |