Skip to content

Commit 43ea443

Browse files
committed
ACQE-6584 : Customer Uses DHL EU Online Shipping Carrier On Checkout
created test file and some other files
1 parent 5184c06 commit 43ea443

File tree

7 files changed

+210
-0
lines changed

7 files changed

+210
-0
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
<element name="fptAmount" type="text" selector="//*[@id='cart-totals']//tr[@class='totals']//td[@class='amount']/span"/>
4343
<element name="canadaTaxAmount" type="text" selector="//span[@data-th='Canada-GST-5%']"/>
4444
<element name="canadaPstTaxAmount" type="text" selector="//span[@data-th='Canada-GST-PST-5%']"/>
45+
<element name="shippingMethods" type="text" selector="//label[text()='{{deliveryMethod}}']" parameterized="true"/>
4546
</section>
4647
</sections>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@
3737
<element name="shippingMethodFreeShippingLabel" type="text" selector="#label_carrier_freeshipping_freeshipping"/>
3838
<element name="shippingDHLErrorMessage" type="text" selector="#checkout-shipping-method-load .table-checkout-shipping-method tr.row-error .error div"/>
3939
<element name="smartPostShippingMethod" type="radio" selector="#checkout-shipping-method-load input[value='fedex_SMART_POST']"/>
40+
<element name="shippingMethodDhlExpressEasyLabel" type="text" selector="#label_method_8_dhl"/>
4041
</section>
4142
</sections>
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="AdminEnableDHLEUConfigurationActionGroup">
12+
<annotations>
13+
<description>Enables DHL EU shipping method on configuration page.</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminDHLEnableConfigData.path}} {{AdminDHLEnableConfigData.value}}" stepKey="enableDHL"/>
16+
<magentoCLI command="config:set {{AdminCarriersDHLId.path}} {{AdminCarriersDHLEUId.value}}" stepKey="CarrierDHLID"/>
17+
<magentoCLI command="config:set {{AdminCarriersDHLPassword.path}} {{AdminCarriersDHLEUPassword.value}}" stepKey="DHLPassword"/>
18+
<magentoCLI command="config:set {{AdminCarriersDHLAccount.path}} {{AdminCarriersDHLEUAccount.value}}" stepKey="DHLAccount"/>
19+
<magentoCLI command="config:set {{AdminEnableDHLShowMethod.path}} {{AdminEnableDHLShowMethod.value}}" stepKey="enableDHLShowMethod"/>
20+
<magentoCLI command="config:set {{AdminEnableDHLDebug.path}} {{AdminEnableDHLDebug.value}}" stepKey="enableDHLDebug"/>
21+
<magentoCLI command="config:set {{AdminEnableSandboxMode.path}} {{AdminEnableSandboxMode.value}}" stepKey="enableSandboxMode"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Config/Test/Mftf/Data/DHLConfigData.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,19 @@
9494
<data key="label">Pounds</data>
9595
<data key="value">L</data>
9696
</entity>
97+
<entity name="AdminCarriersDHLEUId">
98+
<data key="path">carriers/dhl/id</data>
99+
<data key="scope_id">1</data>
100+
<data key="value">EvgeniyDE</data>
101+
</entity>
102+
<entity name="AdminCarriersDHLEUPassword">
103+
<data key="path">carriers/dhl/password</data>
104+
<data key="scope_id">1</data>
105+
<data key="value">aplNb6Rop</data>
106+
</entity>
107+
<entity name="AdminCarriersDHLEUAccount">
108+
<data key="path">carriers/dhl/account</data>
109+
<data key="scope_id">1</data>
110+
<data key="value">130000279</data>
111+
</entity>
97112
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="StorefrontRegisteredCustomerUsesDHLEUOnlineShippingCarrierOnCheckoutTest">
12+
<annotations>
13+
<stories value="DHL Shipping Carrier On Checkout"/>
14+
<title value="Customer Uses DHL EU Online Shipping Carrier On Checkout"/>
15+
<description value="Testcase verifies On storefront customer successfully place an order using DHL(EU) shipping carrier"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6128"/>
18+
</annotations>
19+
<before>
20+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
21+
<createData entity="Customer_US_UK_DE" stepKey="createCustomer"/>
22+
<actionGroup ref="AdminSetShippingOriginConfigForStateFieldActionGroup" stepKey="setShippingOriginConfiguration">
23+
<argument name="country" value="United Kingdom"/>
24+
<argument name="postcode" value="IP16 4HD"/>
25+
<argument name="stateField" value="Suffolk"/>
26+
</actionGroup>
27+
<actionGroup ref="AdminNavigateToCurrencySetupPageActionGroup" stepKey="goToCurrencySetupPage"/>
28+
<!--Open currency options and select singapore dollar as allowed currency-->
29+
<conditionalClick selector="{{AdminConfigSection.currencyOptionsTab}}" dependentSelector="{{AdminConfigSection.defaultCurrencySelect}}" visible="false" stepKey="openCurrencyOptionsTab"/>
30+
<selectOption selector="{{AdminConfigSection.allowedCurrencies}}" parameterArray="['British Pound', 'US Dollar']" stepKey="selectAllowedCurrency"/>
31+
<actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration"/>
32+
<!-- go to currency rate page and fill currency rate -->
33+
<actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="naviagteToCurrencyRatesPage"/>
34+
<actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates">
35+
<argument name="firstCurrency" value="USD"/>
36+
<argument name="secondCurrency" value="GBP"/>
37+
<argument name="rate" value="0.9"/>
38+
</actionGroup>
39+
<!--Create simple product-->
40+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
41+
<!-- Create configurable product with two options -->
42+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"/>
43+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
44+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption">
45+
<requiredEntity createDataKey="createConfigProductAttribute"/>
46+
</createData>
47+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
48+
<requiredEntity createDataKey="createConfigProductAttribute"/>
49+
</createData>
50+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption">
51+
<requiredEntity createDataKey="createConfigProductAttribute"/>
52+
</getData>
53+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct">
54+
<requiredEntity createDataKey="createConfigProductAttribute"/>
55+
<requiredEntity createDataKey="getConfigAttributeOption"/>
56+
</createData>
57+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
58+
<requiredEntity createDataKey="createConfigProduct"/>
59+
<requiredEntity createDataKey="createConfigProductAttribute"/>
60+
<requiredEntity createDataKey="getConfigAttributeOption"/>
61+
</createData>
62+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChildOne">
63+
<requiredEntity createDataKey="createConfigProduct"/>
64+
<requiredEntity createDataKey="createConfigChildProduct"/>
65+
</createData>
66+
<!--Create Bundle product with multi select option-->
67+
<createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"/>
68+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1_1">
69+
<requiredEntity createDataKey="createBundleProduct"/>
70+
<field key="required">True</field>
71+
</createData>
72+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
73+
<requiredEntity createDataKey="createBundleProduct"/>
74+
<requiredEntity createDataKey="createBundleOption1_1"/>
75+
<requiredEntity createDataKey="createSimpleProduct"/>
76+
</createData>
77+
<actionGroup ref="AdminEnableDHLEUConfigurationActionGroup" stepKey="enableDHL"/>
78+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
79+
<argument name="indices" value=""/>
80+
</actionGroup>
81+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
82+
<argument name="tags" value="config full_page"/>
83+
</actionGroup>
84+
</before>
85+
<after>
86+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
87+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
88+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
89+
<deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/>
90+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
91+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
92+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
93+
<!-- Reset shipping origin -->
94+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetCaliforniaShippingOrigin"/>
95+
<actionGroup ref="AdminDisableDHLConfigurationActionGroup" stepKey="resetDhlConfig"/>
96+
<!-- unselect sgd as a allowed currency -->
97+
<actionGroup ref="AdminNavigateToCurrencySetupPageActionGroup" stepKey="againGoToCurrencySetupPage"/>
98+
<!--Open currency options and select singapore dollar as allowed currency-->
99+
<conditionalClick selector="{{AdminConfigSection.currencyOptionsTab}}" dependentSelector="{{AdminConfigSection.defaultCurrencySelect}}" visible="false" stepKey="openCurrencyOptions"/>
100+
<selectOption selector="{{AdminConfigSection.allowedCurrencies}}" parameterArray="['US Dollar']" stepKey="UnselectAllowedCurrency"/>
101+
<actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveConfiguration"/>
102+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
103+
</after>
104+
<!--Login to storefront from customer-->
105+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
106+
<argument name="Customer" value="$$createCustomer$$"/>
107+
</actionGroup>
108+
<!-- Add bundle product to cart -->
109+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openBundleProductPage">
110+
<argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$" />
111+
</actionGroup>
112+
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addBundleProductToCart">
113+
<argument name="productName" value="$createBundleProduct.name$"/>
114+
</actionGroup>
115+
<!-- Add simple product to cart -->
116+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
117+
<argument name="product" value="$$createSimpleProduct$$"/>
118+
</actionGroup>
119+
<!-- Add Configurable Product to cart -->
120+
<actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart">
121+
<argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" />
122+
<argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/>
123+
<argument name="productOption" value="$$getConfigAttributeOption.value$$"/>
124+
<argument name="qty" value="1"/>
125+
</actionGroup>
126+
<!-- Go to Shopping Cart -->
127+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartIndexPage"/>
128+
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openEstimateShippingAndTaxSection"/>
129+
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields">
130+
<argument name="address" value="DE_Address_Berlin_Not_Default_Address"/>
131+
</actionGroup>
132+
<waitForElement selector="{{CheckoutCartSummarySection.shippingMethods('Express 12:00')}}" stepKey="verifyExpress12IsAvailable"/>
133+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/>
134+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodDhlExpressTwelveLabel}}" stepKey="waitForShippingDhlExpressTwelveLabelVisible"/>
135+
<click selector="{{CheckoutShippingMethodsSection.shippingMethodDhlExpressEasyLabel}}" stepKey="selectExpressTwelveRadioButton"/>
136+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickOnNextButton"/>
137+
<!-- Checkout select Check/Money Order payment -->
138+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
139+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/>
140+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
141+
<!--navigate to orders grid-->
142+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToAdminSalesOrders"/>
143+
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById">
144+
<argument name="orderId" value="{$grabOrderNumber}"/>
145+
</actionGroup>
146+
<waitForText selector="{{AdminOrdersGridSection.firstRow}}" userInput="$grabOrderNumber" stepKey="seeOrderIdInGrid"/>
147+
</test>
148+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminSetShippingOriginConfigForStateFieldActionGroup" extends="AdminSetShippingOriginConfigActionGroup">
12+
<annotations>
13+
<description>Admin Set shipping origin for custom address details on origin page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="stateField" type="string" defaultValue="Central"/>
17+
</arguments>
18+
<remove keyForRemoval="SelectState"/>
19+
<fillField selector="{{AdminShippingSettingsConfigSection.stateField}}" userInput="{{stateField}}" stepKey="fillStateField" after="WaitForUncheckStateSystemValue"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Shipping/Test/Mftf/Section/AdminShippingSettingsConfigSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
<element name="shippingPolicyParametersOpened" type="block" selector="#shipping_shipping_policy-head.open" timeout="30"/>
2222
<element name="shippingPolicy" type="block" selector="#row_shipping_shipping_policy_shipping_policy_content"/>
2323
<element name="dropdownShippingPolicy" type="select" selector="#row_shipping_shipping_policy_enable_shipping_policy select"/>
24+
<element name="stateField" type="input" selector="input[name='groups[origin][fields][region_id][value]']"/>
2425
</section>
2526
</sections>

0 commit comments

Comments
 (0)