Skip to content

Commit f983abf

Browse files
ACQE-5761 : Available shipping rate is changed on fly according to inputed data
1 parent 881ca23 commit f983abf

13 files changed

+339
-3
lines changed
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: 18 additions & 0 deletions
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="VerifyShippingMethodIsVisibilityOrNotActionGroup">
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>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,14 @@
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"/>
2938
</section>
3039
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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="StorefrontGuestCheckoutForAvailableShippingRateChangeToInputDataTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Checkout via 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="AVERAGE"/>
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="AdminFreeShippingActionGroup" stepKey="freeShippingConfig">
33+
<argument name="enabled" value="Yes"/>
34+
<argument name="allowSpecificCountry" value="Specific Countries"/>
35+
<argument name="specificCountry" value="Afghanistan"/>
36+
</actionGroup>
37+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/>
38+
<!-- DHL Shipping Configuration -->
39+
<actionGroup ref="AdminDHLConfigurationActionGroup" stepKey="dhlConfig">
40+
<argument name="enabled" value="Yes"/>
41+
<argument name="config" value="dhlConfigData"/>
42+
<argument name="allowSpecificCountry" value="Specific Countries"/>
43+
<argument name="specificCountry" value="United Kingdom"/>
44+
<argument name="showMethod" value="Yes"/>
45+
<argument name="debug" value="Yes"/>
46+
<argument name="sandbox" value="Yes"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigurationForDHL"/>
49+
<!--Set Shipping settings origin data-->
50+
<actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData">
51+
<argument name="country" value="United States"/>
52+
<argument name="state" value="California"/>
53+
<argument name="postcode" value="90034"/>
54+
</actionGroup>
55+
</before>
56+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCachePostChangingConfigurationSettings">
57+
<argument name="tags" value="config"/>
58+
</actionGroup>
59+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPostChangingConfigurationSettings">
60+
<argument name="indices" value=""/>
61+
</actionGroup>
62+
<!-- Go to storefront page to add product -->
63+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
64+
<waitForPageLoad stepKey="waitForProductPage"/>
65+
<!-- Add Simple product in the cart -->
66+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart">
67+
<argument name="product" value="$createSimpleProduct$"/>
68+
</actionGroup>
69+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
70+
<!-- Guest checkout -->
71+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="goToShippingAndFillDetails">
72+
<argument name="customerAddress" value="US_CA_Address"/>
73+
</actionGroup>
74+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="California" stepKey="fillStateField"/>
75+
<waitForPageLoad stepKey="waitForChangeAfterStateLoad"/>
76+
<actionGroup ref="VerifyShippingMethodIsVisibilityOrNotActionGroup" stepKey="verifyShippingMethod"/>
77+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisible"/>
78+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterStateChange"/>
79+
<!-- Change country value -->
80+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="fillCountryField"/>
81+
<waitForPageLoad stepKey="waitForChangeAfterCountryLoad"/>
82+
<actionGroup ref="VerifyShippingMethodIsVisibilityOrNotActionGroup" 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+
<!-- Fill New Data for checkout page -->
88+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="United Kingdom" stepKey="fillCountry"/>
89+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="London" stepKey="fillCity"/>
90+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="N14 5JP" stepKey="fillPostcode"/>
91+
<actionGroup ref="VerifyShippingMethodIsVisibilityOrNotActionGroup" stepKey="verifyShippingMethodAfterNewData"/>
92+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterNewFormData"/>
93+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterNewFormData"/>
94+
<actionGroup ref="VerifyDHLShippingMethodIsVisibilityActionGroup" stepKey="dhlShippingVisibility"/>
95+
<after>
96+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
97+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
98+
<!-- Disable flat rate method -->
99+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
100+
<!-- Reset shipping origin -->
101+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="ResetCaliforniaShippingOrigin"/>
102+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="shippingMethodConfigPage"/>
103+
<!-- Reset free shipping origin -->
104+
<actionGroup ref="AdminDisableFreeShippingActionGroup" stepKey="resetFreeShippingConfig"/>
105+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfiguration"/>
106+
<!-- Reset dhl configuration origin -->
107+
<actionGroup ref="AdminDHLConfigurationActionGroup" stepKey="resetDhlConfig"/>
108+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfigurationForDHL"/>
109+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
110+
</after>
111+
</test>
112+
</tests>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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="AdminDHLConfigurationActionGroup">
12+
<arguments>
13+
<argument name="enabled" type="string" defaultValue="No"/>
14+
<argument name="config" defaultValue="dhlConfigData"/>
15+
<argument name="allowSpecificCountry" type="string" defaultValue="Specific Countries"/>
16+
<argument name="specificCountry" type="string" defaultValue="United Kingdom"/>
17+
<argument name="showMethod" type="string" defaultValue="No"/>
18+
<argument name="debug" type="string" defaultValue="No"/>
19+
<argument name="sandbox" type="string" defaultValue="No"/>
20+
</arguments>
21+
<conditionalClick selector="{{AdminShippingMethodDHLSection.carriersDHLTab}}" dependentSelector="{{AdminShippingMethodDHLSection.carriersDHLTabOpen}}" visible="false" stepKey="toggleClick"/>
22+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLActive}}" stepKey="waitForCarriersDHLActiveCheckbox"/>
23+
<uncheckOption selector="{{AdminShippingMethodDHLSection.carriersDHLActive}}" stepKey="clickOnFreeShippingCheckbox"/>
24+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSelectBox}}" userInput="{{enabled}}" stepKey="selectOptionForDHLEnabled"/>
25+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLAccessId}}" stepKey="waitForDHLAccessID"/>
26+
<fillField selector="{{AdminShippingMethodDHLSection.carriersDHLAccessId}}" userInput="{{config.access_id}}" stepKey="fillDHLAccessID"/>
27+
<fillField selector="{{AdminShippingMethodDHLSection.carriersDHLPassword}}" userInput="{{config.password}}" stepKey="fillDHLPassword"/>
28+
<uncheckOption selector="{{AdminShippingMethodDHLSection.carriersDHLAccount}}" stepKey="clickOnDHLAccount"/>
29+
<fillField selector="{{AdminShippingMethodDHLSection.carriersDHLAccountField}}" userInput="{{config.account_number}}" stepKey="fillDHLAccountNumber"/>
30+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLAllowSpecific}}" stepKey="waitForDHLAllowSpecific"/>
31+
<uncheckOption selector="{{AdminShippingMethodDHLSection.carriersDHLAllowSpecific}}" stepKey="clickOnDHLAllowSpecific"/>
32+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSelectAllowSpecific}}" userInput="{{allowSpecificCountry}}" stepKey="selectOptionForAllowSpecificCountry"/>
33+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSpecificCountry}}" userInput="{{specificCountry}}" stepKey="selectOptionForSpecificCountries"/>
34+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLShowMethod}}" userInput="{{showMethod}}" stepKey="selectOptionForShowMethod"/>
35+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLDebug}}" userInput="{{debug}}" stepKey="selectOptionForDebug"/>
36+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSandbox}}" userInput="{{sandbox}}" stepKey="selectOptionForSandbox"/>
37+
</actionGroup>
38+
</actionGroups>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="AdminDHLConfigurationActionGroup">
12+
<arguments>
13+
<argument name="enabled" type="string" defaultValue="No"/>
14+
<argument name="config" defaultValue="dhlConfigData"/>
15+
<argument name="allowSpecificCountry" type="string" defaultValue="Specific Countries"/>
16+
<argument name="specificCountry" type="string" defaultValue="United Kingdom"/>
17+
<argument name="showMethod" type="string" defaultValue="No"/>
18+
<argument name="debug" type="string" defaultValue="No"/>
19+
<argument name="sandbox" type="string" defaultValue="No"/>
20+
</arguments>
21+
<conditionalClick selector="{{AdminShippingMethodDHLSection.carriersDHLTab}}" dependentSelector="{{AdminShippingMethodDHLSection.carriersDHLTabOpen}}" visible="false" stepKey="toggleClick"/>
22+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLSelectBox}}" stepKey="waitForCarriersDHLActiveCheckbox"/>
23+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSelectBox}}" userInput="{{enabled}}" stepKey="selectOptionForDHLEnabled"/>
24+
<checkOption selector="{{AdminShippingMethodDHLSection.carriersDHLActive}}" stepKey="clickOnFreeShippingCheckbox"/>
25+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLAccessId}}" stepKey="waitForDHLAccessID"/>
26+
<fillField selector="{{AdminShippingMethodDHLSection.carriersDHLAccessId}}" userInput="{{config.access_id}}" stepKey="fillDHLAccessID"/>
27+
<fillField selector="{{AdminShippingMethodDHLSection.carriersDHLPassword}}" userInput="{{config.password}}" stepKey="fillDHLPassword"/>
28+
<fillField selector="{{AdminShippingMethodDHLSection.carriersDHLAccountField}}" userInput="{{config.account_number}}" stepKey="fillDHLAccountNumber"/>
29+
<checkOption selector="{{AdminShippingMethodDHLSection.carriersDHLAccount}}" stepKey="clickOnDHLAccount"/>
30+
<waitForElementVisible selector="{{AdminShippingMethodDHLSection.carriersDHLSelectAllowSpecific}}" stepKey="waitForDHLAllowSpecific"/>
31+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSelectAllowSpecific}}" userInput="{{allowSpecificCountry}}" stepKey="selectOptionForAllowSpecificCountry"/>
32+
<uncheckOption selector="{{AdminShippingMethodDHLSection.carriersDHLAllowSpecific}}" stepKey="clickOnDHLAllowSpecific"/>
33+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLShowMethod}}" userInput="{{showMethod}}" stepKey="selectOptionForShowMethod"/>
34+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLDebug}}" userInput="{{debug}}" stepKey="selectOptionForDebug"/>
35+
<selectOption selector="{{AdminShippingMethodDHLSection.carriersDHLSandbox}}" userInput="{{sandbox}}" stepKey="selectOptionForSandbox"/>
36+
</actionGroup>
37+
</actionGroups>

0 commit comments

Comments
 (0)