Test to control order of shipping methods by name

This commit is contained in:
Duende13
2017-08-04 17:29:49 +01:00
committed by Rob Harrington
parent 31fa49feed
commit eca18ba6ee

View File

@@ -222,11 +222,12 @@ feature "As a consumer I want to check out my cart", js: true, retry: 3 do
page.should_not have_content product.tax_category.name
end
it "shows all shipping methods" do
it "shows all shipping methods in order by name" do
toggle_shipping
page.should have_content "Frogs"
page.should have_content "Donkeys"
page.should have_content "Local"
shipping_methods = page.all(:xpath, '//*[@id="shipping"]/ng-form/dd/div/div[1]').map {|row| row.all('label').map(&:text)}.flatten
expect(shipping_methods[0]).to include(sm2.name) # Donkeys
expect(shipping_methods[1]).to include(sm1.name) # Frogs
expect(shipping_methods[2]).to include(sm3.name) # Local
end
context "when shipping method requires an address" do