Skip to content

Commit 30d8cac

Browse files
committed
MC-18826: Increase test coverage for Cart & Checkout and Order Processing functional areas
- Automation test for MC-6405
1 parent 6f03dd3 commit 30d8cac

File tree

6 files changed

+151
-0
lines changed

6 files changed

+151
-0
lines changed

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,22 @@
312312
<data key="postcode">90230</data>
313313
<data key="telephone">555-55-555-55</data>
314314
</entity>
315+
<entity name="US_Address_AFE" type="address">
316+
<data key="firstname">John</data>
317+
<data key="lastname">Doe</data>
318+
<data key="company">Magento</data>
319+
<array key="street">
320+
<item>7700 West Parmer Lane</item>
321+
<item>113</item>
322+
</array>
323+
<data key="city">Los Angeles</data>
324+
<data key="state">Armed Forces Europe</data>
325+
<data key="country_id">US</data>
326+
<data key="country">United States</data>
327+
<data key="postcode">90001</data>
328+
<data key="telephone">512-345-6789</data>
329+
<data key="default_billing">Yes</data>
330+
<data key="default_shipping">Yes</data>
331+
<requiredEntity type="region">RegionAFE</requiredEntity>
332+
</entity>
315333
</entities>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,17 @@
309309
<data key="store_id">0</data>
310310
<data key="website_id">0</data>
311311
</entity>
312+
<entity name="Simple_US_Customer_ArmedForcesEurope" type="customer">
313+
<data key="group_id">0</data>
314+
<data key="default_billing">true</data>
315+
<data key="default_shipping">true</data>
316+
<data key="email" unique="prefix">John.Doe@example.com</data>
317+
<data key="firstname">John</data>
318+
<data key="lastname">Doe</data>
319+
<data key="fullname">John Doe</data>
320+
<data key="password">pwdTest123!</data>
321+
<data key="store_id">0</data>
322+
<data key="website_id">0</data>
323+
<requiredEntity type="address">US_Address_AFE</requiredEntity>
324+
</entity>
312325
</entities>

app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@
3232
<data key="region_code">UT</data>
3333
<data key="region_id">58</data>
3434
</entity>
35+
<entity name="RegionAFE" type="region">
36+
<data key="region">Armed Forces Europe</data>
37+
<data key="region_code">AFE</data>
38+
<data key="region_id">9</data>
39+
</entity>
3540
</entities>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="SetShippingMethodActionGroup">
12+
<arguments>
13+
<argument name="shippingMethodName" type="string" defaultValue="Flat Rate"/>
14+
</arguments>
15+
<checkOption selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName(shippingMethodName)}}" stepKey="selectFlatRateShippingMethod"/>
16+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="StorefrontDisplayTableRatesShippingMethodForAETest">
12+
<annotations>
13+
<features value="Shipping"/>
14+
<stories value="Table Rates"/>
15+
<title value="Displaying of Table Rates for Armed Forces Europe (AE)"/>
16+
<description value="Displaying of Table Rates for Armed Forces Europe (AE)"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-6405"/>
19+
<group value="shipping"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="Simple_US_Customer_ArmedForcesEurope" stepKey="createCustomer"/>
27+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
31+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
32+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
33+
<comment userInput="Rollback config" stepKey="rollbackConfigComment"/>
34+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodSystemConfigPage"/>
35+
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreViewToMainWebsite">
36+
<argument name="website" value="_defaultWebsite"/>
37+
</actionGroup>
38+
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="disableTableRatesShippingMethod">
39+
<argument name="status" value="0"/>
40+
</actionGroup>
41+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveSystemConfig"/>
42+
<actionGroup ref="logout" stepKey="logout"/>
43+
</after>
44+
<comment userInput="Admin Configuration: enable Table Rates and import CSV file with the rates" stepKey="prepareAdminConfigurationComment"/>
45+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/>
46+
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreView">
47+
<argument name="website" value="_defaultWebsite"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethod"/>
50+
<attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="tablerates.csv" stepKey="attachFileForImport"/>
51+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
52+
<comment userInput="Login as created customer" stepKey="loginAsCustomerComment"/>
53+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
54+
<argument name="Customer" value="$$createCustomer$$"/>
55+
</actionGroup>
56+
<comment userInput="Add the created product to the shopping cart" stepKey="addProductToCartComment"/>
57+
<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart">
58+
<argument name="product" value="$$createProduct$$"/>
59+
</actionGroup>
60+
<comment userInput="Proceed to Checkout from the mini cart" stepKey="proceedToCheckoutComment"/>
61+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" />
62+
<comment userInput="Shipping Method: select table rate" stepKey="assertShippingMethodComment"/>
63+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="assertShippingMethodAvailable">
64+
<argument name="shippingMethodName" value="Best Way"/>
65+
</actionGroup>
66+
<actionGroup ref="SetShippingMethodActionGroup" stepKey="setShippingMethodTableRate">
67+
<argument name="shippingMethodName" value="Best Way"/>
68+
</actionGroup>
69+
<comment userInput="Proceed to Review and Payments section" stepKey="proceedToReviewAndPaymentsComment"/>
70+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickToSaveShippingInfo"/>
71+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterClickNext"/>
72+
<waitForPageLoad stepKey="waitForReviewAndPaymentsPageIsLoaded"/>
73+
<comment userInput="Place order and assert the message of success" stepKey="placeOrderComment"/>
74+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
75+
</test>
76+
</tests>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
2+
ASM,*,*,0,9.95
3+
FSM,*,*,0,9.95
4+
GUM,*,*,0,9.95
5+
MHL,*,*,0,9.95
6+
MNP,*,*,0,9.95
7+
PLW,*,*,0,9.95
8+
USA,AA,*,0,9.95
9+
USA,AE,*,0,9.95
10+
USA,AK,*,0,9.95
11+
USA,AP,*,0,9.95
12+
USA,AS,*,0,9.95
13+
USA,FM,*,0,9.95
14+
USA,GU,*,0,9.95
15+
USA,HI,*,0,9.95
16+
USA,MH,*,0,9.95
17+
USA,MP,*,0,9.95
18+
USA,PR,*,0,9.95
19+
USA,PW,*,0,9.95
20+
USA,VI,*,0,9.95
21+
VIR,*,*,0,9.95

0 commit comments

Comments
 (0)