Merge pull request #8359 from filipefurtad0/fix_flaky_checkout_auth_spec

Switches to css to select accordion element
This commit is contained in:
jibees
2021-10-19 14:20:14 +02:00
committed by GitHub
2 changed files with 1 additions and 9 deletions

View File

@@ -13,14 +13,6 @@ module CheckoutRequestsHelper
find("button", text: "Place order now").click
end
def toggle_accordion(id)
find("##{id} dd a").click
end
def toggle_details
toggle_accordion :details
end
def fill_out_details
within "#details" do
fill_in "First Name", with: "Will"

View File

@@ -55,7 +55,7 @@ describe "As a consumer I want to check out my cart", js: true do
within(".login-modal") { click_button 'Login' }
expect(page).to have_content "Your details"
toggle_details
page.find(:css, "i.ofn-i_052-point-down").click
expect(page).to have_field 'First Name', with: 'Foo'
expect(page).to have_field 'Last Name', with: 'Bar'