Skip to content

Commit df106be

Browse files
committed
MC-186: Admin should be able to apply fixed pricing for Bundled Product
1 parent ba8ae0c commit df106be

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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="BundleProductFixedPricingTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle Product Pricing"/>
15+
<title value="Admin should be able to apply fixed pricing for Bundled Product"/>
16+
<description value="Admin should be able to apply fixed pricing for Bundled Product"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-186"/>
19+
<group value="Bundle"/>
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+
27+
<!--Admin login-->
28+
<actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/>
29+
</before>
30+
<after>
31+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
32+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
33+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<actionGroup ref="logout" stepKey="logout"/>
35+
</after>
36+
<!--Go to bundle product creation page-->
37+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />
38+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
39+
40+
<!-- Add two bundle items -->
41+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
42+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
43+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
44+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
45+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
46+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
47+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
48+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
49+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
50+
<argument name="product" value="$$simpleProduct1$$"/>
51+
</actionGroup>
52+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
53+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
54+
<argument name="product" value="$$simpleProduct2$$"/>
55+
</actionGroup>
56+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
57+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
58+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
59+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
60+
61+
<!--Fill out ancillary data on bundle product-->
62+
<actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts">
63+
<argument name="bundleProduct" value="BundleProduct"/>
64+
</actionGroup>
65+
66+
<!--Disable dynamic pricing and enter fixed price of product-->
67+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
68+
<click selector="{{AdminProductFormBundleSection.dynamicPrice}}" stepKey="clickDynamicPriceSwitcher"/>
69+
<fillField userInput="{{BundleProduct.fixedPrice}}" selector="{{AdminProductFormBundleSection.priceField}}" stepKey="fillPrice"/>
70+
71+
<!--Save the product-->
72+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
73+
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
74+
75+
<!--Testing that price appears correctly in admin catalog-->
76+
<!--Set filter to product name-->
77+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
78+
<waitForPageLoad stepKey="WaitForPageToLoad"/>
79+
<conditionalClick selector="{{AdminProductCatalog.filtersClear}}" dependentSelector="{{AdminProductCatalog.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
80+
<waitForPageLoad stepKey="WaitForClear"/>
81+
<actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName">
82+
<argument name="product" value="BundleProduct"/>
83+
</actionGroup>
84+
<seeElement selector="{{AdminProductCatalog.priceOfFirstRow(BundleProduct.fixedPrice)}}" stepKey="seePrice"/>
85+
<!--Storefront-->
86+
<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPage"/>
87+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
88+
<pauseExecution stepKey="pause"/>
89+
<seeElement selector="{{StorefrontBundledSection.fixedPricing(BundleProduct.fixedPrice)}}" stepKey="checkingForFixedPrice"/>
90+
</test>
91+
</tests>

0 commit comments

Comments
 (0)