Skip to content

Commit c09fe6d

Browse files
author
bshevchenko
committed
MAGETWO-94838: Automate with MFTF Ability to configure Advanced Prices from Shared Catalog Page for different type of products
1 parent e13b87f commit c09fe6d

10 files changed

+287
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateApiDynamicBundleProductActionGroup">
12+
<!--Create 4 simple products-->
13+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
14+
<field key="price">4.99</field>
15+
</createData>
16+
<createData entity="SimpleProduct2" stepKey="simpleProduct2">
17+
<field key="price">2.89</field>
18+
</createData>
19+
<createData entity="SimpleProduct2" stepKey="simpleProduct3">
20+
<field key="price">7.33</field>
21+
</createData>
22+
<createData entity="SimpleProduct2" stepKey="simpleProduct4">
23+
<field key="price">18.25</field>
24+
</createData>
25+
<!-- Create the bundle product based -->
26+
<createData entity="ApiBundleProduct" stepKey="createBundleProduct"/>
27+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1_1">
28+
<requiredEntity createDataKey="createBundleProduct"/>
29+
<field key="required">false</field>
30+
</createData>
31+
<createData entity="CheckboxOption" stepKey="createBundleOption1_2">
32+
<requiredEntity createDataKey="createBundleProduct"/>
33+
</createData>
34+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
35+
<requiredEntity createDataKey="createBundleProduct"/>
36+
<requiredEntity createDataKey="createBundleOption1_1"/>
37+
<requiredEntity createDataKey="simpleProduct1"/>
38+
</createData>
39+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
40+
<requiredEntity createDataKey="createBundleProduct"/>
41+
<requiredEntity createDataKey="createBundleOption1_1"/>
42+
<requiredEntity createDataKey="simpleProduct2"/>
43+
</createData>
44+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct3">
45+
<requiredEntity createDataKey="createBundleProduct"/>
46+
<requiredEntity createDataKey="createBundleOption1_2"/>
47+
<requiredEntity createDataKey="simpleProduct3"/>
48+
</createData>
49+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct4">
50+
<requiredEntity createDataKey="createBundleProduct"/>
51+
<requiredEntity createDataKey="createBundleOption1_2"/>
52+
<requiredEntity createDataKey="simpleProduct4"/>
53+
</createData>
54+
</actionGroup>
55+
<actionGroup name="AdminCreateApiFixedBundleProductActionGroup">
56+
<!--Create 4 simple products-->
57+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
58+
<field key="price">4.99</field>
59+
</createData>
60+
<createData entity="SimpleProduct2" stepKey="simpleProduct2">
61+
<field key="price">2.89</field>
62+
</createData>
63+
<createData entity="SimpleProduct2" stepKey="simpleProduct3">
64+
<field key="price">7.33</field>
65+
</createData>
66+
<createData entity="SimpleProduct2" stepKey="simpleProduct4">
67+
<field key="price">18.25</field>
68+
</createData>
69+
<!-- Create the bundle product based -->
70+
<createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"/>
71+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1_1">
72+
<requiredEntity createDataKey="createBundleProduct"/>
73+
<field key="required">false</field>
74+
</createData>
75+
<createData entity="CheckboxOption" stepKey="createBundleOption1_2">
76+
<requiredEntity createDataKey="createBundleProduct"/>
77+
</createData>
78+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
79+
<requiredEntity createDataKey="createBundleProduct"/>
80+
<requiredEntity createDataKey="createBundleOption1_1"/>
81+
<requiredEntity createDataKey="simpleProduct1"/>
82+
</createData>
83+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
84+
<requiredEntity createDataKey="createBundleProduct"/>
85+
<requiredEntity createDataKey="createBundleOption1_1"/>
86+
<requiredEntity createDataKey="simpleProduct2"/>
87+
</createData>
88+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct3">
89+
<requiredEntity createDataKey="createBundleProduct"/>
90+
<requiredEntity createDataKey="createBundleOption1_2"/>
91+
<requiredEntity createDataKey="simpleProduct3"/>
92+
</createData>
93+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct4">
94+
<requiredEntity createDataKey="createBundleProduct"/>
95+
<requiredEntity createDataKey="createBundleOption1_2"/>
96+
<requiredEntity createDataKey="simpleProduct4"/>
97+
</createData>
98+
</actionGroup>
99+
</actionGroups>

app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,19 @@
6060
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
6161
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
6262
</entity>
63+
<entity name="ApiFixedBundleProduct" type="product2">
64+
<data key="name" unique="suffix">Api Fixed Bundle Product</data>
65+
<data key="sku" unique="suffix">api-fixed-bundle-product</data>
66+
<data key="type_id">bundle</data>
67+
<data key="attribute_set_id">4</data>
68+
<data key="price">1.23</data>
69+
<data key="visibility">4</data>
70+
<data key="status">1</data>
71+
<data key="urlKey" unique="suffix">api-fixed-bundle-product</data>
72+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
73+
<requiredEntity type="custom_attribute">ApiProductDescription</requiredEntity>
74+
<requiredEntity type="custom_attribute">ApiProductShortDescription</requiredEntity>
75+
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
76+
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
77+
</entity>
6378
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateApiConfigurableProductActionGroup">
12+
<!-- Create the configurable product based on the data in the /data folder -->
13+
<createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigProduct"/>
14+
15+
<!-- Make the configurable product have two options, that are children of the default attribute set -->
16+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
17+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
18+
<requiredEntity createDataKey="createConfigProductAttribute"/>
19+
</createData>
20+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
21+
<requiredEntity createDataKey="createConfigProductAttribute"/>
22+
</createData>
23+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
24+
<requiredEntity createDataKey="createConfigProductAttribute"/>
25+
</createData>
26+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
27+
<requiredEntity createDataKey="createConfigProductAttribute"/>
28+
</getData>
29+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
30+
<requiredEntity createDataKey="createConfigProductAttribute"/>
31+
</getData>
32+
33+
<!-- Create the 2 children that will be a part of the configurable product -->
34+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
37+
</createData>
38+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
41+
</createData>
42+
43+
<!-- Assign the two products to the configurable product -->
44+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
45+
<requiredEntity createDataKey="createConfigProduct"/>
46+
<requiredEntity createDataKey="createConfigProductAttribute"/>
47+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
48+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
49+
</createData>
50+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
51+
<requiredEntity createDataKey="createConfigProduct"/>
52+
<requiredEntity createDataKey="createConfigChildProduct1"/>
53+
</createData>
54+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
55+
<requiredEntity createDataKey="createConfigProduct"/>
56+
<requiredEntity createDataKey="createConfigChildProduct2"/>
57+
</createData>
58+
</actionGroup>
59+
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@
3636
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
3737
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
3838
</entity>
39+
<entity name="ApiConfigurableProductWithOutCategory" type="product">
40+
<data key="sku" unique="suffix">api-configurable-product-with-out-category</data>
41+
<data key="type_id">configurable</data>
42+
<data key="attribute_set_id">4</data>
43+
<data key="visibility">4</data>
44+
<data key="name" unique="suffix">API Configurable Product</data>
45+
<data key="urlKey" unique="suffix">api-configurable-product</data>
46+
<data key="status">1</data>
47+
<data key="quantity">100</data>
48+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
49+
</entity>
3950
<entity name="ApiConfigurableProductWithDescription" type="product">
4051
<data key="sku" unique="suffix">api-configurable-product</data>
4152
<data key="type_id">configurable</data>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!--Reset the Customer Group grid to the default view-->
12+
<actionGroup name="AdminCustomerGroupResetFilterActionGroup">
13+
<conditionalClick selector="{{AdminCustomerGroupFiltersSection.clearFilters}}" dependentSelector="{{AdminCustomerGroupFiltersSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
14+
<click selector="{{AdminCustomerGroupFiltersSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
15+
<click selector="{{AdminCustomerGroupFiltersSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
16+
<waitForPageLoad stepKey="waitForProductGridLoad"/>
17+
<see selector="{{AdminCustomerGroupFiltersSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 20 additions & 0 deletions
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFilterCustomerGroupByNameActionGroup">
12+
<arguments>
13+
<argument name="customerGroupName" type="string"/>
14+
</arguments>
15+
<click selector="{{AdminCustomerGroupFiltersSection.filterButton}}" stepKey="openFiltersSectionOnCustomerGroupIndexPage"/>
16+
<conditionalClick selector="{{AdminCustomerGroupFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminCustomerGroupFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
17+
<fillField userInput="{{customerGroupName}}" selector="{{AdminCustomerGroupFiltersSection.nameField}}" stepKey="fillNameFieldOnFiltersSection"/>
18+
<click selector="{{AdminCustomerGroupFiltersSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="AdminCustomerGroupsIndexPage" url="/customer/group/" area="admin" module="Magento_Customer">
12+
<section name="AdminCustomerGroupGridActionsSection"/>
13+
<section name="AdminCustomerGroupFiltersSection"/>
14+
</page>
15+
</pages>
Lines changed: 20 additions & 0 deletions
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminCustomerGroupFiltersSection">
12+
<element name="filterButton" type="button" selector="//div[@class='data-grid-filters-action-wrap']/button" timeout="30"/>
13+
<element name="clearFiltersButton" type="button" selector="//div[@class='admin__data-grid-header']//button[@class='action-tertiary action-clear']" timeout="10"/>
14+
<element name="applyFilters" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
15+
<element name="nameField" type="input" selector=".admin__data-grid-filters-wrap._show input[name='customer_group_code']" timeout="30"/>
16+
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
17+
<element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/>
18+
<element name="viewBookmark" type="button" selector="//div[contains(@class, 'admin__data-grid-action-bookmarks')]/ul/li/div/a[text() = '{{label}}']" parameterized="true" timeout="30"/>
19+
</section>
20+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminCustomerGroupGridActionsSection">
12+
<element name="selectButton" type="button" selector="table.data-grid button.action-select" timeout="30"/>
13+
<element name="selectButtonItem" type="text" selector="//ul[@class='action-menu _active']//a[contains(text(), '{{selectItem}}')]" timeout="30" parameterized="true"/>
14+
</section>
15+
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminCustomerGroupMainActionsSection">
12+
<element name="popupOkButton" type="button" selector="button.action-primary.action-accept" timeout="30"/>
13+
</section>
14+
</sections>

0 commit comments

Comments
 (0)