Skip to content

Commit 39da766

Browse files
Sahil.kumarSahil.kumar
authored andcommitted
ACQE-3955:Ship To and Shipping Method blocks on Checkout contain actual information according to inputed data
1 parent c31925f commit 39da766

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />
4949
<element name="ProductOptionLinkActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']//a[text() = '{{var2}}']" parameterized="true" />
5050
<element name="shipToInformation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
51+
<element name="editShipToInformation" type="button" selector="//div[@class='ship-to']//button[@class='action action-edit']"/>
52+
<element name="shippingMethodTitle" type="text" selector="//div[@class='checkout-shipping-method']//div[@class='step-title']"/>
5153
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
54+
<element name="editShipMethodInformation" type="button" selector="//div[@class='ship-via']//button[@class='action action-edit']"/>
5255
<element name="shippingInformationSection" type="text" selector=".ship-to .shipping-information-content" />
5356
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />
5457
<element name="productOptionsByProductItemPrice" type="text" selector="//div[@class='product-item-inner']//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true"/>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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="StorefrontVerifyShipToShipMethodContainsSameDataTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Guest checkout"/>
15+
<title value="Ship To and Shipping Method blocks on Checkout contain actual information according to inputed data"/>
16+
<description value="Ship To and Shipping Method blocks on Checkout contain actual information according to inputed data"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4628"/>
19+
</annotations>
20+
<before>
21+
<!-- Enable Flat Rate -->
22+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
23+
<!-- Enable free shipping -->
24+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/>
25+
<!-- create category -->
26+
<createData entity="_defaultCategory" stepKey="createCategory"/>
27+
<!-- create simple product -->
28+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
</before>
32+
<after>
33+
<!-- delete category -->
34+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
35+
<!-- delete simple product -->
36+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
37+
</after>
38+
39+
<!-- Step 1: Go to Storefront as Guest -->
40+
<!-- Step 2: Add simple product to shopping cart -->
41+
<amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="amOnSimpleProductPage"/>
42+
<waitForPageLoad stepKey="waitForPageLoad2"/>
43+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="cartAddSimpleProductToCart">
44+
<argument name="productName" value="$createProduct.name$"/>
45+
</actionGroup>
46+
<!-- Proceed to Checkout -->
47+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickToOpenCard"/>
48+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="clickToProceedToCheckout"/>
49+
<waitForPageLoad stepKey="waitForTheFormIsOpened"/>
50+
<!-- verify shipping screen is opened -->
51+
<seeElement selector="{{CheckoutShippingSection.isShippingStep}}" stepKey="shippingStepIsOpened"/>
52+
53+
<!--Fill Shipping Form-->
54+
<!--Filling shipping information and click next-->
55+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
56+
<argument name="shippingMethod" value="Flat Rate"/>
57+
</actionGroup>
58+
59+
<!--Review & Payments step of checkout is opened-->
60+
<!--Verify Billing address is correct-->
61+
<actionGroup ref="CheckShipToInformationInCheckoutActionGroup" stepKey="checkoutCheckShipToInformation">
62+
<argument name="customerVar" value="CustomerEntityOne" />
63+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
64+
</actionGroup>
65+
66+
<!-- Assert Shipping Method = "Flat Rate" -->
67+
<see userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/>
68+
69+
<!-- Reload Page and wait for page to get reload -->
70+
<reloadPage stepKey="refreshPage"/>
71+
<waitForPageLoad stepKey="waitForPageLoad"/>
72+
73+
<!-- Check that "Ship To" block contains correct information -->
74+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.firstName}}" stepKey="seeShipToFirstName" />
75+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.lastName}}" stepKey="seeShipToLastName" />
76+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeShipToStreet" />
77+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.city}}" stepKey="seeShipToCity" />
78+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.state}}" stepKey="seeShipToState" />
79+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="seeShipToPostcode" />
80+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="seeShipToTelephone" />
81+
82+
<!-- Assert Shipping Method = "Flat Rate" -->
83+
<see userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethodAgain"/>
84+
85+
<!-- click on Edit button next to "Ship To" Text -->
86+
<click selector="{{CheckoutPaymentSection.editShipToInformation}}" stepKey="clickOnEditButton"/>
87+
88+
<!-- Fill Shipping Form -->
89+
<actionGroup ref="ShipmentFormFreeShippingActionGroup" stepKey="shipmentFormFreeShippingActionGroup"/>
90+
91+
<!-- Check that "Ship To" block contains correct information -->
92+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="seeShipToFirstNameAgain" />
93+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="seeShipToLastNameAgain" />
94+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.city}}" stepKey="seeShipToCityAgain" />
95+
96+
<!-- Assert Shipping Method = "Free Shipping" -->
97+
<see userInput="Free Shipping - Free" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertFreeShippingMethod"/>
98+
<!-- click on Edit button next to "Shipping Method" Text -->
99+
<click selector="{{CheckoutPaymentSection.editShipMethodInformation}}" stepKey="clickOnEditShippingMethodButton"/>
100+
101+
<!-- Assert that it has scrolled to Shipping Method text -->
102+
<scrollTo selector="{{CheckoutPaymentSection.shippingMethodTitle}}}" stepKey="scrollToShippingMethodTitle"/>
103+
<see selector="{{CheckoutPaymentSection.shippingMethodTitle}}" userInput="Shipping Methods" stepKey="seeShippingMethodTitle"/>
104+
105+
</test>
106+
</tests>

0 commit comments

Comments
 (0)