Skip to content

Commit 4c8842b

Browse files
committed
Merge remote-tracking branch 'github-magento/MC-18826' into EPAM-PR-83
2 parents 2e07423 + b02183d commit 4c8842b

File tree

18 files changed

+995
-258
lines changed

18 files changed

+995
-258
lines changed

app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php

Lines changed: 340 additions & 250 deletions
Large diffs are not rendered by default.

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,22 @@
327327
<data key="postcode">90230</data>
328328
<data key="telephone">555-55-555-55</data>
329329
</entity>
330+
<entity name="US_Address_AE" type="address">
331+
<data key="firstname">John</data>
332+
<data key="lastname">Doe</data>
333+
<data key="company">Magento</data>
334+
<array key="street">
335+
<item>7700 West Parmer Lane</item>
336+
<item>113</item>
337+
</array>
338+
<data key="city">Los Angeles</data>
339+
<data key="state">Armed Forces Europe</data>
340+
<data key="country_id">US</data>
341+
<data key="country">United States</data>
342+
<data key="postcode">90001</data>
343+
<data key="telephone">512-345-6789</data>
344+
<data key="default_billing">Yes</data>
345+
<data key="default_shipping">Yes</data>
346+
<requiredEntity type="region">RegionAE</requiredEntity>
347+
</entity>
330348
</entities>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,17 @@
323323
<data key="store_id">0</data>
324324
<data key="website_id">0</data>
325325
</entity>
326+
<entity name="Simple_US_Customer_ArmedForcesEurope" type="customer">
327+
<data key="group_id">0</data>
328+
<data key="default_billing">true</data>
329+
<data key="default_shipping">true</data>
330+
<data key="email" unique="prefix">John.Doe@example.com</data>
331+
<data key="firstname">John</data>
332+
<data key="lastname">Doe</data>
333+
<data key="fullname">John Doe</data>
334+
<data key="password">pwdTest123!</data>
335+
<data key="store_id">0</data>
336+
<data key="website_id">0</data>
337+
<requiredEntity type="address">US_Address_AE</requiredEntity>
338+
</entity>
326339
</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="RegionAE" 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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<annotations>
13+
<description>Select Shipping method from admin order page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="methodTitle" type="string" defaultValue="flatrate"/>
17+
<argument name="methodName" type="string" defaultValue="fixed"/>
18+
</arguments>
19+
<waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.getShippingMethod}}" stepKey="waitForShippingMethodsOpen"/>
20+
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethod}}" stepKey="openShippingMethod"/>
21+
<conditionalClick selector="{{AdminInvoicePaymentShippingSection.getShippingMethod}}" dependentSelector="{{AdminInvoicePaymentShippingSection.fixedPriceShippingMethod(methodTitle, methodName)}}" visible="false" stepKey="openShippingMethodSecondTime"/>
22+
<waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.fixedPriceShippingMethod(methodName, methodTitle)}}" stepKey="waitForShippingMethod"/>
23+
<click selector="{{AdminInvoicePaymentShippingSection.fixedPriceShippingMethod(methodName, methodTitle)}}" stepKey="chooseShippingMethod"/>
24+
<waitForPageLoad stepKey="waitForPageToLoad"/>
25+
</actionGroup>
26+
</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="#s_method_{{methodName}}_{{methodTitle}}" 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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
<uncheckOption selector="{{AdminShippingMethodTableRatesSection.enabledUseSystemValue}}" stepKey="uncheckUseSystemValue"/>
1818
<selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" userInput="{{status}}" stepKey="changeTableRatesMethodStatus"/>
1919
</actionGroup>
20+
<actionGroup name="AdminImportFileTableRatesShippingMethodActionGroup">
21+
<annotations>
22+
<description>Import a file in Table Rates tab in Shipping Method config page.</description>
23+
</annotations>
24+
<arguments>
25+
<argument name="file" type="string" defaultValue="test_tablerates.csv"/>
26+
</arguments>
27+
<conditionalClick selector="{{AdminShippingMethodTableRatesSection.carriersTableRateTab}}" dependentSelector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" visible="false" stepKey="expandTab"/>
28+
<attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="{{file}}" stepKey="attachFileForImport"/>
29+
</actionGroup>
2030
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="StorefrontSetShippingMethodActionGroup">
12+
<annotations>
13+
<description>Selects the provided Shipping Method on checkout shipping and wait loading mask.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="shippingMethodName" type="string" defaultValue="Flat Rate"/>
17+
</arguments>
18+
<checkOption selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName(shippingMethodName)}}" stepKey="selectFlatRateShippingMethod"/>
19+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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"/>
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+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
25+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
26+
<!--Create website, store group and store view-->
27+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite">
28+
<argument name="newWebsiteName" value="{{customWebsite.name}}"/>
29+
<argument name="websiteCode" value="{{customWebsite.code}}"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore">
32+
<argument name="website" value="{{customWebsite.name}}"/>
33+
<argument name="storeGroupName" value="{{customStoreGroup.name}}"/>
34+
<argument name="storeGroupCode" value="{{customStoreGroup.code}}"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
37+
<argument name="StoreGroup" value="customStoreGroup"/>
38+
<argument name="customStore" value="customStore"/>
39+
</actionGroup>
40+
<!--Create customer associated to website-->
41+
<actionGroup ref="AdminGoCreatedWebsitePageActionGroup" stepKey="DeleteWebsite">
42+
<argument name="websiteName" value="{{customWebsite.name}}"/>
43+
</actionGroup>
44+
<grabFromCurrentUrl regex="~/website_id/(\d+)/~" stepKey="grabWebsiteIdFromURL"/>
45+
<createData entity="Simple_Customer_Without_Address" stepKey="createCustomer">
46+
<field key="website_id">$grabWebsiteIdFromURL</field>
47+
</createData>
48+
<!--Enable Table Rate method and import csv file-->
49+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/>
50+
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchDefaultWebsite">
51+
<argument name="website" value="_defaultWebsite"/>
52+
</actionGroup>
53+
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethodForDefaultWebsite">
54+
<argument name="status" value="0"/>
55+
</actionGroup>
56+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigForDefaultWebsite"/>
57+
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchCustomWebsite">
58+
<argument name="website" value="customWebsite"/>
59+
</actionGroup>
60+
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethod">
61+
<argument name="status" value="1"/>
62+
</actionGroup>
63+
<actionGroup ref="AdminImportFileTableRatesShippingMethodActionGroup" stepKey="importCSVFile">
64+
<argument name="file" value="usa_tablerates.csv"/>
65+
</actionGroup>
66+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
67+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
68+
</before>
69+
<after>
70+
<!--Delete created data-->
71+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
72+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
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+
<amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/>
80+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
81+
<actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct">
82+
<argument name="website" value="{{_defaultWebsite.name}}"/>
83+
</actionGroup>
84+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct">
85+
<argument name="website" value="{{customWebsite.name}}"/>
86+
</actionGroup>
87+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
88+
<!--Create order-->
89+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
90+
<argument name="customer" value="$$createCustomer$$"/>
91+
<argument name="storeView" value="customStore"/>
92+
</actionGroup>
93+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder">
94+
<argument name="product" value="$$createProduct$$"/>
95+
</actionGroup>
96+
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo">
97+
<argument name="customer" value="$$createCustomer$$"/>
98+
<argument name="address" value="US_Address_TX"/>
99+
</actionGroup>
100+
<!--Choose Best Way shipping Method-->
101+
<actionGroup ref="AdminOrderSelectShippingMethodActionGroup" stepKey="chooseBestWayMethod">
102+
<argument name="methodTitle" value="bestway"/>
103+
<argument name="methodName" value="tablerate"/>
104+
</actionGroup>
105+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
106+
</test>
107+
</tests>
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+
<!--Rollback config-->
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+
<!--Admin Configuration: enable Table Rates and import CSV file with the rates-->
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+
<!--Login as created customer-->
53+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
54+
<argument name="Customer" value="$$createCustomer$$"/>
55+
</actionGroup>
56+
<!--Add the created product to the shopping cart-->
57+
<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart">
58+
<argument name="product" value="$$createProduct$$"/>
59+
</actionGroup>
60+
<!--Proceed to Checkout from the mini cart-->
61+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" />
62+
<!--Shipping Method: select table rate-->
63+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="assertShippingMethodAvailable">
64+
<argument name="shippingMethodName" value="Best Way"/>
65+
</actionGroup>
66+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodTableRate">
67+
<argument name="shippingMethodName" value="Best Way"/>
68+
</actionGroup>
69+
<!--Proceed to Review and Payments section-->
70+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickToSaveShippingInfo"/>
71+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterClickNext"/>
72+
<waitForPageLoad stepKey="waitForReviewAndPaymentsPageIsLoaded"/>
73+
<!--Place order and assert the message of success-->
74+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrderProductSuccessful"/>
75+
</test>
76+
</tests>

0 commit comments

Comments
 (0)