Skip to content

Commit

Permalink
[5055] use implicit waits to make sure we are good (#5069)
Browse files Browse the repository at this point in the history
* [5055] use implicit waits to make sure we are good

plus this will more explicitly tell us whats going on if this doesnt work

https://medium.com/doctolib/hunting-flaky-tests-2-waiting-for-ajax-bd76d79d9ee9

* two other places that attempt to do this

* fix formatting
  • Loading branch information
FeminismIsAwesome committed Jul 30, 2023
1 parent f757547 commit a11d9d7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions spec/system/notifications/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
end

it "lists followup notifications, showing their note" do
# Wait until page reloads
sleep(1)
expect(page).to have_content "Resolve Reminder"
within("#resolve", wait: 5) do
expect(page).to have_content "Resolve Reminder"
end

sign_in volunteer
visit notifications_path
Expand All @@ -92,9 +92,9 @@
end

it "lists followup notifications, showing the information in a single line when there are no notes" do
# Wait until page reloads
sleep(1)
expect(page).to have_content "Resolve Reminder"
within("#resolve", wait: 5) do
expect(page).to have_content "Resolve Reminder"
end

sign_in volunteer
visit notifications_path
Expand All @@ -111,13 +111,14 @@

before do
click_button "Make Reminder"
click_button "Confirm"
end

it "lists followup notifications showing admin current name" do
# Wait until page reloads
sleep(1)
expect(page).to have_content "Resolve Reminder"
click_button "Confirm"

within("#resolve", wait: 5) do
expect(page).to have_content "Resolve Reminder"
end

visit edit_users_path
fill_in "Display name", with: created_by_name
Expand Down

0 comments on commit a11d9d7

Please sign in to comment.