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.
This commit is contained in:
Maikel Linke
2021-10-06 16:46:07 +11:00
parent ccc73eb829
commit 5a85fcd349

View File

@@ -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'