From a35fab5e1fff8b1c9efd76a43261986f30af5992 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 18 Oct 2022 14:27:18 +1100 Subject: [PATCH 1/2] Speed up spec by skipping a page --- spec/system/admin/bulk_product_update_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/system/admin/bulk_product_update_spec.rb b/spec/system/admin/bulk_product_update_spec.rb index 5a6e5e6129..9fe31ecb09 100644 --- a/spec/system/admin/bulk_product_update_spec.rb +++ b/spec/system/admin/bulk_product_update_spec.rb @@ -527,9 +527,8 @@ describe ' s2 = create(:supplier_enterprise) p1 = FactoryBot.create(:simple_product, name: "product1", supplier: s1) p2 = FactoryBot.create(:simple_product, name: "product2", supplier: s2) - login_as_admin - visit spree.admin_products_path + login_as_admin_and_visit spree.admin_products_path select2_select s1.name, from: "producer_filter" apply_filters From 04921aeed4635ed7a2ef77d27116cc01e4a84515 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 19 Oct 2022 09:59:51 +1100 Subject: [PATCH 2/2] Stabilise spec by waiting for JS --- spec/system/admin/bulk_product_update_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/admin/bulk_product_update_spec.rb b/spec/system/admin/bulk_product_update_spec.rb index 9fe31ecb09..0493b5719a 100644 --- a/spec/system/admin/bulk_product_update_spec.rb +++ b/spec/system/admin/bulk_product_update_spec.rb @@ -533,6 +533,8 @@ describe ' select2_select s1.name, from: "producer_filter" apply_filters + sleep 2 # wait for page to initialise + expect(page).to have_no_field "product_name", with: p2.name fill_in "product_name", with: "new product1"