diff --git a/spec/system/admin/orders/invoices_spec.rb b/spec/system/admin/orders/invoices_spec.rb index a7d452dfc645..8440ad83f41f 100644 --- a/spec/system/admin/orders/invoices_spec.rb +++ b/spec/system/admin/orders/invoices_spec.rb @@ -112,6 +112,7 @@ expect(order.invoices.count).to eq 0 page.find("#links-dropdown", text: "ACTIONS").click click_link "Print Invoice" + # wait for PDF to open in new window new_window = windows.last page.within_window new_window do expect(order.invoices.count).to eq 1