Skip to content

Commit

Permalink
Increment wait time for test
Browse files Browse the repository at this point in the history
  • Loading branch information
crmne committed Dec 28, 2024
1 parent 586ac73 commit 6947b30
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/system/headache_logs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,25 @@ class HeadacheLogsTest < ApplicationSystemTestCase

# Visit the headache logs page
visit headache_logs_url

# Verify we see the "Ongoing" status
assert_text "Ongoing"

# Click through to edit the log
click_on "Update Log"
assert_current_path edit_headache_log_path(log)

# Fill in the end time with current time
end_time = Time.current + 12.hours
fill_in "End Time", with: end_time.strftime("%Y-%m-%dT%H:%M")
end_time = Time.current.strftime("%Y-%m-%dT%H:%M")
fill_in "End Time", with: end_time

# Ensure we click the right button and wait for the update
# Submit and wait for the success path
click_button "Update Headache log"

# Add explicit assertion for successful navigation
assert_current_path headache_log_path(log)

# Now check for success message and status change
assert_text "Headache log was successfully updated"
assert_no_text "Ongoing Headache"
# Use Capybara's built-in waiting mechanism
using_wait_time(5) do # Increase default wait time for this block
assert_current_path headache_log_path(log)
assert_text "Headache log was successfully updated"
assert_no_text "Ongoing Headache"
end
end

test "filtering headache logs" do
Expand Down

0 comments on commit 6947b30

Please sign in to comment.