Extract to a method in the split checkout helper

This commit is contained in:
Jean-Baptiste Bellet
2022-02-17 14:39:52 +01:00
parent d052c4f8a4
commit 96d4ee3f4f
2 changed files with 8 additions and 4 deletions

View File

@@ -46,4 +46,11 @@ module SplitCheckoutHelper
click_button "Next - Payment method"
expect(page).to have_button("Next - Order summary")
end
def expect_to_be_on_first_step
expect(page).to have_content("1 - Your details")
expect(page).to have_selector("div.checkout-tab.selected", text: "1 - Your details")
expect(page).to have_content("2 - Payment method")
expect(page).to have_content("3 - Order summary")
end
end

View File

@@ -103,10 +103,7 @@ describe "As a consumer, I want to checkout my order", js: true do
it "should display the split checkout details page" do
click_on "Checkout as guest"
expect(page).to have_content distributor.name
expect(page).to have_content("1 - Your details")
expect(page).to have_selector("div.checkout-tab.selected", text: "1 - Your details")
expect(page).to have_content("2 - Payment method")
expect(page).to have_content("3 - Order summary")
expect_to_be_on_first_step
end
it "should display error when fields are empty" do