Skip to content

Commit c066be5

Browse files
MC-36884: Incorrect default country displayed on shipping page when store view is changed in cart
1 parent b87300a commit c066be5

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="CheckoutDifferentDefaultCountryPerStoreTest">
12+
<annotations>
13+
<features value="One Page Checkout"/>
14+
<stories value="Checkout via the Storefront"/>
15+
<title value="Checkout different default country per store"/>
16+
<description value="Checkout display default country per store view"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-37707"/>
19+
<useCaseId value="MC-36884"/>
20+
<group value="checkout"/>
21+
</annotations>
22+
<before>
23+
<!-- Create simple product -->
24+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
25+
<!-- Create store view -->
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/>
27+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView">
28+
<argument name="customStore" value="customStore"/>
29+
</actionGroup>
30+
<!-- Set Germany as default country for created store view -->
31+
<magentoCLI command="config:set --scope=stores --scope-code={{customStore.code}} general/country/default {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="changeDefaultCountry"/>
32+
</before>
33+
<after>
34+
<!--Delete product and store view-->
35+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
36+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView">
37+
<argument name="customStore" value="customStore"/>
38+
</actionGroup>
39+
</after>
40+
<!-- Open product and add product to cart-->
41+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage">
42+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
43+
</actionGroup>
44+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
45+
<argument name="product" value="$$createProduct$$"/>
46+
<argument name="productCount" value="1"/>
47+
</actionGroup>
48+
<!-- Go to cart -->
49+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
50+
<!-- Switch store view -->
51+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewActionGroup">
52+
<argument name="storeView" value="customStore"/>
53+
</actionGroup>
54+
<!-- Go to checkout page -->
55+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/>
56+
<!-- Grab country code from checkout page and assert value with default country for created store view -->
57+
<grabValueFrom selector="{{CheckoutShippingSection.country}}" stepKey="grabCountry"/>
58+
<assertEquals stepKey="assertCountryValue">
59+
<actualResult type="const">$grabCountry</actualResult>
60+
<expectedResult type="string">{{DE_Address_Berlin_Not_Default_Address.country_id}}</expectedResult>
61+
</assertEquals>
62+
</test>
63+
</tests>

0 commit comments

Comments
 (0)