Skip to content

Commit babc351

Browse files
committed
MC-223: Admin should be able to add/edit bundle items when creating/editing a bundle product
1 parent 2cf7256 commit babc351

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminAddBundleItemsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Create/Edit bundle product in Admin"/>
15+
<title value="Admin should be able to add/edit bundle items when creating/editing a bundle product"/>
16+
<description value="Admin should be able to add/edit bundle items when creating/editing a bundle product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-223"/>
19+
<group value="banana"/>
20+
</annotations>
21+
<before>
22+
<!--Creating data-->
23+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
24+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
26+
<!--Admin login-->
27+
<actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/>
28+
</before>
29+
<after>
30+
<!--Deleting data-->
31+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
32+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
33+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<!--Logging out-->
35+
<actionGroup ref="logout" stepKey="logout"/>
36+
</after>
37+
<!--Go to bundle product creation page-->
38+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
39+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
40+
41+
<!-- Add two bundle items -->
42+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
43+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
44+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
45+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
46+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
47+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
48+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
49+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
50+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
51+
<argument name="product" value="$$simpleProduct1$$"/>
52+
</actionGroup>
53+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
54+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
55+
<argument name="product" value="$$simpleProduct2$$"/>
56+
</actionGroup>
57+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
58+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
59+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
60+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
61+
62+
<!--Fill out ancillary data on bundle product-->
63+
<actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts">
64+
<argument name="bundleProduct" value="BundleProduct"/>
65+
</actionGroup>
66+
67+
<!--Save the product-->
68+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
69+
<see userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
70+
71+
<!--Checking on admin side-->
72+
<scrollToTopOfPage stepKey="scroll"/>
73+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/>
74+
<seeElement stepKey="LookingForBundleItemPresence" selector="{{AdminProductFormBundleSection.listedBundleItem}}"/>
75+
76+
<!--Checking on customer side-->
77+
<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPage"/>
78+
<waitForPageLoad stepKey="waitForBundleProductPageToLoad"/>
79+
<seeElement selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="LookingForAbilityToAddOptions"/>
80+
<click selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="clickButtonToCustomize"/>
81+
<waitForPageLoad stepKey="waitCustomizationDropDown"/>
82+
<seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption}}" stepKey="seeBundleItem"/>
83+
</test>
84+
</tests>

0 commit comments

Comments
 (0)