mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Adds split-checkout helper
This commit is contained in:
47
spec/support/request/split_checkout_request_helper.rb
Normal file
47
spec/support/request/split_checkout_request_helper.rb
Normal file
@@ -0,0 +1,47 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module SplitCheckoutRequestsHelper
|
||||
def have_split_checkout_details
|
||||
have_content "Your details"
|
||||
end
|
||||
|
||||
def split_checkout_as_guest
|
||||
click_button "Checkout as guest"
|
||||
end
|
||||
|
||||
def split_place_order
|
||||
find("button", text: "Complete order").click
|
||||
end
|
||||
|
||||
def split_fill_out_details
|
||||
# Section: Your Details
|
||||
within(:xpath, './/div[@class="checkout-substep"][1]') 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 split_fill_out_billing_address
|
||||
# Section: Your Billing Address
|
||||
within(:xpath, './/div[@class="checkout-substep"][2]') do
|
||||
fill_in "Address", with: "Rue de la Vie, 77"
|
||||
fill_in "City", with: "Melbourne"
|
||||
fill_in "Postcode", with: "3066"
|
||||
select "Australia", from: "Country"
|
||||
select "Victoria", from: "State"
|
||||
end
|
||||
end
|
||||
|
||||
def split_fill_out_shipping_address
|
||||
# Section: Delivery Address
|
||||
within(:xpath, './/div[@class="checkout-substep"][3]') do
|
||||
fill_in "Address", with: "Rue de la Vie, 66"
|
||||
fill_in "City", with: "Perth"
|
||||
fill_in "Postcode", with: "2899"
|
||||
select "Australia", from: "Country"
|
||||
select "New South Wales", from: "State"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user