Skip to content

Commit f4f9938

Browse files
JhalakMathurManjusha.S
authored andcommitted
ACQE-3584:StoreFrontVerifyMultishippingCheckoutForVirtualProductTest
1 parent b0d2719 commit f4f9938

File tree

5 files changed

+221
-0
lines changed

5 files changed

+221
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@
4646
<element name="productImage" type="text" selector="//ol[@id='mini-cart']//img[@class='product-image-photo']"/>
4747
<element name="productSubTotal" type="text" selector="//div[@class='subtotal']//span/span[@class='price']"/>
4848
<element name="productCountLabel" type="text" selector="//*[@id='minicart-content-wrapper']/div[2]/div[1]/span[2]"/>
49+
<element name="productCartName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']//a[contains(text(),'{{var}}')]" parameterized="true"/>
4950
</section>
5051
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="StoreFrontAssertCustomerShippingAddressOrderViewPageActionGroup">
12+
<annotations>
13+
<description>Assert that shipping Address block contains provided Address data.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="address" type="entity" defaultValue="US_Address_CA"/>
17+
</arguments>
18+
19+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.firstname}}" stepKey="seeCustomerFirstname"/>
20+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.lastname}}" stepKey="seeCustomerLastname"/>
21+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.company}}" stepKey="seeCustomerCompany"/>
22+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.street[0]}}" stepKey="seeCustomerStreet"/>
23+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.city}}" stepKey="seeCustomerCity"/>
24+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.state}}" stepKey="seeCustomerState"/>
25+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.postcode}}" stepKey="seeCustomerPostcode"/>
26+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.country}}" stepKey="seeCustomerCountry"/>
27+
<see selector="{{PaymentMethodSection.shippingblock}}" userInput="{{address.telephone}}" stepKey="seeCustomerTelephone"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="goToReviewOrder" type="button" selector="#payment-continue" timeout="30"/>
1313
<element name="changeBillingAddress" type="button" selector="//div[@class='box box-billing-address']//a[normalize-space() = 'Change']" timeout="30"/>
1414
<element name="billingAddressBlock" type="block" selector=".box-billing-address > .box-content > address" timeout="30"/>
15+
<element name="shippingblock" type="block" selector=".box-shipping-address > .box-content > address" timeout="30"/>
1516
</section>
1617
</sections>

app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutAddressesToolbarSection.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontMultishippingCheckoutAddressesToolbarSection">
1212
<element name="goToShippingInformation" type="button" selector="button.action.primary.continue"/>
13+
<element name="shippingnotapplicable" type="text" selector="//td[@class='col product']//a[contains(text(),'{{var}}')]/../../..//td[@class='col address']//div" parameterized="true" />
14+
<element name="shippingmethods" type="text" selector="//div[@class='block block-shipping']//div[@class='box box-items']//td[@data-th='Product Name']//a[contains(text(),'{{var}}')]" parameterized="true" />
15+
<element name="otheritems" type="text" selector="//div[@class='block block-other']//div[@class='block-content']//p[contains(text(),'Shipping is not applicable.')]/..//td[@data-th='Product Name']//a[contains(text(),'{{var}}')]" parameterized="true" />
16+
<element name="checkmoneyorder" type="radio" selector="//input[@id='p_method_checkmo']" />
17+
<element name="checkmoneyorderonOverViewPage" type="text" selector="//dt[contains(text() , 'Check / Money order')]"/>
18+
<element name="othershippingitems" type="text" selector="//div[@class='block block-other']//div/strong[contains(text(),'Other items in your order')]/../..//div[2]//td/strong/a[contains(text(),'{{var}}')]" parameterized="true" />
19+
<element name="shippingaddresstext" type="text" selector="//div[@class='box box-order-shipping-address']//span[contains(text(),'Shipping Address')]" />
1320
</section>
1421
</sections>
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
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="StoreFrontVerifyMultishippingCheckoutForVirtualProductTest">
12+
<annotations>
13+
<stories value="Verify Multishipping checkout flow if cart contains virtual product type"/>
14+
<title value="Verify Multishipping checkout flow if cart contains virtual product type"/>
15+
<description value="Verify Multishipping checkout flow if cart contains virtual product type"/>
16+
<testCaseId value="MC-26600"/>
17+
<severity value="MAJOR"/>
18+
</annotations>
19+
20+
<before>
21+
22+
<!-- Create default category -->
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
25+
<!-- Create virtual product -->
26+
<createData entity="VirtualProduct" stepKey="createVirtualProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<!-- Create simple product -->
31+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
32+
<requiredEntity createDataKey="createCategory"/>
33+
</createData>
34+
35+
<!-- Assign virtual product to default category -->
36+
<createData entity="AssignProductToCategory" stepKey="assignCategoryToVirtualProduct">
37+
<requiredEntity createDataKey="createCategory"/>
38+
<requiredEntity createDataKey="createVirtualProduct"/>
39+
</createData>
40+
41+
<!-- Assign Simple product to default category -->
42+
<createData entity="AssignProductToCategory" stepKey="assignCategoryToSimpleProduct">
43+
<requiredEntity createDataKey="createCategory"/>
44+
<requiredEntity createDataKey="createSimpleProduct"/>
45+
</createData>
46+
47+
<!-- Create customer -->
48+
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/>
49+
</before>
50+
<after>
51+
<!-- delete category,product,customer -->
52+
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
53+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
54+
<deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/>
55+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
56+
</after>
57+
58+
<!-- Go to Storefront as Customer from preconditions -->
59+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
60+
<argument name="Customer" value="$$createCustomer$$"/>
61+
</actionGroup>
62+
63+
<!-- Customer added Virtual Product to Cart -->
64+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addVirtualProductToCart">
65+
<argument name="product" value="$$createVirtualProduct$$"/>
66+
</actionGroup>
67+
68+
<!-- Customer added Simple Product to Cart -->
69+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart">
70+
<argument name="product" value="$$createSimpleProduct$$"/>
71+
</actionGroup>
72+
73+
<!-- Go to Shopping Cart page -->
74+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickOnViewEditCart"/>
75+
76+
<!-- Check shopping cart contains both the Product-->
77+
<seeElement selector="{{StorefrontMinicartSection.productCartName($$createVirtualProduct.name$$)}}" stepKey="AssertVirtualProduct"/>
78+
<seeElement selector="{{StorefrontMinicartSection.productCartName($$createSimpleProduct.name$$)}}" stepKey="AssertSimpleProduct"/>
79+
80+
<!-- Link "Check Out with Multiple Addresses" is shown -->
81+
<seeLink userInput="Check Out with Multiple Addresses" stepKey="seeLinkIsOpened"/>
82+
83+
<!-- Click Check Out with Multiple Addresses -->
84+
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/>
85+
86+
<!-- Check Ship to Multiple Address Page is opened-->
87+
<!-- <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}/multishipping/checkout/addresses" userInput="checkout/addresses"/> -->
88+
<wait time="10" stepKey="10"/>
89+
<seeInCurrentUrl url="{{MultishippingCheckoutAddressesPage.url}}" stepKey="seeShiptoMultipleAddressesPageIsOpened"/>
90+
91+
<!-- Assert Simple product has address in Send To section-->
92+
<actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine1Qty">
93+
<argument name="productName" value="$createSimpleProduct.name$"/>
94+
</actionGroup>
95+
96+
<!--Virtual product has a message in Send To section : "A shipping selection is not applicable.-->
97+
<grabTextFrom selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingnotapplicable($$createVirtualProduct.name$$)}}" stepKey="grabshippingtext"/>
98+
<assertEquals message="Virtual product has a message in Send To section : 'A shipping selection is not applicable" stepKey="ssertEquals1">
99+
<expectedResult type="string">A shipping selection is not applicable.</expectedResult>
100+
<actualResult type="string">$grabshippingtext</actualResult>
101+
</assertEquals>
102+
103+
<!-- Click Go to Shipping Information* -->
104+
<click selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.goToShippingInformation}}" stepKey="clickGoToShippingInformation"/>
105+
106+
107+
<!-- See Shipping Method is opened -->
108+
<wait time="10" stepKey="20"/>
109+
<seeInCurrentUrl url="{{MultishippingCheckoutShippingPage.url}}" stepKey="seeSelectShippingMethodPageIsOpened"/>
110+
111+
112+
<!-- Halt test execution for 10 seconds before continuing. -->
113+
<wait time="10" stepKey="29"/>
114+
<!-- See Shipping Method available ONLY for Simple product-->
115+
<seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingmethods($$createSimpleProduct.name$$)}}" stepKey="ShippingMethodForSimpleProduct"/>
116+
117+
<!-- See For Virtual product : "Shipping is not applicable.-->
118+
<seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.otheritems($$createVirtualProduct.name$$)}}" stepKey="ShippingMethodForVirtalProduct"/>
119+
120+
<!-- Click On Continue to Billing-->
121+
<click selector="{{StorefrontMultishippingCheckoutShippingToolbarSection.continueToBilling}}" stepKey="clickContinueToBilling"/>
122+
<waitForPageLoad stepKey="waitForCheckoutShippingToolbarPageLoad"/>
123+
124+
<!-- See Billing Information Page is opened-->
125+
<wait time="10" stepKey="30"/>
126+
<seeInCurrentUrl url="{{MultishippingCheckoutBillingPage.url}}" stepKey="seeBillingPageIsOpened"/>
127+
128+
<!-- Check Page contains customer's billing address-->
129+
<actionGroup ref="StorefrontAssertBillingAddressInBillingInfoStepActionGroup" stepKey="assertCustomerBillingInformation"/>
130+
131+
132+
<!-- Page contains Payment Method -->
133+
<seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorder}}" stepKey="CheckMoney"/>
134+
135+
<!-- Select Payment method "Check / Money Order -->
136+
<conditionalClick selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorder}}" dependentSelector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorder}}" visible="true" stepKey="selectCheckmoPaymentMethod"/>
137+
138+
<!-- Select Payment method e.g. "Check / Money Order" and click Go to Review Your Order -->
139+
<wait time="10" stepKey="waitforReviewOrderButton"/>
140+
<click selector="{{StorefrontMultishippingCheckoutBillingToolbarSection.goToReviewOrder}}" stepKey="clickGoToReviewOrder"/>
141+
142+
143+
<!-- Check Page contains customer's billing address on OverViewPage-->
144+
<actionGroup ref="StorefrontAssertBillingAddressInBillingInfoStepActionGroup" stepKey="assertCustomerBillingInformationonOverViewPage"/>
145+
146+
<!-- Check Payment Method on OverViewPage-->
147+
<seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorderonOverViewPage}}" stepKey="CheckMoneyonOverViewPage"/>
148+
149+
<!-- "Shipping To" - address that customer selected for shipping -->
150+
<actionGroup ref="StoreFrontAssertCustomerShippingAddressOrderViewPageActionGroup" stepKey="assertCustomerShippinginformation"/>
151+
152+
<!--other shipping methods contain Virtual Product-->
153+
<seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.othershippingitems($$createVirtualProduct.name$$)}}" stepKey="otherItemsContainsVirtualProduct" />
154+
155+
<!--Click on Place Order"-->
156+
<click selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="tryToPlaceOrder1"/>
157+
158+
<!--Check Thank you for your purchase!" page is opened -->
159+
<see selector="{{StorefrontMultipleShippingMethodSection.successMessage}}" userInput="Successfully ordered" stepKey="seeSuccessMessage"/>
160+
161+
<!--Grab Order ID of Simple and Virtual Product -->
162+
<grabTextFrom selector="{{StorefrontMultipleShippingMethodSection.orderId('1')}}" stepKey="grabFirstOrderId"/>
163+
<grabTextFrom selector="{{StorefrontMultipleShippingMethodSection.orderId('2')}}" stepKey="grabSecondOrderId"/>
164+
165+
<!--Open Simple Product Link -->
166+
<click selector="{{StorefrontMultipleShippingMethodSection.orderByPosition('1')}}" stepKey="openOrderDetailsPage"/>
167+
168+
<!--Assert Shipping Information for Simple Product -->
169+
<seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingaddresstext}}" stepKey="assertSimpleProductShippingOrderDetails"/>
170+
171+
<!-- Move back one page in history. -->
172+
<moveBack stepKey="moveBack"/>
173+
174+
<!--Open Virtual Product Link -->
175+
<click selector="{{StorefrontMultipleShippingMethodSection.orderByPosition('2')}}" stepKey="assertVirtualProductShippingOrderDetails"/>
176+
177+
<!--Open Virtual Product Link -->
178+
<dontSeeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingaddresstext}}" stepKey="assertVirtualsseehipping"/>
179+
180+
</test>
181+
</tests>
182+

0 commit comments

Comments
 (0)