mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix test regressions with multiple 'Save and Continue' buttons in checkout
This commit is contained in:
@@ -106,8 +106,8 @@ feature "enterprises distributor info as rich text" do
|
||||
select('Australia', :from => 'order_bill_address_attributes_country_id')
|
||||
select('Victoria', :from => 'order_bill_address_attributes_state_id')
|
||||
|
||||
click_button 'Save and Continue'
|
||||
click_button 'Save and Continue'
|
||||
click_button 'Process My Order'
|
||||
click_checkout_continue_button
|
||||
click_checkout_continue_button
|
||||
click_checkout_continue_button
|
||||
end
|
||||
end
|
||||
|
||||
@@ -192,15 +192,14 @@ feature %q{
|
||||
# Disabled until this form takes order cycles into account
|
||||
# page.should have_selector "select#order_distributor_id option[value='#{@distributor_alternative.id}']"
|
||||
|
||||
#click_button 'Save and Continue'
|
||||
click_continue_button
|
||||
click_checkout_continue_button
|
||||
|
||||
# -- Checkout: Delivery
|
||||
page.should have_selector 'label', :text => "Delivery $3.00"
|
||||
click_continue_button
|
||||
click_checkout_continue_button
|
||||
|
||||
# -- Checkout: Payment
|
||||
click_continue_button
|
||||
click_checkout_continue_button
|
||||
|
||||
# -- Checkout: Order complete
|
||||
page.should have_content('Your order has been processed successfully')
|
||||
@@ -211,12 +210,4 @@ feature %q{
|
||||
# page.should have_content('On Tuesday, 4 PM')
|
||||
# page.should have_content('12 Bungee Rd, Carion')
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def click_continue_button
|
||||
page.find('#add_new_save_checkout_button input[type=submit]').click
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -65,6 +65,7 @@ RSpec.configure do |config|
|
||||
|
||||
config.include Rails.application.routes.url_helpers
|
||||
config.include Spree::UrlHelpers
|
||||
config.include Spree::CheckoutHelpers
|
||||
config.include Spree::Core::TestingSupport::ControllerRequests, :type => :controller
|
||||
config.include Devise::TestHelpers, :type => :controller
|
||||
|
||||
|
||||
7
spec/support/spree/checkout_helpers.rb
Normal file
7
spec/support/spree/checkout_helpers.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
module Spree
|
||||
module CheckoutHelpers
|
||||
def click_checkout_continue_button
|
||||
page.find('#add_new_save_checkout_button input[type=submit]').click
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user