Skip to content

Commit 919b404

Browse files
authored
Merge branch 'magento-commerce:2.4-develop' into comm_78764_33411
2 parents ec794f1 + ab999dd commit 919b404

File tree

33 files changed

+827
-28
lines changed

33 files changed

+827
-28
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="AdminAddCustomAttributeToSelectedProductActionGroup">
12+
<annotations>
13+
<description>Add the created attribute to the selected product</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeCode" type="string" defaultValue="test_attribute"/>
17+
<argument name="adminOption1" type="string" defaultValue="value 1 admin"/>
18+
</arguments>
19+
20+
<click selector="{{AdminProductFormActionSection.addAttributeButton}}" stepKey="clickOnAddAttributeButton" />
21+
<click selector="{{AdminProductAttributeSetGridSection.searchAttributeByFilter}}" stepKey="searchAttributeByFilter" />
22+
<fillField selector="{{AdminProductAttributeSetGridSection.setAttributeCode}}" userInput="{{attributeCode}}" stepKey="filterAttributeCode"/>
23+
<click selector="{{AdminProductAttributeSetGridSection.applyFilter}}" stepKey="applyFilter" />
24+
<waitForPageLoad stepKey="waitForResultsToBeDisplayed"/>
25+
<checkOption selector="{{AdminProductAttributeSetGridSection.selectFromAttributeResult(attributeCode)}}" stepKey="selectAttributeFromDisplayedResult"/>
26+
<click selector="{{AdminProductAttributeSetGridSection.addSelected}}" stepKey="clickAddSelectedButton" />
27+
<waitForPageLoad stepKey="waitForAttributesToBeAdded"/>
28+
<scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTab" />
29+
<click selector="{{AdminProductFormSection.attributeTab}}" stepKey="expandAttributeTab" />
30+
<selectOption selector="{{AdminProductFormSection.customSelectField(attributeCode)}}" userInput="{{adminOption1}}" stepKey="selectAvalueFromDropdown"/>
31+
<click selector="{{AdminProductFormSection.save}}" stepKey="saveTheProduct" />
32+
<waitForPageLoad stepKey="waitForProductsToBeSaved"/>
33+
</actionGroup>
34+
</actionGroups>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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="AdminVerifiesListAndGridModeActionGroup">
12+
<annotations>
13+
<description>Catalog Verifies List and Grid Modes.</description>
14+
</annotations>
15+
16+
<!-- verify changes in List mode -->
17+
18+
<seeElement selector="{{AdminChecksListAndGridModeSection.listView}}" stepKey="seePageInListView"/>
19+
<scrollTo selector="{{AdminChecksListAndGridModeSection.gridMode}}" stepKey="scrollToGridMode"/>
20+
<click selector="{{AdminChecksListAndGridModeSection.gridMode}}" stepKey="clickGridMode"/>
21+
<waitForPageLoad stepKey="waitForGridMode"/>
22+
<seeElement selector="{{AdminChecksListAndGridModeSection.listView}}" stepKey="seePageInGridView"/>
23+
<click selector="{{AdminChecksListAndGridModeSection.listView}}" stepKey="clickListMode"/>
24+
<waitForPageLoad stepKey="waitForListMode"/>
25+
<seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="1" stepKey="seeNumberOfProductsInPage1"/>
26+
<click selector="{{AdminChecksListAndGridModeSection.productsPerPage}}" stepKey="clickProductsPerPageButtonInListMode"/>
27+
<waitForPageLoad stepKey="waitForProductsPerPage"/>
28+
<click selector="{{AdminChecksListAndGridModeSection.allButton}}" stepKey="selectAllButton"/>
29+
<waitForPageLoad stepKey="waitForSelectAll"/>
30+
<seeElement selector="{{AdminChecksListAndGridModeSection.allProducts}}" stepKey="seeAllProducts"/>
31+
<click selector="{{AdminChecksListAndGridModeSection.gridMode}}" stepKey="switchToGridMode"/>
32+
<seeElement selector="{{AdminChecksListAndGridModeSection.gridView}}" stepKey="seePageInGridView2"/>
33+
<click selector="{{StorefrontCategoryProductSection.categoryListView}}" stepKey="switchToListMode1"/>
34+
<seeElement selector="{{AdminChecksListAndGridModeSection.listView}}" stepKey="seePageInListView1"/>
35+
<click selector="{{AdminChecksListAndGridModeSection.gridMode}}" stepKey="switchToGridMode1"/>
36+
<click selector="{{AdminChecksListAndGridModeSection.productsPerPage}}" stepKey="clickProductsPerPageButtonInGridMode"/>
37+
<waitForPageLoad stepKey="waitForProductsPerPageOpen"/>
38+
<seeElement selector="{{AdminChecksListAndGridModeSection.pageOptions('1')}}" stepKey="seePageOptions1"/>
39+
<seeElement selector="{{AdminChecksListAndGridModeSection.pageOptions('2')}}" stepKey="seePageOptions2"/>
40+
<seeElement selector="{{AdminChecksListAndGridModeSection.pageOptions('3')}}" stepKey="seePageOptions3"/>
41+
<seeElement selector="{{AdminChecksListAndGridModeSection.pageOptions('4')}}" stepKey="seePageOptions4"/>
42+
<seeElement selector="{{AdminChecksListAndGridModeSection.pageOptions('5')}}" stepKey="seePageOptions5"/>
43+
44+
</actionGroup>
45+
</actionGroups>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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="CreateCustomAttributeActionGroup">
12+
<annotations>
13+
<description>Create a custom attribute to be added to any product from admin portal.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeLabel" type="string" defaultValue="Test Attribute"/>
17+
<argument name="attributeCode" type="string" defaultValue="test_attribute"/>
18+
<argument name="inputType" type="string" defaultValue="Dropdown"/>
19+
<argument name="valueRequired" type="string" defaultValue="Yes"/>
20+
<argument name="adminOption1" type="string" defaultValue="value 1 admin"/>
21+
<argument name="adminOption1Value" type="string" defaultValue="value1"/>
22+
<argument name="adminOption2" type="string" defaultValue="value 2 admin"/>
23+
<argument name="adminOption2Value" type="string" defaultValue="value2"/>
24+
<argument name="toBeUsedInSearch" type="string" defaultValue="Yes"/>
25+
<argument name="isComparableOnStoreFront" type="string" defaultValue="Yes"/>
26+
<argument name="usedInLayeredNavigation" type="string" defaultValue="Filterable (with results)"/>
27+
<argument name="isVisibleOnCatalogPagesOnStorefront" type="string" defaultValue="Yes"/>
28+
</arguments>
29+
30+
<!-- Navigate to Stores > Attributes > Products > Product Attribute-->
31+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
32+
33+
<!-- Click on Add new Attribute button -->
34+
<click selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="clickAddNewAttributeButton"/>
35+
36+
<!-- Add details to Attribute Properties -->
37+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeLabel}}" stepKey="fillAttributeLabel"/>
38+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{inputType}}" stepKey="selectDropdown"/>
39+
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="{{valueRequired}}" stepKey="selectRequiredAsYes"/>
40+
41+
<click selector="{{AttributePropertiesSection.dropdownAddOptions}}" stepKey="addOptions"/>
42+
<checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault('1')}}" stepKey="selectIsDefaultForValue1"/>
43+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionAdmin('1')}}" userInput="{{adminOption1}}" stepKey="fillAdmin1"/>
44+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView('1')}}" userInput="{{adminOption1Value}}" stepKey="fillDefaultStoreView1"/>
45+
46+
<click selector="{{AttributePropertiesSection.dropdownAddOptions}}" stepKey="addOptionsAgain"/>
47+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionAdmin('2')}}" userInput="{{adminOption2}}" stepKey="fillAdmin2"/>
48+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView('2')}}" userInput="{{adminOption2Value}}" stepKey="fillDefaultStoreView2"/>
49+
50+
<!-- Add details to Advanced Attribute Properties -->
51+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="clickAdvancedAttributeProperties"/>
52+
<waitForElementVisible selector="{{AttributePropertiesSection.AttributeCode}}" stepKey="waitForAttributeCodeToBeVisible"/>
53+
<fillField selector="{{AttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCode"/>
54+
55+
<!-- Navigate to Storefront Properties -->
56+
<scrollToTopOfPage stepKey="scrollToStoreFrontProperties"/>
57+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontProperties"/>
58+
59+
<!-- Provide the Storefront Properties -->
60+
<selectOption selector="{{AdminNewAttributePanel.useInSearch}}" userInput="{{toBeUsedInSearch}}" stepKey="selectYesForUseInSearch"/>
61+
<selectOption selector="{{AdminNewAttributePanel.comparableOnStorefront}}" userInput="{{isComparableOnStoreFront}}" stepKey="selectYesForComparableOnStorefront"/>
62+
<selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" userInput="{{usedInLayeredNavigation}}" stepKey="selectLayeredNavigation"/>
63+
<selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" userInput="{{isVisibleOnCatalogPagesOnStorefront}}" stepKey="selectYesForVisibleOnCatalogPagesForStoreFront"/>
64+
65+
<!-- Save the Attribute -->
66+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="saveTheAttribute"/>
67+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
68+
</actionGroup>
69+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/CatalogStorefrontConfigData.xml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,52 @@
7777
<data key="path">catalog/frontend/grid_per_page</data>
7878
<data key="value">1</data>
7979
</entity>
80-
</entities>
80+
<entity name="CustomListMode">
81+
<data key="path">catalog/frontend/list_mode</data>
82+
<data key="value">list-grid</data>
83+
</entity>
84+
<entity name="CustomStoreFrontGridPerPageValuesConfigData">
85+
<data key="path">catalog/frontend/grid_per_page_values</data>
86+
<data key="value">1,10,50,100</data>
87+
</entity>
88+
<entity name="CustomStoreFrontGridPerPageConfigData">
89+
<data key="path">catalog/frontend/grid_per_page</data>
90+
<data key="value">10</data>
91+
</entity>
92+
<entity name="CustomStoreFrontListPerPageValuesConfigData">
93+
<data key="path">catalog/frontend/list_per_page_values</data>
94+
<data key="value">1,10,30</data>
95+
</entity>
96+
<entity name="CustomStoreFrontListPerPageConfigData">
97+
<data key="path">catalog/frontend/list_per_page</data>
98+
<data key="value">1</data>
99+
</entity>
100+
<entity name="CustomStoreFrontProductsSortBy">
101+
<data key="path">catalog/frontend/default_sort_by</data>
102+
<data key="value">price</data>
103+
</entity>
104+
<entity name="CustomStoreFrontAllProductsPerPage">
105+
<data key="path">catalog/frontend/list_allow_all</data>
106+
<data key="value">1</data>
107+
</entity>
108+
<entity name="DefaultListMode">
109+
<data key="path">catalog/frontend/list_mode</data>
110+
<data key="value">grid-list</data>
111+
</entity>
112+
<entity name="DefaultStoreFrontListPerPageValuesConfigData">
113+
<data key="path">catalog/frontend/list_per_page_values</data>
114+
<data key="value">5,10,15,20,25</data>
115+
</entity>
116+
<entity name="DefaultStoreFrontListPerPageConfigData">
117+
<data key="path">catalog/frontend/list_per_page</data>
118+
<data key="value">10</data>
119+
</entity>
120+
<entity name="DefaultStoreFrontProductsSortBy">
121+
<data key="path">catalog/frontend/default_sort_by</data>
122+
<data key="value">position</data>
123+
</entity>
124+
<entity name="DefaultStoreFrontAllProductsPerPage">
125+
<data key="path">catalog/frontend/list_allow_all</data>
126+
<data key="value">0</data>
127+
</entity>
128+
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
<data key="name" unique="suffix">ApiCategory</data>
1919
<data key="is_active">true</data>
2020
</entity>
21+
<entity name="CategoryB" type="category">
22+
<data key="name" unique="suffix">CategoryB</data>
23+
<data key="name_lwr" unique="suffix">CategoryB</data>
24+
<data key="urlKey" unique="suffix">CategoryB</data>
25+
<data key="is_active">true</data>
26+
</entity>
2127
<entity name="SimpleSubCategory" type="category">
2228
<data key="name" unique="suffix">SimpleSubCategory</data>
2329
<data key="name_lwr" unique="suffix">simplesubcategory</data>
@@ -279,4 +285,4 @@
279285
<var key="category_id" entityKey="id" entityType="category"/>
280286
<var key="sku" entityKey="sku" entityType="product"/>
281287
</entity>
282-
</entities>
288+
</entities>

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
2323
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
2424
</entity>
25+
<entity name="productA" type="product">
26+
<data key="name" unique="suffix">productA</data>
27+
<data key="sku" unique="suffix">productAfortest</data>
28+
<data key="urlKey" unique="suffix">simple-product-for-producta</data>
29+
<data key="type_id">simple</data>
30+
<data key="attribute_set_id">4</data>
31+
<data key="visibility">4</data>
32+
<data key="price">123.00</data>
33+
<data key="status">1</data>
34+
<data key="quantity">100</data>
35+
<data key="weight">1</data>
36+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
37+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
38+
</entity>
2539
<entity name="SimpleProductQty100" type="product">
2640
<data key="name" unique="suffix">testProductName</data>
2741
<data key="sku" unique="suffix">testSku</data>
@@ -1471,4 +1485,4 @@
14711485
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
14721486
</entity>
14731487

1474-
</entities>
1488+
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<element name="expandAll" type="button" selector=".tree-actions a:last-child"/>
1414
<element name="categoryHighlighted" type="text" selector="//div[@id='store.menu']//span[contains(text(),'{{name}}')]/ancestor::li" parameterized="true" timeout="30"/>
1515
<element name="categoryNotHighlighted" type="text" selector="[id=\'store.menu\'] ul li.active" timeout="30"/>
16-
<element name="categoryTreeRoot" type="text" selector="div.x-tree-root-node>li.x-tree-node:first-of-type>div.x-tree-node-el:first-of-type" timeout="30"/>
16+
<element name="categoryTreeRoot" type="text" selector="li.x-tree-node:first-of-type > div.x-tree-node-el:first-of-type" timeout="30"/>
1717
<element name="categoryInTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
1818
<element name="categoryInTreeUnderRoot" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{name}}')]" parameterized="true"/>
1919
<element name="childCategoryUnderParent" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{parentCategoryName}}')]/../../../ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{childCategoryName}}')]" parameterized="true"/>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminChecksListAndGridModeSection">
12+
13+
<element name="listView" type="text" selector='//*[@id="maincontent"]//*[@data-value="list"]'/>
14+
<element name="gridMode" type="button" selector="//a[@class='modes-mode mode-grid']"/>
15+
<element name="gridView" type="text" selector='//*[@id="maincontent"]//*[@data-value="grid"]'/>
16+
<element name="listMode" type="button" selector='//*[@id="maincontent"]//*[@data-value="list]'/>
17+
<element name="pageProduct" type="text" selector='(//ol[@class="products list items product-items"]/li)[1]'/>
18+
<element name="sortByPrice" type="text" selector='.//*[@id="sorter"]//option[@value="price"]'/>
19+
<element name="productsPerPage" type="button" selector='//*[@class="field limiter"]//*[@id="limiter"]'/>
20+
<element name="allButton" type="button" selector='//*[@id="limiter"]/option[4]'/>
21+
<element name="allProducts" type="text" selector='//ol[@class="products list items product-items"]'/>
22+
<element name="pageOptions" type="text" selector='//*[@id="limiter"]/option[{{var1}}]' parameterized="true"/>
23+
<element name="productCount" type="text" selector='//span[@class="product-image-wrapper"]'/>
24+
25+
</section>
26+
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/AttributePropertiesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
<element name="dropdownNthOptionDefaultStoreView" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(4) input" parameterized="true"/>
3030
<element name="dropdownNthOptionDelete" type="button" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) button[title='Delete']" parameterized="true"/>
3131
<element name="attributeLabelValidationError" type="text" selector=".field-attribute_label .mage-error"/>
32+
<element name="AttributeCode" type="input" selector="#attribute_code"/>
3233
</section>
3334
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
<element name="AttributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
1616
<element name="addAttributeSetBtn" type="button" selector="button.add-set" timeout="30"/>
1717
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/>
18+
<element name="selectAttributeTitle" type="text" selector="//div[contains(text(),'Select Attribute')]" timeout="30"/>
19+
<element name="searchAttributeByFilter" type="button" selector="//div[@class='data-grid-filters-action-wrap']//button[contains(text(),'Filters')]" timeout="30"/>
20+
<element name="setAttributeCode" type="input" selector="//input[@name='attribute_code']" timeout="30"/>
21+
<element name="applyFilter" type="button" selector="//button[@class='action-secondary' and @data-action='grid-filter-apply']" timeout="30"/>
22+
<element name="selectFromAttributeResult" type="checkbox" selector="//div[@class='data-grid-cell-content' and contains(text(),'{{var1}}')]/../..//input[@data-action='select-row']" parameterized="true"/>
23+
<element name="addSelected" type="button" selector="//button//span[contains(text(),'Add Selected')]"/>
1824
</section>
1925
</sections>

0 commit comments

Comments
 (0)