Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4.3] test: Wait for modal to open before testing its content #5995

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading