Skip to content

Commit 9377d04

Browse files
committed
MC-18826: Increase test coverage for Cart & Checkout and Order Processing functional areas
- Automation test for MC-6411
1 parent 484cc98 commit 9377d04

File tree

6 files changed

+172
-1
lines changed

6 files changed

+172
-1
lines changed

app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminEditCustomerInformationFromActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@
3030
<waitForPageLoad stepKey="wait"/>
3131
<scrollToTopOfPage stepKey="scrollToTop"/>
3232
</actionGroup>
33+
<actionGroup name="AdminAssociateCustomerToCustomWebsiteActionGroup">
34+
<arguments>
35+
<argument name="websiteName" type="string" defaultValue="secondWebsite"/>
36+
</arguments>
37+
<conditionalClick selector="{{AdminCustomerAccountInformationSection.accountInformationTab}}" dependentSelector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" visible="false" stepKey="goToAccountInformation"/>
38+
<selectOption selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{websiteName}}" stepKey="selectWebSite"/>
39+
</actionGroup>
3340
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminOrderSelectShippingMethodActionGroup">
12+
<arguments>
13+
<argument name="methodTitle" type="string" defaultValue="Flat Rate"/>
14+
<argument name="methodName" type="string" defaultValue="Fixed"/>
15+
</arguments>
16+
<waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.getShippingMethod}}" stepKey="waitForShippingMethodsOpen"/>
17+
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethod}}" stepKey="openShippingMethod"/>
18+
<conditionalClick selector="{{AdminInvoicePaymentShippingSection.getShippingMethod}}" dependentSelector="{{AdminInvoicePaymentShippingSection.fixedPriceShippingMethod(methodTitle, methodName)}}" visible="false" stepKey="openShippingMethodSecondTime"/>
19+
<waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.fixedPriceShippingMethod(methodTitle, methodName)}}" stepKey="waitForShippingMethod"/>
20+
<click selector="{{AdminInvoicePaymentShippingSection.fixedPriceShippingMethod(methodTitle, methodName)}}" stepKey="chooseShippingMethod"/>
21+
<waitForPageLoad stepKey="waitForPageToLoad"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicePaymentShippingSection.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717
<element name="CreateShipment" type="checkbox" selector=".order-shipping-address input[name='invoice[do_shipment]']"/>
1818
<element name="getShippingMethodAndRates" type="button" selector="//span[text()='Get shipping methods and rates']" timeout="60"/>
1919
<element name="shippingMethod" type="button" selector="//label[contains(text(), 'Fixed')]" timeout="60"/>
20+
<element name="fixedPriceShippingMethod" type="button" selector="//*[contains(text(), '{{methodTitle}}')]/parent::dl//label[contains(text(), '{{methodName}}')]" parameterized="true"/>
21+
<element name="getShippingMethod" type="button" selector="#order-shipping-method-summary a"/>
2022
</section>
21-
</sections>
23+
</sections>

app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminChangeTableRatesShippingMethodStatusActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@
1717
<uncheckOption selector="{{AdminShippingMethodTableRatesSection.enabledUseSystemValue}}" stepKey="uncheckUseSystemValue"/>
1818
<selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" userInput="{{status}}" stepKey="changeTableRatesMethodStatus"/>
1919
</actionGroup>
20+
<actionGroup name="AdminImportFileTableRatesShippingMethodActionGroup">
21+
<arguments>
22+
<argument name="file" type="string" defaultValue="test_tablerates.csv"/>
23+
</arguments>
24+
<conditionalClick selector="{{AdminShippingMethodTableRatesSection.carriersTableRateTab}}" dependentSelector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" visible="false" stepKey="expandTab"/>
25+
<attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="{{file}}" stepKey="attachFileForImport"/>
26+
</actionGroup>
2027
</actionGroups>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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="AdminCreateOrderCustomStoreShippingMethodTableRatesTest">
12+
<annotations>
13+
<features value="Shipping"/>
14+
<stories value="Shipping method Table Rates settings gets from wrong store"/>
15+
<title value="Create order on second store with shipping method Table Rates"/>
16+
<description value="Create order on second store with shipping method Table Rates"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-6411"/>
19+
<useCaseId value="MAGETWO-91702"/>
20+
<group value="shipping"/>
21+
</annotations>
22+
<before>
23+
<!--Create product and customer-->
24+
<comment userInput="Create product and customer" stepKey="commentCreateProductAndCustomer"/>
25+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
26+
<createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/>
27+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
28+
<!--Create website, store group and store view-->
29+
<comment userInput="Create website, store group and store view" stepKey="commentCreateWebsiteStoreAndView"/>
30+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite">
31+
<argument name="newWebsiteName" value="{{customWebsite.name}}"/>
32+
<argument name="websiteCode" value="{{customWebsite.code}}"/>
33+
</actionGroup>
34+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore">
35+
<argument name="website" value="{{customWebsite.name}}"/>
36+
<argument name="storeGroupName" value="{{customStoreGroup.name}}"/>
37+
<argument name="storeGroupCode" value="{{customStoreGroup.code}}"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
40+
<argument name="StoreGroup" value="customStoreGroup"/>
41+
<argument name="customStore" value="customStore"/>
42+
</actionGroup>
43+
<!--Enable Table Rate method and import csv file-->
44+
<comment userInput="Enable Table Rate method and import csv file" stepKey="commentEnableTableRates"/>
45+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/>
46+
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchDefaultWebsite">
47+
<argument name="website" value="_defaultWebsite"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethodForDefaultWebsite">
50+
<argument name="status" value="0"/>
51+
</actionGroup>
52+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigForDefaultWebsite"/>
53+
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchCustomWebsite">
54+
<argument name="website" value="customWebsite"/>
55+
</actionGroup>
56+
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethod">
57+
<argument name="status" value="1"/>
58+
</actionGroup>
59+
<actionGroup ref="AdminImportFileTableRatesShippingMethodActionGroup" stepKey="importCSVFile">
60+
<argument name="file" value="test_tablerates.csv"/>
61+
</actionGroup>
62+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
63+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
64+
</before>
65+
<after>
66+
<!--Delete created data-->
67+
<comment userInput="Delete created data" stepKey="commetnDeleteCreatedData"/>
68+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
69+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
70+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteSecondCreatedCustomer">
71+
<argument name="customerEmail" value="$$createCustomer.id$$"/>
72+
</actionGroup>
73+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite">
74+
<argument name="websiteName" value="{{customWebsite.name}}"/>
75+
</actionGroup>
76+
<actionGroup ref="logout" stepKey="logout"/>
77+
</after>
78+
<!--Assign product to custom website-->
79+
<comment userInput="Assign product to custom website" stepKey="commentAssignProductToWebsite"/>
80+
<amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/>
81+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
82+
<actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct">
83+
<argument name="website" value="{{_defaultWebsite.name}}"/>
84+
</actionGroup>
85+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct">
86+
<argument name="website" value="{{customWebsite.name}}"/>
87+
</actionGroup>
88+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
89+
<!--Assign customer to custom website-->
90+
<comment userInput="Assign customer to custom website" stepKey="commentAssignCustomerToWebsite"/>
91+
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
92+
<argument name="customerId" value="$$createCustomer.id$$"/>
93+
</actionGroup>
94+
<actionGroup ref="AdminAssociateCustomerToCustomWebsiteActionGroup" stepKey="associateCustomerToWebsite">
95+
<argument name="websiteName" value="{{customWebsite.name}}"/>
96+
</actionGroup>
97+
<actionGroup ref="AdminSaveCustomerAndAssertSuccessMessage" stepKey="saveAndCheckSuccessMessage"/>
98+
<!--Create order-->
99+
<comment userInput="Create order" stepKey="commentCreateOrder"/>
100+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
101+
<argument name="customer" value="$$createCustomer$$"/>
102+
<argument name="storeView" value="customStore"/>
103+
</actionGroup>
104+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder">
105+
<argument name="product" value="$$createProduct$$"/>
106+
</actionGroup>
107+
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo">
108+
<argument name="customer" value="$$createCustomer$$"/>
109+
<argument name="address" value="US_Address_TX"/>
110+
</actionGroup>
111+
<!--Choose Best Way shipping Method-->
112+
<comment userInput="Choose Best Way shipping Method" stepKey="commentChooseShippingMethod"/>
113+
<actionGroup ref="AdminOrderSelectShippingMethodActionGroup" stepKey="chooseBestWayMethod">
114+
<argument name="methodTitle" value="Best Way"/>
115+
<argument name="methodName" value="Table Rate"/>
116+
</actionGroup>
117+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
118+
</test>
119+
</tests>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Country,Region/State,"Zip/Postal Code","Order Subtotal (and above)","Shipping Price"
2+
USA,*,*,0.0000,7.9900
3+
USA,*,*,7.0000,6.9900
4+
USA,*,*,13.0000,5.9900
5+
USA,*,*,25.9900,4.9900
6+
USA,AK,*,0.0000,8.9900
7+
USA,AK,*,7.0000,7.9900
8+
USA,AK,*,13.0000,6.9900
9+
USA,AK,*,25.9900,5.9900
10+
USA,HI,*,0.0000,8.9900
11+
USA,HI,*,7.0000,7.9900
12+
USA,HI,*,13.0000,6.9900
13+
USA,HI,*,25.9900,5.9900

0 commit comments

Comments
 (0)