diff options
Diffstat (limited to 'spec/support/helpers/features')
-rw-r--r-- | spec/support/helpers/features/invite_members_modal_helper.rb | 12 | ||||
-rw-r--r-- | spec/support/helpers/features/top_nav_spec_helpers.rb | 24 |
2 files changed, 15 insertions, 21 deletions
diff --git a/spec/support/helpers/features/invite_members_modal_helper.rb b/spec/support/helpers/features/invite_members_modal_helper.rb index 7b8cd6963c0..69ba20c1ca4 100644 --- a/spec/support/helpers/features/invite_members_modal_helper.rb +++ b/spec/support/helpers/features/invite_members_modal_helper.rb @@ -5,7 +5,7 @@ module Spec module Helpers module Features module InviteMembersModalHelper - def invite_member(name, role: 'Guest', expires_at: nil) + def invite_member(name, role: 'Guest', expires_at: nil, area_of_focus: false) click_on 'Invite members' page.within '#invite-members-modal' do @@ -14,6 +14,7 @@ module Spec wait_for_requests click_button name choose_options(role, expires_at) + choose_area_of_focus if area_of_focus click_button 'Invite' @@ -41,7 +42,14 @@ module Spec click_button role end - fill_in 'YYYY-MM-DD', with: expires_at.try(:strftime, '%Y-%m-%d') + fill_in 'YYYY-MM-DD', with: expires_at.strftime('%Y-%m-%d') if expires_at + end + + def choose_area_of_focus + page.within '[data-testid="area-of-focus-checks"]' do + check 'Contribute to the codebase' + check 'Collaborate on open issues and merge requests' + end end end end diff --git a/spec/support/helpers/features/top_nav_spec_helpers.rb b/spec/support/helpers/features/top_nav_spec_helpers.rb index 87ed897ec74..de495eceabc 100644 --- a/spec/support/helpers/features/top_nav_spec_helpers.rb +++ b/spec/support/helpers/features/top_nav_spec_helpers.rb @@ -8,38 +8,24 @@ module Spec module Features module TopNavSpecHelpers def open_top_nav - return unless Feature.enabled?(:combined_menu, default_enabled: :yaml) - find('.js-top-nav-dropdown-toggle').click end def within_top_nav - if Feature.enabled?(:combined_menu, default_enabled: :yaml) - within('.js-top-nav-dropdown-menu') do - yield - end - else - within('.navbar-sub-nav') do - yield - end + within('.js-top-nav-dropdown-menu') do + yield end end def open_top_nav_projects - if Feature.enabled?(:combined_menu, default_enabled: :yaml) - open_top_nav + open_top_nav - within_top_nav do - click_button('Projects') - end - else - find('#nav-projects-dropdown').click + within_top_nav do + click_button('Projects') end end def open_top_nav_groups - return unless Feature.enabled?(:combined_menu, default_enabled: :yaml) - open_top_nav within_top_nav do |