Move checkout helpers to checkout_helper

This commit is contained in:
Luis Ramos
2020-08-18 14:12:59 +01:00
parent d1f5828d13
commit edfd0fd95c
2 changed files with 32 additions and 32 deletions

View File

@@ -455,36 +455,4 @@ feature "As a consumer I want to check out my cart", js: true do
end
end
end
def fill_out_details
within "#details" do
fill_in "First Name", with: "Will"
fill_in "Last Name", with: "Marshall"
fill_in "Email", with: "test@test.com"
fill_in "Phone", with: "0468363090"
end
end
def fill_out_billing_address
within "#billing" do
fill_in "City", with: "Melbourne"
fill_in "Postcode", with: "3066"
fill_in "Address", with: "123 Your Head"
select "Australia", from: "Country"
select "Victoria", from: "State"
end
end
def fill_out_form
choose free_shipping.name
choose check_without_fee.name
fill_out_details
check "Save as default billing address"
fill_out_billing_address
check "Shipping address same as billing address?"
check "Save as default shipping address"
end
end

View File

@@ -18,4 +18,36 @@ module CheckoutHelper
def toggle_details
toggle_accordion :details
end
def fill_out_details
within "#details" do
fill_in "First Name", with: "Will"
fill_in "Last Name", with: "Marshall"
fill_in "Email", with: "test@test.com"
fill_in "Phone", with: "0468363090"
end
end
def fill_out_billing_address
within "#billing" do
fill_in "City", with: "Melbourne"
fill_in "Postcode", with: "3066"
fill_in "Address", with: "123 Your Head"
select "Australia", from: "Country"
select "Victoria", from: "State"
end
end
def fill_out_form
choose free_shipping.name
choose check_without_fee.name
fill_out_details
check "Save as default billing address"
fill_out_billing_address
check "Shipping address same as billing address?"
check "Save as default shipping address"
end
end