Skip to content

Commit 26b7c5a

Browse files
akaashakaash
authored andcommitted
Merge branch 'ACQE-5761' into ACQE-6098-functional-mainline-ce
2 parents 316e3ac + ad91456 commit 26b7c5a

13 files changed

+337
-3
lines changed
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="CheckForFlatRateShippingMethodAvailabilityActionGroup">
12+
<annotations>
13+
<description>Validates that the Shipping method is visible in the checkout page or not.</description>
14+
</annotations>
15+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRateLabel}}" stepKey="waitForFlatRateLabelVisible"/>
16+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRatePriceVisible"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="VerifyDHLShippingMethodIsVisibilityActionGroup">
12+
<annotations>
13+
<description>Validates that the DHL Shipping method is visible in the checkout page.</description>
14+
</annotations>
15+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpressLabel}}" stepKey="waitForShippingDHLWorldWideExpressLabelVisible"/>
16+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForShippingDHLPriceVisible"/>
17+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlExpressTwelveLabel}}" stepKey="waitForShippingDhlExpressTwelveLabelVisible"/>
18+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlExpressTwelve}}" stepKey="waitForShippingDhlExpressTwelveVisible"/>
19+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlMedicalExpressLabel}}" stepKey="waitForShippingDhlMedicalExpressLabelVisible"/>
20+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlMedicalExpress}}" stepKey="waitForShippingDhlMedicalExpressVisible"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminShippingMethodDHLSection">
12+
<element name="carriersDHLSelectAllowSpecific" type="input" selector="#carriers_dhl_sallowspecific"/>
13+
<element name="carriersDHLAccountField" type="input" selector="#carriers_dhl_account"/>
14+
<element name="carriersDHLSelectBox" type="input" selector="#carriers_dhl_active"/>
15+
<element name="carriersDHLTabOpen" type="button" selector="#carriers_dhl-head.open"/>
16+
<element name="carriersDHLShowMethod" type="input" selector="#carriers_dhl_showmethod"/>
17+
<element name="carriersDHLDebug" type="input" selector="#carriers_dhl_debug"/>
18+
<element name="carriersDHLSandbox" type="input" selector="#carriers_dhl_sandbox_mode"/>
19+
</section>
20+
</sections>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,15 @@
2626
<element name="showShippingVatNumber" type="text" selector="div.shipping-address-item"/>
2727
<element name="showBillingVatNumber" type="text" selector="div.billing-address-details"/>
2828
<element name="showShippingInfoVatNumber" type="text" selector="div.shipping-information-content"/>
29+
<element name="shippingMethodDhlLabel" type="text" selector="#label_carrier_null_dhl"/>
30+
<element name="shippingMethodFlatRateLabel" type="text" selector="#label_carrier_flatrate_flatrate"/>
31+
<element name="shippingMethodDhlWorldWideExpressLabel" type="text" selector="#label_method_P_dhl"/>
32+
<element name="shippingMethodDhlWorldWideExpress" type="radio" selector="#checkout-shipping-method-load input[value='dhl_P']"/>
33+
<element name="shippingMethodDhlExpressTwelveLabel" type="text" selector="#label_method_Y_dhl"/>
34+
<element name="shippingMethodDhlExpressTwelve" type="radio" selector="#checkout-shipping-method-load input[value='dhl_Y']"/>
35+
<element name="shippingMethodDhlMedicalExpressLabel" type="text" selector="#label_method_Q_dhl"/>
36+
<element name="shippingMethodDhlMedicalExpress" type="radio" selector="#checkout-shipping-method-load input[value='dhl_Q']"/>
37+
<element name="shippingMethodFreeShippingLabel" type="text" selector="#label_carrier_freeshipping_freeshipping"/>
38+
<element name="shippingDHLErrorMessage" type="text" selector="#checkout-shipping-method-load .table-checkout-shipping-method tr.row-error .error div"/>
2939
</section>
3040
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StoreFrontValidateDynamicChangeOfShippingRateForGuestUserTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Shipping rate in Guest Checkout"/>
14+
<title value="Guest Checkout - guest should be able to see the change in the shipping rate on fly."/>
15+
<description value="Should be able to change the shipping rate while changing the input data based on the specific country and zipcode."/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6139"/>
18+
</annotations>
19+
<before>
20+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
21+
<!-- Enabling Flat Rate -->
22+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
23+
<!-- Creating subcategory -->
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
<!-- Creating Simple Product -->
26+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<!-- Go to Store > Configuration > Sales > Shipping Methods -->
30+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/>
31+
<!-- Free Shipping Configuration -->
32+
<actionGroup ref="AdminEnableFreeShippingActionGroup" stepKey="freeShippingConfig">
33+
<argument name="allowSpecificCountry" value="Specific Countries"/>
34+
<argument name="specificCountry" value="Afghanistan"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/>
37+
<!-- DHL Shipping Configuration -->
38+
<actionGroup ref="AdminEnableDHLConfigurationActionGroup" stepKey="dhlConfig">
39+
<argument name="config" value="dhlConfigData"/>
40+
<argument name="allowSpecificCountry" value="Specific Countries"/>
41+
<argument name="specificCountry" value="United Kingdom"/>
42+
<argument name="showMethod" value="Yes"/>
43+
<argument name="debug" value="Yes"/>
44+
<argument name="sandbox" value="Yes"/>
45+
</actionGroup>
46+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigurationForDHL"/>
47+
<!--Set Shipping settings origin data-->
48+
<actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData">
49+
<argument name="country" value="United States"/>
50+
<argument name="state" value="California"/>
51+
<argument name="postcode" value="90034"/>
52+
</actionGroup>
53+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCachePostChangingConfigurationSettings">
54+
<argument name="tags" value="config"/>
55+
</actionGroup>
56+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPostChangingConfigurationSettings">
57+
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
58+
</actionGroup>
59+
</before>
60+
<!-- Go to storefront page to add product -->
61+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
62+
<waitForPageLoad stepKey="waitForProductPage"/>
63+
<!-- Add Simple product in the cart -->
64+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart">
65+
<argument name="product" value="$createSimpleProduct$"/>
66+
</actionGroup>
67+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToShippingPage"/>
68+
<!-- Guest checkout -->
69+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="goToShippingAndFillDetails">
70+
<argument name="customerAddress" value="US_CA_Address"/>
71+
</actionGroup>
72+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="California" stepKey="fillStateField"/>
73+
<waitForPageLoad stepKey="waitForChangeAfterStateLoad"/>
74+
<actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethod"/>
75+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisible"/>
76+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterStateChange"/>
77+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingNotVisible"/>
78+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelNotVisible"/>
79+
<!-- Change country value -->
80+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="fillCountryField"/>
81+
<waitForPageLoad stepKey="waitForChangeAfterCountryLoad"/>
82+
<actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterCountryChange"/>
83+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterCountryChange"/>
84+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterCountryChange"/>
85+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisibleAfterCountryChange"/>
86+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterCountryChange"/>
87+
<waitForText selector="{{CheckoutShippingMethodsSection.shippingDHLErrorMessage}}" userInput="This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us." stepKey="seeDhlErrorMessage"/>
88+
<!-- Fill New Data for checkout page -->
89+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="United Kingdom" stepKey="fillCountry"/>
90+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="London" stepKey="fillCity"/>
91+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="N14 5JP" stepKey="fillPostcode"/>
92+
<actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterNewData"/>
93+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterNewFormData"/>
94+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterNewFormData"/>
95+
<actionGroup ref="VerifyDHLShippingMethodIsVisibilityActionGroup" stepKey="dhlShippingVisibility"/>
96+
<after>
97+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
98+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
99+
<!-- Disable flat rate method -->
100+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
101+
<!-- Reset shipping origin -->
102+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="ResetCaliforniaShippingOrigin"/>
103+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="shippingMethodConfigPage"/>
104+
<!-- Reset free shipping origin -->
105+
<actionGroup ref="AdminDisableFreeShippingActionGroup" stepKey="resetFreeShippingConfig"/>
106+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfiguration"/>
107+
<!-- Reset dhl configuration origin -->
108+
<actionGroup ref="AdminDisableDHLConfigurationActionGroup" stepKey="resetDhlConfig"/>
109+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfigurationForDHL"/>
110+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
111+
</after>
112+
</test>
113+
</tests>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminDisableDHLConfigurationActionGroup">
12+
<conditionalClick selector="{{AdminShippingMethodDHLSection.carriersDHLTab}}" dependentSelector="{{AdminShippingMethodDHLSection.carriersDHLTabOpen}}" visible="false" stepKey="openDHLSection"/>
13+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLSelectBox}}" stepKey="waitForCarriersDHLActiveCheckbox"/>
14+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSelectBox}}" userInput="No" stepKey="selectOptionForDHLEnabled"/>
15+
<checkOption selector="{{AdminShippingMethodDHLSection.carriersDHLActive}}" stepKey="clickOnFreeShippingCheckbox"/>
16+
<checkOption selector="{{AdminShippingMethodDHLSection.carriersDHLAccount}}" stepKey="clickOnDHLAccount"/>
17+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLSelectAllowSpecific}}" stepKey="waitForDHLAllowSpecific"/>
18+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSelectAllowSpecific}}" userInput="All Allowed Countries" stepKey="selectOptionForAllowSpecificCountry"/>
19+
<checkOption selector="{{AdminShippingMethodDHLSection.carriersDHLAllowSpecific}}" stepKey="clickOnDHLAllowSpecific"/>
20+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLShowMethod}}" userInput="No" stepKey="selectOptionForShowMethod"/>
21+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLDebug}}" userInput="No" stepKey="selectOptionForDebug"/>
22+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSandbox}}" userInput="No" stepKey="selectOptionForSandbox"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminDisableFreeShippingActionGroup">
12+
<conditionalClick selector="{{AdminShippingMethodFreeShippingSection.carriersFreeShippingSectionHead}}" dependentSelector="{{AdminShippingMethodFreeShippingSection.carriersFreeShippingSectionHeadOpen}}" visible="false" stepKey="openFreeShippingSection"/>
13+
<waitForElementVisible selector="{{AdminShippingMethodFreeShippingSection.carriersSelectFreeShippingActive}}" stepKey="waitForFreeShippingDefaultCheckbox"/>
14+
<selectOption selector="{{AdminShippingMethodFreeShippingSection.carriersSelectFreeShippingActive}}" userInput="No" stepKey="selectOptionForFreeShipping"/>
15+
<checkOption selector="{{AdminShippingMethodFreeShippingSection.carriersFreeShippingActive}}" stepKey="clickOnFreeShippingCheckbox"/>
16+
<waitForElementVisible selector="{{AdminShippingMethodFreeShippingSection.carriersFreeShippingSelectAllowSpecific}}" stepKey="waitForShipApplicableDefaultCheckbox"/>
17+
<selectOption selector="{{AdminShippingMethodFreeShippingSection.carriersFreeShippingSelectAllowSpecific}}" userInput="All Allowed Countries" stepKey="selectOptionForAllowSpecificCountries"/>
18+
<checkOption selector="{{AdminShippingMethodFreeShippingSection.carriersFreeShippingAllowSpecific}}" stepKey="clickOnShipApplicaleCountries"/>
19+
</actionGroup>
20+
</actionGroups>

0 commit comments

Comments
 (0)