From a25a62ab36eaed7cb96a6179410e94f2edd2ffb7 Mon Sep 17 00:00:00 2001 From: Madeline Collier Date: Wed, 4 Dec 2024 09:40:32 +0100 Subject: [PATCH] Wait for modal before testing its content Building off of https://github.com/solidusio/solidus/pull/5993, a few more specs required a short wait time to give the modal a chance to load. They were flaky (failing somewhat regularly in CI, but always passing locally) and this should help remedy that. --- admin/spec/features/refund_reasons_spec.rb | 4 ++-- admin/spec/features/shipping_categories_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/spec/features/refund_reasons_spec.rb b/admin/spec/features/refund_reasons_spec.rb index cb15326417..1f5fe245df 100644 --- a/admin/spec/features/refund_reasons_spec.rb +++ b/admin/spec/features/refund_reasons_spec.rb @@ -26,7 +26,7 @@ before do visit "/admin/refund_reasons/#{query}" click_on "Add new" - expect(page).to have_selector("dialog") + expect(page).to have_css("dialog", wait: 5) expect(page).to have_content("New Refund Reason") expect(page).to be_axe_clean end @@ -66,7 +66,7 @@ Spree::RefundReason.create(name: "Return process") visit "/admin/refund_reasons#{query}" find_row("Return process").click - expect(page).to have_selector("dialog") + expect(page).to have_css("dialog", wait: 5) expect(page).to have_content("Edit Refund Reason") expect(page).to be_axe_clean end diff --git a/admin/spec/features/shipping_categories_spec.rb b/admin/spec/features/shipping_categories_spec.rb index 703de26bd6..fed55b4963 100644 --- a/admin/spec/features/shipping_categories_spec.rb +++ b/admin/spec/features/shipping_categories_spec.rb @@ -26,7 +26,7 @@ before do visit "/admin/shipping_categories#{query}" click_on "Add new" - expect(page).to have_selector("dialog") + expect(page).to have_css("dialog", wait: 5) expect(page).to have_content("New Shipping Category") expect(page).to be_axe_clean end @@ -66,7 +66,7 @@ Spree::ShippingCategory.create(name: "Letter Mail") visit "/admin/shipping_categories#{query}" find_row("Letter Mail").click - expect(page).to have_selector("dialog") + expect(page).to have_css("dialog", wait: 5) expect(page).to have_content("Edit Shipping Category") expect(page).to be_axe_clean end