From 9d0e26ae282d6ee1f1a94571b9da09d2d9a384f5 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Tue, 4 Feb 2020 16:20:21 +0800 Subject: [PATCH] Wait for products panel to show in outgoing exchanges feature spec --- spec/features/admin/order_cycles_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/features/admin/order_cycles_spec.rb b/spec/features/admin/order_cycles_spec.rb index 995d02fe6e..140c17b5ad 100644 --- a/spec/features/admin/order_cycles_spec.rb +++ b/spec/features/admin/order_cycles_spec.rb @@ -369,7 +369,12 @@ feature ' find(:css, "tags-input .tags input").set "wholesale\n" end - page.all("table.exchanges tr.distributor td.products").each(&:click) + exchange_rows = page.all("table.exchanges tbody") + exchange_rows.each do |exchange_row| + exchange_row.find("td.products").click + # Wait for the products panel to be visible. + expect(exchange_row).to have_selector "tr", count: 2 + end uncheck "order_cycle_outgoing_exchange_2_variants_#{v1.id}" check "order_cycle_outgoing_exchange_2_variants_#{v2.id}"