From c1b5ad275e118d56657ff74db732f5a393c59b2f Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 3 Dec 2024 17:10:22 +0100 Subject: [PATCH] test: Do not wait 30 seconds for a test to fail If the modal cannot be openend after 5 seconds (Capybara default wait tiem is 3 seconds) then something is wrong. We must not waste precious resources and time for a buld to fail. (cherry picked from commit 7112488c7e83a3137edba403e9ebc873f230ffec) --- admin/spec/features/orders/show_spec.rb | 10 +++++----- .../spec/features/solidus_admin/promotions_spec.rb | 8 ++++---- .../system/solidus_promotions/admin/promotions_spec.rb | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/admin/spec/features/orders/show_spec.rb b/admin/spec/features/orders/show_spec.rb index 7b8aebd5479..986acbac250 100644 --- a/admin/spec/features/orders/show_spec.rb +++ b/admin/spec/features/orders/show_spec.rb @@ -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" @@ -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" @@ -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 diff --git a/legacy_promotions/spec/features/solidus_admin/promotions_spec.rb b/legacy_promotions/spec/features/solidus_admin/promotions_spec.rb index 16f1439ace7..922846e2a51 100644 --- a/legacy_promotions/spec/features/solidus_admin/promotions_spec.rb +++ b/legacy_promotions/spec/features/solidus_admin/promotions_spec.rb @@ -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") diff --git a/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb b/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb index b49bbd94d37..85caf2af6c8 100644 --- a/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb +++ b/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb @@ -14,13 +14,13 @@ visit "/admin/solidus/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")