Skip to content

Commit d5ac23f

Browse files
“Pavan-bj”“Pavan-bj”
authored andcommitted
ACQE-7156/ACQE-7159 Verify UPS shipping on UI during checkout if UK country is selected with entering zip code and verfiy without entering zipcode
1 parent 7ead0dc commit d5ac23f

6 files changed

+209
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
8-
98
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1110
<section name="CheckoutCartSummarySection">
@@ -42,5 +41,7 @@
4241
<element name="fptAmount" type="text" selector="//*[@id='cart-totals']//tr[@class='totals']//td[@class='amount']/span"/>
4342
<element name="canadaTaxAmount" type="text" selector="//span[@data-th='Canada-GST-5%']"/>
4443
<element name="canadaPstTaxAmount" type="text" selector="//span[@data-th='Canada-GST-PST-5%']"/>
44+
<element name="verifyErrorMessageOfShippingMethod" type="text" selector="//div[@data-bind='text: error_message']"/>
45+
<element name="upsShippingMethod" type="input" selector="#s_method_ups_08"/>
4546
</section>
4647
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="StorefrontCheckoutCartFillEstimateShippingAndTaxInShoppingCartActionGroup" extends="StorefrontCheckoutCartFillEstimateShippingAndTaxActionGroup">
12+
<annotations>
13+
<description>EXTENDS: StorefrontCheckoutCartFillEstimateShippingAndTaxActionGroup. Removes 'selectState' replace selectOption to fill field.</description>
14+
</annotations>
15+
16+
<remove keyForRemoval="selectState"/>
17+
<waitForElementVisible selector="{{CheckoutCartSummarySection.stateProvinceInput}}" after="selectCountry" stepKey="waitForStateVisible"/>
18+
<fillField selector="{{CheckoutCartSummarySection.stateProvinceInput}}" userInput="{{state}}" after="waitForStateVisible" stepKey="fillState"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontCheckoutCartFillEstimateShippingAndTaxWithoutZipCodeActionGroup">
12+
<annotations>
13+
<description>Fill address data in Estimate Shipping And Tax section of shopping cart on storefront without zip code</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country}}"/>
17+
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
18+
</arguments>
19+
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openEestimateShippingAndTaxSection"/>
20+
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{country}}" stepKey="selectCountry"/>
21+
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{state}}" stepKey="selectState"/>
22+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="AdminConfigUPSShippingMethodAndAddProductInStorefrontTest">
12+
<annotations>
13+
<stories value="Admin configure UPS Shipping method"/>
14+
<title value="Admin configure UPS Shipping method and add product to cart in storefront "/>
15+
<description value="Admin configure UPS Shipping method and add product to cart in storefront >> open mini cart"/>
16+
<features value="Shipping"/>
17+
<severity value="MINOR"/>
18+
<group value="3rd_party_integration"/>
19+
<!-- <group value="pr_exclude"/>-->
20+
</annotations>
21+
<before>
22+
<!--Login as Admin-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminToConfig"/>
24+
<!-- Create product -->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
26+
<field key="price">100.00</field>
27+
</createData>
28+
<!--Navigate to shipping method configuration for enabling UPS-->
29+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPageForEnablingUPS"/>
30+
<!--Configure UPS shipping method with enable for checkout = Yes-->
31+
<actionGroup ref="AdminEnableUPSActionGroup" stepKey="enableUPSShippingMethod">
32+
<argument name="shipping" value="UPSShippingMethod"/>
33+
</actionGroup>
34+
<!--Cache flush-->
35+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCachePostConfiguring">
36+
<argument name="tags" value="config full_page"/>
37+
</actionGroup>
38+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
39+
<argument name="indices" value=""/>
40+
</actionGroup>
41+
</before>
42+
<after>
43+
<!--delete product-->
44+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
45+
<!--Configure UPS shipping method with enable for checkout = No-->
46+
<actionGroup ref="AdminUPSDisableActionGroup" stepKey="disableUPSShippingMethod"/>
47+
<!--Logout Admin-->
48+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminToRollBackConfig"/>
49+
</after>
50+
<!-- Navigate to StoreFront -->
51+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
52+
<!-- Add product to cart -->
53+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
54+
<argument name="product" value="$$createSimpleProduct$$"/>
55+
</actionGroup>
56+
<!-- Go to Shopping Cart -->
57+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart1"/>
58+
</test>
59+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="AdminVerifyUPSShippingDuringCheckoutWithUKCountrySelectedWithEnteringZipCodeTest" extends="AdminConfigUPSShippingMethodAndAddProductInStorefrontTest">
12+
<annotations>
13+
<stories value="Verify UPS Shipping in checkout with entering zip code"/>
14+
<title value="Verify UPS shipping on UI during checkout if UK country is selected with entering zip code"/>
15+
<description value="Admin Verify in storefront UPS shipping on UI during checkout if UK country is selected with entering zip code"/>
16+
<testCaseId value="AC-9343"/>
17+
<severity value="MINOR"/>
18+
<features value="Shipping"/>
19+
<group value="3rd_party_integration"/>
20+
<!-- <group value="pr_exclude"/>-->
21+
</annotations>
22+
<!-- Open Estimate Shipping and Tax section for united Kingdom-->
23+
<actionGroup ref="StorefrontCheckoutCartFillEstimateShippingAndTaxInShoppingCartActionGroup" stepKey="setEstimateShippingAndTaxInitialAddressToUnitedKingdomWithZipCode">
24+
<argument name="country" value="United Kingdom"/>
25+
<argument name="state" value="Bristol"/>
26+
<argument name="postcode" value="BS10"/>
27+
</actionGroup>
28+
<!-- Verify UPS shipping method is available for united Kingdom with zipcode -->
29+
<!-- Verify no errors are displayed and UPS shipping method is available -->
30+
<waitForElementVisible selector="{{CheckoutCartSummarySection.upsShippingMethod}}" stepKey="verifyUPSShippingMethodIsAvailable"/>
31+
<waitForElementNotVisible selector="{{CheckoutCartSummarySection.verifyErrorMessageOfShippingMethod}}" stepKey="verifyNoErrorMessageRelatedToUPSShippingMethod"/>
32+
<!-- Set Estimate Shipping And Tax Initial Address To United Kingdom Without ZipCode-->
33+
<actionGroup ref="StorefrontCheckoutCartFillEstimateShippingAndTaxInShoppingCartActionGroup" stepKey="changeTheZipCodeAndVerifyUPSShippingMethodIsAvailable">
34+
<argument name="country" value="United Kingdom"/>
35+
<argument name="state" value="Bristol"/>
36+
<argument name="postcode" value="BS11"/>
37+
</actionGroup>
38+
<!-- Verify no errors are displayed and UPS shipping method is available again -->
39+
<waitForElementVisible selector="{{CheckoutCartSummarySection.upsShippingMethod}}" stepKey="verifyUPSShippingMethodIsAvailableAgain"/>
40+
<waitForElementNotVisible selector="{{CheckoutCartSummarySection.verifyErrorMessageOfShippingMethod}}" stepKey="verifyNoErrorMessageRelatedToUPSShippingMethodAgain"/>
41+
<!-- Select other shipping method available -->
42+
<waitForElement selector="{{CheckoutCartSummarySection.upsShippingMethod}}" stepKey="waitForUPSShippingMethod"/>
43+
<click selector="{{CheckoutCartSummarySection.upsShippingMethod}}" stepKey="selectUPSShippingMethod"/>
44+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
45+
<!--Fill Shipping Address-->
46+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillShippingAddress"/>
47+
<waitForPageLoad stepKey="waitForShippingPageToLoad"/>
48+
<!-- Click Next button -->
49+
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/>
50+
<!-- Checkout select Check/Money Order payment -->
51+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
52+
<!--Place order-->
53+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
54+
</test>
55+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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="AdminVerifyUPSShippingDuringCheckoutWithUKCountrySelectedWithoutEnteringZipCodeTest" extends="AdminConfigUPSShippingMethodAndAddProductInStorefrontTest">
12+
<annotations>
13+
<stories value="Verify UPS Shipping in checkout without entering zip code"/>
14+
<title value="Verify UPS shipping on UI during checkout if UK country is selected without entering zip code"/>
15+
<description value="Admin Verify in storefront UPS shipping on UI during checkout if UK country is selected without entering zip code"/>
16+
<testCaseId value="AC-9344"/>
17+
<severity value="MINOR"/>
18+
<features value="Shipping"/>
19+
<group value="3rd_party_integration"/>
20+
<!-- <group value="pr_exclude"/>-->
21+
</annotations>
22+
<!-- Open Estimate Shipping and Tax section for united states-->
23+
<actionGroup ref="StorefrontCheckoutCartFillEstimateShippingAndTaxWithoutZipCodeActionGroup" stepKey="setEstimateShippingAndTaxInitialAddressToUnitedStatesWithoutZipCode">
24+
<argument name="country" value="United States"/>
25+
<argument name="state" value="California"/>
26+
</actionGroup>
27+
<!-- Verify UPS shipping method is not available for united states without zipcode error message -->
28+
<waitForElement selector="{{CheckoutCartSummarySection.verifyErrorMessageOfShippingMethod}}" stepKey="verifyErrorMessageForUPSShippingMethodIsNotAvailableForUSA"/>
29+
<!-- Set Estimate Shipping And Tax Initial Address To United Kingdom Without ZipCode-->
30+
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United Kingdom" stepKey="selectCountry"/>
31+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/>
32+
<!-- Verify UPS shipping method is not available for united kingdom without zipcode -->
33+
<waitForElement selector="{{CheckoutCartSummarySection.verifyErrorMessageOfShippingMethod}}" stepKey="verifyErrorMessageForUPSShippingMethodIsNotAvailableForUK"/>
34+
<!-- Select other shipping method available -->
35+
<click selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectFlatRateShippingMethod"/>
36+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
37+
<!--Fill Shipping Address-->
38+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillShippingAddress"/>
39+
<waitForPageLoad stepKey="waitForShippingPageToLoad"/>
40+
<!-- Click Next button -->
41+
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/>
42+
<!-- Checkout select Check/Money Order payment -->
43+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
44+
<!--Place order-->
45+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
46+
</test>
47+
</tests>

0 commit comments

Comments
 (0)