From 5a85fcd34912381d73910dd2bdbc2a3c799fa162 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 6 Oct 2021 16:46:07 +1100 Subject: [PATCH] Expect content after page is loaded The login action takes some time and the spec wasn't waiting for that. I suspected a race condition when AngularJS is initialising form values and we are expecting certain values. --- spec/system/consumer/shopping/checkout_auth_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/consumer/shopping/checkout_auth_spec.rb b/spec/system/consumer/shopping/checkout_auth_spec.rb index 8461f8523a..c35b73fd4a 100644 --- a/spec/system/consumer/shopping/checkout_auth_spec.rb +++ b/spec/system/consumer/shopping/checkout_auth_spec.rb @@ -53,6 +53,8 @@ describe "As a consumer I want to check out my cart", js: true do fill_in "Email", with: user.email fill_in "Password", with: user.password within(".login-modal") { click_button 'Login' } + + expect(page).to have_content "Your details" toggle_details expect(page).to have_field 'First Name', with: 'Foo'