From c94b5d159807cd8ab5593f6b6eec9e4549d22627 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 20 Oct 2021 18:58:06 +0100 Subject: [PATCH] Toggles shipping info section --- spec/support/request/checkout_request_helper.rb | 1 + spec/system/consumer/shopping/checkout_spec.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/spec/support/request/checkout_request_helper.rb b/spec/support/request/checkout_request_helper.rb index 33ab8d7636..7170032bc5 100644 --- a/spec/support/request/checkout_request_helper.rb +++ b/spec/support/request/checkout_request_helper.rb @@ -53,6 +53,7 @@ module CheckoutRequestsHelper return unless save_default_addresses within "#shipping" do + find(:xpath, '//*[@id="shipping"]/ng-form/dd').click check "Shipping address same as billing address?" check "Save as default shipping address" end diff --git a/spec/system/consumer/shopping/checkout_spec.rb b/spec/system/consumer/shopping/checkout_spec.rb index 046fd19e64..b2eec21a14 100644 --- a/spec/system/consumer/shopping/checkout_spec.rb +++ b/spec/system/consumer/shopping/checkout_spec.rb @@ -313,8 +313,11 @@ describe "As a consumer I want to check out my cart", js: true do it "checks out successfully" do visit checkout_path + expect(page).to have_content "Shipping info" + find(:xpath, '//*[@id="shipping"]/ng-form/dd').click find("input[value='#{shipping_with_fee.id}'").click + click_button "Next" expect(page).to have_content "Payment" find("input[value='#{check_without_fee.id}'").click