Skip to content

Commit 46b8a80

Browse files
committed
MC-225: Admin should be able to save and publish a bundle product
1 parent b4ff387 commit 46b8a80

13 files changed

+377
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClearFiltersActionGroup">
12+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
13+
<waitForPageLoad stepKey="WaitForPageToLoad"/>
14+
<conditionalClick selector="{{AdminProductCatalog.clearFilters}}" dependentSelector="{{AdminProductCatalog.clearFilters}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
15+
</actionGroup>
16+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="BundleProductFilter">
12+
<!--Setting filter-->
13+
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToCatalogPage"/>
14+
<waitForPageLoad stepKey="WaitForPageToLoadFully"/>
15+
<click selector="{{AdminProductCatalog.clickOnFilter}}" stepKey="ClickOnFilter"/>
16+
<click selector="{{AdminProductCatalog.clickOnTypeDropDown}}" stepKey="ClickOnTypeDropDown"/>
17+
<click selector="{{AdminProductCatalog.clickOnBundleOption}}" stepKey="ClickOnBundleOption"/>
18+
<click selector="{{AdminProductCatalog.clickOnApplyFilters}}" stepKey="ClickOnApplyFilters"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CreateBasicBundleProduct">
12+
<!--Product name and SKU-->
13+
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
14+
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
15+
16+
<!--Trigger SEO drop down-->
17+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
18+
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
19+
20+
<!--Fill URL input-->
21+
<fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AncillaryPrepBundleProduct">
12+
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
13+
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
14+
15+
<!--Trigger SEO drop down-->
16+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
17+
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
18+
19+
<!--Fill URL input-->
20+
<fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/>
21+
</actionGroup>
22+
23+
<!--Enable/Disable Product Toggle-->
24+
<actionGroup name="EnableDisableProduct">
25+
<click stepKey="ClickOnEnableDisableToggle" selector="{{AdminProductFormBundleSection.enableDisableToggle}}"/>
26+
</actionGroup>
27+
28+
<!--Edit existing product by searching in product catalog-->
29+
<actionGroup name="FindProductToEdit">
30+
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/>
31+
<waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/>
32+
<fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/>
33+
<click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/>
34+
<click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/>
35+
<waitForPageLoad stepKey="WaitForProductEditPageToLoad"/>
36+
</actionGroup>
37+
</actionGroups>

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="BundleProduct" type="product">
1212
<data key="name" unique="suffix">BundleProduct</data>
13+
<data key="name" unique="suffix">BundleProduct</data>
14+
<data key="name2" unique="suffix">BundleProduct2</data>
1315
<data key="sku" unique="suffix">bundleproduct</data>
16+
<data key="sku2" unique="suffix">bundleproduct2</data>
1417
<data key="type_id">bundle</data>
1518
<data key="attribute_set_id">4</data>
1619
<data key="optionTitle1">BundleOption</data>
1720
<data key="optionInputType1">checkbox</data>
1821
<data key="defaultQuantity">10</data>
1922
<data key="status">1</data>
2023
<data key="urlKey" unique="suffix">bundleproduct</data>
24+
<data key="urlKey2" unique="suffix">bundleproduct2</data>
25+
<data key="default_quantity1">10</data>
26+
<data key="default_quantity2">20</data>
27+
<data key="set">4</data>
28+
<data key="type">bundle</data>
2129
</entity>
2230
<entity name="ApiBundleProduct" type="product2">
2331
<data key="name" unique="suffix">Api Bundle Product</data>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="AdminCatalogProductPage" url="catalog/product/" area="admin" module="Magento_Bundle">
12+
<section name="AdminCatalogProductSection"/>
13+
</page>
14+
</pages>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Page/AdminProductCreatePage.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
7-
-->
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
1111
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true">
1212
<section name="AdminProductFormBundleSection"/>
1313
</page>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductCatalog">
12+
<element name="clickOnFilter" type="button" selector="//div[@class='data-grid-filters-action-wrap']/button" timeout="30"/>
13+
<element name="clickOnTypeDropDown" type="multiselect" selector="//select[@name='type_id']" timeout="30"/>
14+
<element name="clickOnBundleOption" type="multiselect" selector="//select[@name='type_id']/option[4]" timeout="30"/>
15+
<element name="clickOnApplyFilters" type="button" selector="//button[@class='action-secondary']" timeout="30"/>
16+
<element name="selectAllCheckBox" type="checkbox" selector="//div[@data-role='grid-wrapper']//label[@data-bind='attr: {for: ko.uid}']" timeout="30"/>
17+
<element name="clickOnActions" type="button" selector="//div[@class='action-select-wrap']/button" timeout="30"/>
18+
<element name="clickOnChangeStatus" type="multiselect" selector="//div[@class='action-menu-items']//li[2]" timeout="30"/>
19+
<element name="clickOnDisable" type="multiselect" selector="//div[@class='action-menu-items']//ul[@class='action-submenu _active']//li[span='Disable']" timeout="30"/>
20+
<element name="clickOnEnable" type="multiselect" selector="//div[@class='action-menu-items']//ul[@class='action-submenu _active']//li[span='Enable']" timeout="30"/>
21+
<element name="clearFilters" type="button" selector="//div[@class='admin__data-grid-header']//button[@data-action='grid-filter-reset']" timeout="30"/>
22+
</section>
23+
</sections>

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductFormBundleSection">
1212
<element name="bundleItemsToggle" type="button" selector="//span[text()='Bundle Items']"/>
1313
<element name="shipmentType" type="select" selector=".admin__control-select[name='product[shipment_type]']"/>
@@ -21,6 +21,34 @@
2121
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
2222
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
2323
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
24+
<!--Select"url Key"InputForm-->
25+
<element name="urlKey" type="input" selector="//input[@name='product[url_key]']" timeout="30"/>
26+
<!--AddSelectedProducts-->
27+
<element name="addSelectedProducts" type="button" selector="//span[contains(text(),'Add Selected Products')]/ancestor::button" timeout="30"/>
28+
<!--DefaultQuantities-->
29+
<element name="defaultQuantity1" type="input" selector="//input[@name='bundle_options[bundle_options][0][bundle_selections][0][selection_qty]']" timeout="30"/>
30+
<element name="defaultQuantity2" type="input" selector="//input[@name='bundle_options[bundle_options][0][bundle_selections][1][selection_qty]']" timeout="30"/>
31+
<element name="productName" type="input" selector="//*[@name='product[name]']"/>
32+
<element name="productSku" type="input" selector="//*[@name='product[sku]']"/>
33+
<!--TestingForLocationOfOptions-->
34+
<element name="bundleOptionSelector" type="button" selector="//*[@id='bundle-slide']/span"/>
35+
<element name="bundleOptionSelection" type="button" selector="//div[@class='nested options-list']/div[2]/label[@class='label']"/>
36+
<!--SelectorsForDescriptionCreationOnBundleProduct-->
37+
<element name="contentDropDown" type="button" selector="div[data-index='content']" timeout="30"/>
38+
<element name="contentDropDownIfNotShowing" type="button" selector="//div[@data-index='content']//div[contains(@class, '_hide')]"/>
39+
<element name="longDescription" type="input" selector="#product_form_description"/>
40+
<element name="shortDescription" type="input" selector="#product_form_short_description"/>
41+
<!--SEODropdownTab-->
42+
<element name="seoDropdown" type="button" selector="//div[@data-index='search-engine-optimization']"/>
43+
<element name="seoDependent" type="button" selector="//div[@data-index='search-engine-optimization']//div[contains(@class, '_show')]"/>
44+
<!--NameOfProductOnProductPage-->
45+
<element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/>
46+
<!--EnableDisableToggle-->
47+
<element name="enableDisableToggle" type="button" selector="//*[@id='container']//input[@name='product[status]']/.." timeout="30"/>
48+
<!--SearchButton-->
49+
<element name="searchButton" type="button" selector="//div[@class='data-grid-search-control-wrap']//*[@type='button']" timeout="30"/>
50+
<!--ClickOnFirstProductInCatalog-->
51+
<element name="firstCatalogProduct" type="button" selector="//table[@class='data-grid data-grid-draggable']/tbody/tr[@class='data-row']/td[4]"/>
2452
<element name="bundledItems" type="block" selector="[data-index=bundle-items]"/>
2553
</section>
2654
</sections>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="BundleStorefrontSection">
12+
<!--TestingForLocationOfOptions-->
13+
<element name="bundleOptionSelector" type="button" selector="//*[@id='bundle-slide']/span"/>
14+
<element name="bundleOptionSelection" type="button" selector="//div[@class='nested options-list']/div[2]/label[@class='label']"/>
15+
<!--Description-->
16+
<!--CE exclusively-->
17+
<element name="longDescriptionText" type="text" selector="//*[@id='description']/div/div" timeout="30"/>
18+
<element name="shortDescriptionText" type="text" selector="//div[@class='product attribute overview']" timeout="30"/>
19+
<!--NameOfProductOnProductPage-->
20+
<element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/>
21+
</section>
22+
</sections>

0 commit comments

Comments
 (0)