diff --git a/spec/features/admin/manage_workshop_attendances_spec.rb b/spec/features/admin/manage_workshop_attendances_spec.rb index 722ae4c48..ffa3b1a4b 100644 --- a/spec/features/admin/manage_workshop_attendances_spec.rb +++ b/spec/features/admin/manage_workshop_attendances_spec.rb @@ -50,8 +50,8 @@ expect(page).to have_content('1 are attending as students') expect(page).to_not have_selector('i.fa-magic') - find('span', text: 'Select a member to RSVP', visible: true).click - find('li', text: "#{other_invitation.member.full_name} (#{other_invitation.role})", visible: true).click + # Use the select_from_chosen helper to select the member + select_from_chosen("#{other_invitation.member.full_name} (#{other_invitation.role})", from: 'workshop_invitations') expect(page).to have_content('2 are attending as students') diff --git a/spec/features/member_feedback_spec.rb b/spec/features/member_feedback_spec.rb index fe3d0786e..a9dbbdf96 100644 --- a/spec/features/member_feedback_spec.rb +++ b/spec/features/member_feedback_spec.rb @@ -59,6 +59,11 @@ context 'Submitting a feedback request' do scenario 'I can see success page with message and link to homepage when valid data is given', js: true do visit feedback_path(valid_token) + + # Wait for Chosen dropdowns to initialize + expect(page).to have_css('#feedback_coach_id_chosen') + expect(page).to have_css('#feedback_tutorial_id_chosen') + within('.rating') { all('li').at(3).click } select_from_chosen(coach.full_name, from: 'feedback_coach_id') select_from_chosen(@tutorial.title, from: 'feedback_tutorial_id') diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index c0e82b45c..c0659aacf 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -15,3 +15,4 @@ end Capybara.javascript_driver = :chrome +Capybara.default_max_wait_time = 5 diff --git a/spec/support/select_from_chosen.rb b/spec/support/select_from_chosen.rb index 3581b3a72..0eb1a383f 100644 --- a/spec/support/select_from_chosen.rb +++ b/spec/support/select_from_chosen.rb @@ -10,15 +10,19 @@ module SelectFromChosen def select_from_chosen(item_text, options) # Find the native