Skip to content

Commit 0591d51

Browse files
saphaljhaengcom-Charlie
saphaljha
authored andcommitted
covered mftf for bundle items
1 parent 51fcc42 commit 0591d51

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest">
10+
<annotations>
11+
<features value="Bundle"/>
12+
<stories value="Bundle product details page"/>
13+
<title value="Customer should be able to see all the bundle items in invoice view"/>
14+
<description value="Customer should be able to see all the bundle items in invoice view"/>
15+
<severity value="CRITICAL"/>
16+
<group value="Bundle"/>
17+
</annotations>
18+
<before>
19+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
20+
<createData entity="SimpleProduct2" stepKey="firstSimpleProduct"/>
21+
<createData entity="SimpleProduct2" stepKey="secondSimpleProduct"/>
22+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
23+
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
27+
<deleteData createDataKey="firstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
28+
<deleteData createDataKey="secondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
29+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
31+
</after>
32+
<!-- Create new bundle product -->
33+
<actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct">
34+
<argument name="productType" value="bundle"/>
35+
</actionGroup>
36+
37+
<!-- Fill all main fields -->
38+
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/>
39+
40+
<!-- Add first bundle option to the product -->
41+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addFirstBundleOption">
42+
<argument name="x" value="0"/>
43+
<argument name="n" value="1"/>
44+
<argument name="prodOneSku" value="$firstSimpleProduct.sku$"/>
45+
<argument name="prodTwoSku" value="$secondSimpleProduct.sku$$"/>
46+
<argument name="optionTitle" value="{{CheckboxOption.title}}"/>
47+
<argument name="inputType" value="{{CheckboxOption.type}}"/>
48+
</actionGroup>
49+
50+
<!-- Save product form -->
51+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveWithThreeOptions"/>
52+
53+
<!--Login customer on storefront-->
54+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
55+
<argument name="Customer" value="$$createCustomer$$" />
56+
</actionGroup>
57+
58+
<!--Open Product Page-->
59+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
60+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
61+
</actionGroup>
62+
63+
<!-- Add bundle to cart -->
64+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart">
65+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
66+
</actionGroup>
67+
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectOption2Product1"/>
68+
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '2')}}" stepKey="selectOption2Product2"/>
69+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
70+
<argument name="quantity" value="1"/>
71+
</actionGroup>
72+
73+
<!--Navigate to checkout-->
74+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
75+
<!-- Click next button to open payment section -->
76+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
77+
<!-- Click place order -->
78+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
79+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
80+
81+
<!-- Order review page has address that was created during checkout -->
82+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById">
83+
<argument name="orderId" value="{$grabOrderNumber}"/>
84+
</actionGroup>
85+
86+
<!-- Open create invoice page -->
87+
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>
88+
89+
<!-- Assert item options display -->
90+
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.sku$" stepKey="seeFirstProductInList"/>
91+
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.sku$" stepKey="seeSecondProductInList"/>
92+
</test>
93+
</tests>

app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceItemsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828
<element name="discountAmountColumn" type="text" selector=".order-invoice-tables .col-discount .price"/>
2929
<element name="totalColumn" type="text" selector=".order-invoice-tables .col-total .price"/>
3030
<element name="updateQty" type="button" selector=".order-invoice-tables tfoot button[data-ui-id='order-items-update-button']"/>
31+
<element name="bundleItem" type="text" selector="#invoice_item_container .option-value"/>
3132
</section>
3233
</sections>

0 commit comments

Comments
 (0)