Skip to content

Commit 59e254a

Browse files
Fix flaky add to cart actions in feature test
Clicking links and then immediately navigating to another page before the previous link resolves creates a race condition which causes flaky tests.
1 parent 0b67290 commit 59e254a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

templates/spec/system/promotion_code_invalidation_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@
1919

2020
visit products_path
2121
click_link "DL-44"
22+
expect(page).to have_content("As seen on TV!")
2223
click_button "Add To Cart"
24+
expect(page).to have_content("Shopping Cart")
2325

2426
visit products_path
2527
click_link "E-11"
28+
expect(page).to have_content("As seen on TV!")
2629
click_button "Add To Cart"
2730
end
2831

0 commit comments

Comments
 (0)