Open stephendolan opened 3 years ago
Here's the relevant expectation class https://github.com/luckyframework/lucky_flow/blob/ff7c22d3c72365ededf7bc677669ed95264c2f37/src/lucky_flow/expectations/have_current_path_expectation.cr#L1
My only guess is that there's a delay in the current_path so that when it's checked it's different than when the failure message is made but that seems like it would need a fair amount of delay between the two
Thanks, @matthewmcgarvey! I'm going to try a few things to see if I can get this to happen locally. Until then I'd just be taking shots in the dark in a PR.
I at least wanted to make sure we had an issue in case folks came searching for the same problem, though :)
I got the exact same error locally. My flow/spec had this:
visit Categories::Show.with(category_id: @category.id), as: @user
click "@delete-category"
accept_alert
should have_current_path(Categories::Index)
Add added a sleep to get it to work.
visit Categories::Show.with(category_id: @category.id), as: @user
click "@delete-category"
accept_alert
sleep 0.001
should have_current_path(Categories::Index)
Not sure if there might be a more elegant solution, but perhaps this helps, so we can add a fix to the framework? I think I might work with a shorter sleep too.
I'm currently leveraging LuckyFlow to test the entirety of https://luckycasts.com
I've never had an issue in my development environment, but in GitHub Actions I continue to get random tests that will fail with content like this:
If I re-run the job, everything is fine and the test passes without any changes.
Here's that spec code:
Here's the relevant GitHub workflow definition parts: