Skip to content

Commit 743e50f

Browse files
committed
Fix: update failing manage_workshop_attendances test
The test passed locally but not on Github. . The test on github is still experiencing a conflict between the dropdown and the h4 title behind the dropdown. This fix adds a retry mechanism
1 parent c14573b commit 743e50f

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

spec/features/admin/manage_workshop_attendances_spec.rb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require 'spec_helper'
22

33
RSpec.feature 'managing workshop attendances', type: :feature do
4+
MAX_RETRIES = 3
5+
46
context 'an admin' do
57
let(:member) { Fabricate(:member) }
68
let(:chapter) { Fabricate(:chapter) }
@@ -52,11 +54,19 @@
5254

5355
dropdown_text = 'Select a member to RSVP'
5456
dropdown = find('span', text: dropdown_text, visible: true)
55-
if dropdown.visible?
56-
begin
57-
dropdown.click
58-
rescue Selenium::WebDriver::Error::ElementClickInterceptedError
59-
puts "Dropdown is visible but cannot be clicked."
57+
58+
attempts = 0
59+
60+
begin
61+
dropdown.click
62+
rescue Selenium::WebDriver::Error::ElementClickInterceptedError
63+
attempts += 1
64+
puts "Attempt #{attempts}: Dropdown is visible but not clickable. Retrying..."
65+
if attempts < MAX_RETRIES
66+
sleep 0.5
67+
retry
68+
else
69+
raise "Dropdown could not be clicked after #{max_attempts} attempts"
6070
end
6171
end
6272

0 commit comments

Comments
 (0)