Skip to content

Commit c3030f4

Browse files
Merge branch 'ACQE-5765v1' into ACQE-6779_mainline_PR_deployment
2 parents 29fe909 + 742d698 commit c3030f4

File tree

8 files changed

+249
-0
lines changed

8 files changed

+249
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,4 +556,23 @@
556556
<data key="postcode">32909</data>
557557
<data key="telephone">12345678</data>
558558
</entity>
559+
<entity name="US_Address_TX_With_RegionID" type="address">
560+
<data key="firstname">John</data>
561+
<data key="lastname">Doe</data>
562+
<data key="company">Magento</data>
563+
<array key="street">
564+
<item>7700 West Parmer Lane</item>
565+
</array>
566+
<data key="city">Austin</data>
567+
<data key="state">Texas</data>
568+
<data key="region_id">Texas</data>
569+
<data key="country_id">US</data>
570+
<data key="country">United States</data>
571+
<data key="postcode">78729</data>
572+
<data key="telephone">512-345-6789</data>
573+
<data key="vat_id">47458714</data>
574+
<data key="default_billing">Yes</data>
575+
<data key="default_shipping">Yes</data>
576+
<requiredEntity type="region">RegionTX</requiredEntity>
577+
</entity>
559578
</entities>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminFillAddressInformationInOrderActionGroup">
12+
<annotations>
13+
<description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page for Customer not having Select state.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customer"/>
17+
<argument name="address"/>
18+
</arguments>
19+
<fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/>
20+
<fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/>
21+
<fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/>
22+
<fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/>
23+
<selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/>
24+
<fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/>
25+
<fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
26+
</actionGroup>
27+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="shippingMethod" type="button" selector="//label[contains(text(), 'Fixed')]" timeout="60"/>
2020
<element name="fixedPriceShippingMethod" type="button" selector="#s_method_{{methodName}}_{{methodTitle}}" parameterized="true"/>
2121
<element name="getShippingMethod" type="button" selector="#order-shipping-method-summary a"/>
22+
<element name="selectUSPSType" type="radio" selector="//label[contains(text(),'Priority Mail Express International Flat Rate Envelope -')]//ancestor::label[@class='admin__field-label']"/>
2223
</section>
2324
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@
3232
<element name="paymentLabelWithRadioButton" type="text" selector="#order-billing_method_form .admin__field-option input[title='{{paymentMethodName}}'] + label" parameterized="true"/>
3333
<element name="checkoutPaymentMethod" type="radio" selector="//div[@class='payment-method _active']/div/input[@id= '{{methodName}}']" parameterized="true"/>
3434
<element name="storedCard" type="radio" selector="#p_method_payflowpro_cc_vault" timeout="30"/>
35+
<element name="selectPaymentMethod" type="radio" selector="//div[@id='order-billing_method_form']//input[@title='Check / Money order']"/>
36+
<element name="checkMoneyOrderText" type="text" selector="//div[@id='order-billing_method_form']//dl//dt//label[contains(text(),'Check / Money order')]"/>
3537
</section>
3638
</sections>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminEnableUSPSConfigData" type="usps_config">
12+
<data key="path">carriers/usps/active</data>
13+
<data key="scope_id">1</data>
14+
<data key="label">Yes</data>
15+
<data key="value">1</data>
16+
</entity>
17+
<entity name="AdminDisableUSPSConfigData" type="usps_config">
18+
<data key="path">carriers/usps/active</data>
19+
<data key="scope_id">1</data>
20+
<data key="label">No</data>
21+
<data key="value">0</data>
22+
</entity>
23+
<entity name="AdminUserIDUSPSConfigData" type="usps_config">
24+
<data key="path">carriers/usps/userid</data>
25+
<data key="value">{{_CREDS.magento/carriers_usps_userid}}</data>
26+
</entity>
27+
<entity name="AdminPasswordUSPSConfigData" type="usps_config">
28+
<data key="path">carriers/usps/password</data>
29+
<data key="value">{{_CREDS.magento/carriers_usps_password}}</data>
30+
</entity>
31+
<entity name="AdminEnableDebugUSPSConfigData" type="usps_config">
32+
<data key="path">carriers/usps/debug</data>
33+
<data key="scope_id">1</data>
34+
<data key="label">Yes</data>
35+
<data key="value">1</data>
36+
</entity>
37+
<entity name="AdminDisableDebugUSPSConfigData" type="usps_config">
38+
<data key="path">carriers/usps/debug</data>
39+
<data key="scope_id">1</data>
40+
<data key="label">No</data>
41+
<data key="value">0</data>
42+
</entity>
43+
<entity name="AdminEnableShowMethodUSPSConfigData" type="usps_config">
44+
<data key="path">carriers/usps/showmethod</data>
45+
<data key="scope_id">1</data>
46+
<data key="label">Yes</data>
47+
<data key="value">1</data>
48+
</entity>
49+
<entity name="AdminDisableShowMethodUSPSConfigData" type="usps_config">
50+
<data key="path">carriers/usps/showmethod</data>
51+
<data key="scope_id">1</data>
52+
<data key="label">No</data>
53+
<data key="value">0</data>
54+
</entity>
55+
</entities>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminShippingMethodUSPSSection">
12+
<element name="USPSTab" type="button" selector="//div[@class='section-config']//div[@class='entry-edit-head admin__collapsible-block']//a[@id='carriers_usps-head']"/>
13+
<element name="handlingFeeUSPS" type="input" selector="//tr[@id='row_carriers_usps_handling_fee']//td//input[@id='carriers_usps_handling_fee']"/>
14+
<element name="enableCheckoutCheckboxUSPS" type="checkbox" selector="//tr[@id='row_carriers_usps_active']//td//input[@id='carriers_usps_active_inherit']"/>
15+
<element name="enableCheckoutSelectUSPS" type="select" selector="//tr[@id='row_carriers_usps_active']//td//select[@id='carriers_usps_active']"/>
16+
<element name="gatewayURLCheckboxUSPS" type="checkbox" selector="//tr[@id='row_carriers_usps_gateway_url']//td//input[@id='carriers_usps_gateway_url_inherit']"/>
17+
<element name="gatewayURLInputUSPS" type="input" selector="//tr[@id='row_carriers_usps_gateway_url']//td//input[@id='carriers_usps_gateway_url']"/>
18+
<element name="secureGatewayURLCheckboxUSPS" type="checkbox" selector="//tr[@id='row_carriers_usps_gateway_secure_url']//td//input[@id='carriers_usps_gateway_secure_url_inherit']"/>
19+
<element name="secureGatewayURLInputUSPS" type="input" selector="//tr[@id='row_carriers_usps_gateway_secure_url']//td//input[@id='carriers_usps_gateway_secure_url']"/>
20+
<element name="passwordUSPS" type="input" selector="//input[@id='carriers_usps_password']"/>
21+
<element name="usernameUSPS" type="input" selector="//input[@id='carriers_usps_userid']"/>
22+
<element name="USPSshowMethodIfNotApplicableField" type="select" selector="//tr[@id='row_carriers_usps_showmethod']//td//select[@id='carriers_usps_showmethod']"/>
23+
<element name="debugSelectUSPS" type="select" selector="//tr[@id='row_carriers_usps_debug']//td//select[@id='carriers_usps_debug']"/>
24+
</section>
25+
</sections>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="USPSShippingSuite">
10+
<before>
11+
<!--Login as Admin-->
12+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
13+
<!--Configure USPS shipping method-->
14+
<magentoCLI command="config:set {{AdminEnableUSPSConfigData.path}} {{AdminEnableUSPSConfigData.value}}" stepKey="enableUSPS"/>
15+
<magentoCLI command="config:set {{AdminUserIDUSPSConfigData.path}} {{AdminUserIDUSPSConfigData.value}}" stepKey="fillUserIDUSPS"/>
16+
<magentoCLI command="config:set {{AdminPasswordUSPSConfigData.path}} {{AdminPasswordUSPSConfigData.value}}" stepKey="fillPasswordUSPS"/>
17+
<magentoCLI command="config:set {{AdminEnableDebugUSPSConfigData.path}} {{AdminEnableDebugUSPSConfigData.value}}" stepKey="enableDebugUSPS"/>
18+
<magentoCLI command="config:set {{AdminEnableShowMethodUSPSConfigData.path}} {{AdminEnableShowMethodUSPSConfigData.value}}" stepKey="enableShowMethodUSPS"/>
19+
<!--Flush cache post configuration-->
20+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCachePostConfiguring">
21+
<argument name="tags" value="config full_page"/>
22+
</actionGroup>
23+
</before>
24+
<after>
25+
<!--Disable USPS shipping carrier-->
26+
<magentoCLI command="config:set {{AdminDisableUSPSConfigData.path}} {{AdminDisableUSPSConfigData.value}}" stepKey="disableUSPS"/>
27+
<magentoCLI command="config:set {{AdminDisableDebugUSPSConfigData.path}} {{AdminDisableDebugUSPSConfigData.value}}" stepKey="disableDebugUSPS"/>
28+
<magentoCLI command="config:set {{AdminDisableShowMethodUSPSConfigData.path}} {{AdminDisableShowMethodUSPSConfigData.value}}" stepKey="disableShowMethodUSPS"/>
29+
</after>
30+
<include>
31+
<group name="EnableUSPSShippingSuite"/>
32+
</include>
33+
</suite>
34+
</suites>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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="AdminPlaceOrderWithUSPSOnlineShippingCarrierTest">
12+
<annotations>
13+
<stories value="Place order using USPS Shipping carrier"/>
14+
<title value="Use USPS online shipping carrier during order placement in admin for registered customer Test"/>
15+
<description value="Select USPS online shipping method while order placement from backend for a registered customer"/>
16+
<testCaseId value="AC-5374"/>
17+
<severity value="MAJOR"/>
18+
<features value="Shipping"/>
19+
<group value="3rd_party_integration"/>
20+
<group value="EnableUSPSShippingSuite"/>
21+
<!-- <group value="pr_exclude"/>-->
22+
</annotations>
23+
<before>
24+
<!--Login as Admin-->
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminToConfig"/>
26+
<!-- Create product -->
27+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
28+
<field key="price">100.00</field>
29+
</createData>
30+
<!--Create UK customer-->
31+
<createData entity="UKCustomer" stepKey="createUKCustomer"/>
32+
<!-- Enabling Check/Money Order Payment Method -->
33+
<magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/>
34+
<!--Set US Shipping settings origin data-->
35+
<actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData">
36+
<argument name="country" value="United States"/>
37+
<argument name="state" value="Texas"/>
38+
<argument name="postcode" value="78729"/>
39+
</actionGroup>
40+
<!--Cache flush-->
41+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCachePostConfiguring">
42+
<argument name="tags" value="config full_page"/>
43+
</actionGroup>
44+
</before>
45+
<after>
46+
<!--Reset Shipping Origin configurations to default | default address - US California-->
47+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetShippingOriginConfig"/>
48+
<!--delete UK customer-->
49+
<deleteData createDataKey="createUKCustomer" stepKey="deleteCustomer"/>
50+
<!--delete product-->
51+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
52+
<!--Logout Admin-->
53+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminToRollBackConfig"/>
54+
</after>
55+
<!--Navigate to create new order with existing customer-->
56+
<actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
57+
<argument name="customer" value="$$createUKCustomer$$"/>
58+
</actionGroup>
59+
<!--Admin add simple product to order-->
60+
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder">
61+
<argument name="product" value="$$createSimpleProduct$$"/>
62+
</actionGroup>
63+
<!--Admin add new UK billing address while creating order-->
64+
<selectOption userInput="Add New Address" selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" stepKey="addNewBillingAddress" />
65+
<actionGroup ref="AdminFillAddressInformationInOrderActionGroup" stepKey="FillOrderNewShippingAddress">
66+
<argument name="customer" value="$$createUKCustomer$$"/>
67+
<argument name="address" value="UK_Not_Default_Address"/>
68+
</actionGroup>
69+
<!--Scroll to element & click to reflect details as per defined address & customer-->
70+
<scrollTo selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="scrollToElementInteractable"/>
71+
<click selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" stepKey="clickToReflectDetailsAccordingToInputData"/>
72+
<!--click on get available payment methods link-->
73+
<click selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" stepKey="clickGetAvailablePaymentMethods"/>
74+
<!--select Check/Money order payment method-->
75+
<conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOrderText}}" visible="false" stepKey="selectCheckMoneyOrder"/>
76+
<!--click on get shipping methods link-->
77+
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="clickGetAvailableShippingMethods"/>
78+
<!--select Priority Mail Express International Flat Rate USPS shipping method-->
79+
<click selector="{{AdminInvoicePaymentShippingSection.selectUSPSType}}" stepKey="selectUSPSMethod"/>
80+
<waitForAjaxLoad stepKey="waitForAjaxLoadPostSelectingUSPSShippingMethod"/>
81+
<!--click submit order-->
82+
<actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="clickSubmitOrder" />
83+
<!--Assert order created-->
84+
<actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="checkOrderSuccessfullyCreated"/>
85+
</test>
86+
</tests>

0 commit comments

Comments
 (0)