Skip to content

Commit 3cb4132

Browse files
akaashakaash
authored andcommitted
Merge branch 'ACQE-3955' into functional-mainline-pr-ce
2 parents 3a58226 + c49cba4 commit 3cb4132

File tree

3 files changed

+123
-1
lines changed

3 files changed

+123
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup">
12+
<annotations>
13+
<description>Guest verifies the Shipping details on storefront checkout payment page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="firstName" type="string" defaultValue="{{CustomerAddressSimple.firstName}}"/>
17+
<argument name="lastName" type="string" defaultValue="{{CustomerAddressSimple.lastName}}"/>
18+
<argument name="street" type="string" defaultValue="{{CustomerAddressSimple.street[0]}}"/>
19+
<argument name="city" type="string" defaultValue="{{CustomerAddressSimple.city}}"/>
20+
<argument name="state" type="string" defaultValue="{{CustomerAddressSimple.state}}"/>
21+
<argument name="postcode" type="string" defaultValue="{{CustomerAddressSimple.postcode}}"/>
22+
<argument name="telephone" type="string" defaultValue="{{CustomerAddressSimple.telephone}}"/>
23+
</arguments>
24+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{firstName}}" stepKey="assertShipToFirstName" />
25+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{lastName}}" stepKey="assertShipToLastName" />
26+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{street}}" stepKey="assertShipToStreet" />
27+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{city}}" stepKey="assertShipToCity" />
28+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{state}}" stepKey="assertShipToState" />
29+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{postcode}}" stepKey="assertShipToPostcode" />
30+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{telephone}}" stepKey="assertShipToTelephone" />
31+
</actionGroup>
32+
</actionGroups>
33+

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

Lines changed: 4 additions & 1 deletion
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="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
51+
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']"/>
52+
<element name="editShipToAddress" type="button" selector="//div[@class='ship-to']//button[@class='action action-edit']"/>
53+
<element name="editShippingMethod" type="button" selector="//div[@class='ship-via']//button[@class='action action-edit']"/>
54+
<element name="shippingMethodTitle" type="text" selector="//div[text()='Shipping Methods']"/>
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: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 input data"/>
16+
<description value="Ship To and Shipping Method blocks on Checkout contain actual information according to input data"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4628"/>
19+
</annotations>
20+
<before>
21+
<!-- Enable free shipping -->
22+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="enableFreeShippingConfig"/>
23+
<!-- create category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<!-- create simple product -->
26+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
32+
<!-- delete category -->
33+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
34+
<!-- delete simple product -->
35+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
36+
</after>
37+
<!-- Go to Storefront as Guest and add product to cart -->
38+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="guestOpenProductPage">
39+
<argument name="product" value="$$createProduct$$"/>
40+
</actionGroup>
41+
<waitForPageLoad stepKey="waitForPageLoadToGetTheStorePageOpen"/>
42+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addSimpleProductToCartFromStorefront">
43+
<argument name="productName" value="$createProduct.name$"/>
44+
</actionGroup>
45+
<!-- Proceed to Checkout -->
46+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestProceedsToCheckout"/>
47+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearPostClickingOnCheckout"/>
48+
<!-- verify shipping screen is opened -->
49+
<waitForElement selector="{{CheckoutShippingSection.isShippingStep}}" stepKey="shippingStepIsOpened"/>
50+
<!--Filling shipping information and click next-->
51+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
52+
<argument name="shippingMethod" value="Flat Rate"/>
53+
</actionGroup>
54+
<!--Review & Payments step of checkout is opened where Correct Billing address is verified-->
55+
<actionGroup ref="CheckShipToInformationInCheckoutActionGroup" stepKey="verifyShipToInformation">
56+
<argument name="customerVar" value="CustomerEntityOne" />
57+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
58+
</actionGroup>
59+
<!-- Assert Shipping Method = "Flat Rate" -->
60+
<waitForText userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/>
61+
<!-- Reload Page and wait for page to get reload -->
62+
<reloadPage stepKey="refreshPageToVerifyAllInformationIsPresent"/>
63+
<waitForPageLoad stepKey="waitForPageToLoadProperlyToAssertShipToInformationDetails"/>
64+
<!-- Check that "Ship To" block contains correct information -->
65+
<actionGroup ref="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup" stepKey="assertingShipToInformationOnPaymentPage"/>
66+
<!-- Assert Shipping Method = "Flat Rate" -->
67+
<waitForText userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethodAgain"/>
68+
<!-- click on Edit button next to "Ship To" Text -->
69+
<waitForElementVisible selector="{{CheckoutPaymentSection.editShipToAddress}}" stepKey="waitForEditButtonToBeVisible"/>
70+
<click selector="{{CheckoutPaymentSection.editShipToAddress}}" stepKey="clickOnEditButton"/>
71+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSectionAgain">
72+
<argument name="customerVar" value="CustomerEntityOne"/>
73+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
74+
</actionGroup>
75+
<!-- Check that "Ship To" block contains correct information -->
76+
<actionGroup ref="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup" stepKey="againAssertingShipToInformationOnPaymentPage"/>
77+
<!-- Assert Shipping Method = "Free Shipping" -->
78+
<waitForText userInput="Free Shipping - Free" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertFreeShippingMethod"/>
79+
<!-- click on Edit button next to "Shipping Method" Text -->
80+
<waitForElementVisible selector="{{CheckoutPaymentSection.editShippingMethod}}" stepKey="waitForEditButtonToVisible"/>
81+
<click selector="{{CheckoutPaymentSection.editShippingMethod}}" stepKey="clickOnEditShippingMethodButton"/>
82+
<!-- Assert that it has scrolled to Shipping Method text -->
83+
<scrollTo selector="{{CheckoutPaymentSection.shippingMethodTitle}}" stepKey="scrollToShippingMethodTitle"/>
84+
<waitForText selector="{{CheckoutPaymentSection.shippingMethodTitle}}" userInput="Shipping Methods" stepKey="assertShippingMethodTitle"/>
85+
</test>
86+
</tests>

0 commit comments

Comments
 (0)