Skip to content

Commit 491442c

Browse files
committed
MC-226: Customer should be able to see bundle products in the category products list and grid views
1 parent 26cbef3 commit 491442c

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Data/ProductData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<data key="default_quantity2">20</data>
2727
<data key="set">4</data>
2828
<data key="type">bundle</data>
29+
<data key="price">10</data>
2930
<data key="fixedPrice">10</data>
3031
<data key="fixedPriceFormatted">$10.00</data>
3132
<data key="defaultAttribute">Default</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Section/AdminProductFormBundleSection.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,12 @@
6060
<element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/>
6161
<!--FirstProductOption-->
6262
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
63+
<!--Category Selection-->
64+
<element name="categoriesDropDown" type="multiselect" selector="//div[@data-index='category_ids']//div" timeout="30"/>
65+
<element name="defaultCategory" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), 'Default Category')]"/>
66+
<element name="category" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), '{{category}}')]" parameterized="true"/>
67+
<element name="searchForCategory" type="input" selector="div.action-menu._active > div.admin__action-multiselect-search-wrap input" timeout="30"/>
68+
<element name="selectCategory" type="multiselect" selector="//div[@class='action-menu _active']//label[@class='admin__action-multiselect-label']"/>
69+
<element name="categoriesLabel" type="text" selector="//div[@class='action-menu _active']//button[@data-action='close-advanced-select']"/>
6370
</section>
6471
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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="StorefrontBundleProductShownInCategoryListAndGrid">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle products list on Storefront"/>
15+
<title value="Customer should be able to see bundle products in the category products list and grid views"/>
16+
<description value="Customer should be able to see bundle products in the category products list and grid views"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-226"/>
19+
<group value="Bundle"/>
20+
</annotations>
21+
<before>
22+
<!--Admin login-->
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
26+
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
27+
<createData entity="SimpleProduct2" stepKey="simpleProduct4"/>
28+
</before>
29+
<after>
30+
<!--Logging out-->
31+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
32+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
33+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/>
35+
<deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/>
36+
</after>
37+
<!--Make category-->
38+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
39+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
40+
<actionGroup ref="CreateCategory" stepKey="createASubcategory">
41+
<argument name="categoryEntity" value="SimpleSubCategory"/>
42+
</actionGroup>
43+
44+
<!--Go to bundle product creation page-->
45+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />
46+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
47+
48+
<!--Categories-->
49+
<click selector="{{AdminProductFormBundleSection.categoriesDropDown}}" stepKey="dropDownCategories"/>
50+
<fillField selector="{{AdminProductFormBundleSection.searchForCategory}}" userInput="{{SimpleSubCategory.name}}" stepKey="searchForCategory"/>
51+
<click selector="{{AdminProductFormBundleSection.selectCategory}}" stepKey="selectCategory"/>
52+
<click selector="{{AdminProductFormBundleSection.categoriesLabel}}" stepKey="clickOnCategoriesLabelToCloseOptions"/>
53+
54+
<!--Create bundle product-->
55+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
56+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
57+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
58+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
59+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
60+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
61+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
62+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
63+
<argument name="product" value="$$simpleProduct1$$"/>
64+
</actionGroup>
65+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
66+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
67+
<argument name="product" value="$$simpleProduct2$$"/>
68+
</actionGroup>
69+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
70+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
71+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
72+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
73+
<actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/>
74+
75+
<!--Save the product-->
76+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
77+
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
78+
79+
<!--Go to category page-->
80+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
81+
<waitForPageLoad stepKey="waitForHomePageToload"/>
82+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="cartClickCategory"/>
83+
84+
<!--Check in grid view-->
85+
<seeInTitle userInput="{{SimpleSubCategory.name}}" stepKey="assertCategoryNameInTitle"/>
86+
<see userInput="{{SimpleSubCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/>
87+
<see userInput="1" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/>
88+
<seeElement selector="{{StorefrontCategoryMainSection.firstProduct}}" stepKey="assertBundleProductPresence"/>
89+
90+
<!--Check in list view-->
91+
<click selector="{{StorefrontCategoryMainSection.categoryListView}}" stepKey="switchToListView"/>
92+
<seeInTitle userInput="{{SimpleSubCategory.name}}" stepKey="assertCategoryNameInTitleAgain"/>
93+
<see userInput="{{SimpleSubCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryNamAgain"/>
94+
<see userInput="1" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCountAgain"/>
95+
<seeElement selector="{{StorefrontCategoryMainSection.firstProduct}}" stepKey="assertBundleProductPresenceAgain"/>
96+
</test>
97+
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryMainSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@
2424
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
2525
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
2626
<element name="categoryImage" type="text" selector=".category-image"/>
27+
<element name="firstProduct" type="block" selector="ol li:first-of-type img"/>
28+
<element name="categoryListView" type="button" selector="a[title='List']" timeout="30"/>
2729
</section>
2830
</sections>

0 commit comments

Comments
 (0)