Skip to content

Commit

Permalink
Merge pull request #5995 from solidusio/backport/v4.3/pr-5993
Browse files Browse the repository at this point in the history
[v4.3] test: Wait for modal to open before testing its content
  • Loading branch information
tvdeyen authored Dec 4, 2024
2 parents 9cb7825 + 35580a9 commit c33af58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions admin/spec/features/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
expect(page).to have_content("Order R123456789")
open_customer_menu
click_on "Edit billing address"
expect(page).to have_css("dialog", wait: 30)
expect(page).to have_css("dialog", wait: 5)

within("dialog") do
fill_in "Name", with: "John Doe"
Expand All @@ -74,7 +74,7 @@

open_customer_menu
click_on "Edit shipping address"
expect(page).to have_css("dialog", wait: 30)
expect(page).to have_css("dialog", wait: 5)

within("dialog") do
fill_in "Name", with: "Jane Doe"
Expand Down Expand Up @@ -119,18 +119,18 @@
expect(Spree::Order.last.line_items.count).to eq(0)

find("[aria-selected]", text: "Just another product").click
expect(page).to have_content("Variant added to cart successfully", wait: 30)
expect(page).to have_content("Variant added to cart successfully", wait: 5)

expect(Spree::Order.last.line_items.count).to eq(1)
expect(Spree::Order.last.line_items.last.quantity).to eq(1)

fill_in "line_item[quantity]", with: 4
expect(page).to have_content("Quantity updated successfully", wait: 30)
expect(page).to have_content("Quantity updated successfully", wait: 5)

expect(Spree::Order.last.line_items.last.quantity).to eq(4)

accept_confirm("Are you sure?") { click_on "Delete" }
expect(page).to have_content("Line item removed successfully", wait: 30)
expect(page).to have_content("Line item removed successfully", wait: 5)

expect(Spree::Order.last.line_items.count).to eq(0)
expect(page).to be_axe_clean
Expand Down
8 changes: 4 additions & 4 deletions admin/spec/features/promotions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
visit "/admin/promotions"
expect(page).to have_content("My active Promotion")
click_on "Draft"
expect(page).to have_content("My draft Promotion", wait: 30)
expect(page).to have_content("My draft Promotion", wait: 5)
click_on "Future"
expect(page).to have_content("My future Promotion", wait: 30)
expect(page).to have_content("My future Promotion", wait: 5)
click_on "Expired"
expect(page).to have_content("My expired Promotion", wait: 30)
expect(page).to have_content("My expired Promotion", wait: 5)
click_on "All"
expect(page).to have_content("My active Promotion", wait: 30)
expect(page).to have_content("My active Promotion", wait: 5)
expect(page).to have_content("My draft Promotion")
expect(page).to have_content("My future Promotion")
expect(page).to have_content("My expired Promotion")
Expand Down

0 comments on commit c33af58

Please sign in to comment.