Skip to content

Commit

Permalink
Try upping Capybara wait time for flaky test
Browse files Browse the repository at this point in the history
Connected to #4511
  • Loading branch information
maxkadel committed Nov 6, 2024
1 parent 524a98d commit 8728b67
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions spec/features/requests/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -863,23 +863,25 @@
expect(page).to have_button('Request Selected Items', disabled: true)
end
it 'unchecking an item when there is another valid item leaves the submit button enabled' do
visit 'requests/9935076973506421?aeon=false&mfhd=22579150960006421'

first_row = page.all('tr[id^=request_]')[0]
second_row = page.all('tr[id^=request_]')[1]
expect(page).to have_content 'Dirāsāt'
expect(page).to have_content 'Jāmiʻah al-Urdunīyah'
expect(page).to have_content 'mujallad 26 1999'
expect(page).to have_button('Request Selected Items', disabled: true)
first_row.check('requestable_selected')
first_row.choose('requestable__delivery_mode_22579150960006421_print')
second_row.check('requestable_selected_23579150920006421')
second_row.choose('requestable__delivery_mode_23579150920006421_print')
expect(page).to have_button('Request Selected Items', disabled: false)
first_row.uncheck('requestable_selected')
expect(page).to have_button('Request Selected Items', disabled: false)
second_row.uncheck('requestable_selected_23579150920006421')
expect(page).to have_button('Request Selected Items', disabled: true)
Capybara.using_wait_time(10) do
visit 'requests/9935076973506421?aeon=false&mfhd=22579150960006421'

first_row = page.all('tr[id^=request_]')[0]
second_row = page.all('tr[id^=request_]')[1]
expect(page).to have_content 'Dirāsāt'
expect(page).to have_content 'Jāmiʻah al-Urdunīyah'
expect(page).to have_content 'mujallad 26 1999'
expect(page).to have_button('Request Selected Items', disabled: true)
first_row.check('requestable_selected')
first_row.choose('requestable__delivery_mode_22579150960006421_print')
second_row.check('requestable_selected_23579150920006421')
second_row.choose('requestable__delivery_mode_23579150920006421_print')
expect(page).to have_button('Request Selected Items', disabled: false)
first_row.uncheck('requestable_selected')
expect(page).to have_button('Request Selected Items', disabled: false)
second_row.uncheck('requestable_selected_23579150920006421')
expect(page).to have_button('Request Selected Items', disabled: true)
end
end
end

Expand Down

0 comments on commit 8728b67

Please sign in to comment.