Skip to content

Commit 331dba1

Browse files
committed
Merge remote-tracking branch 'origin/MC-23568' into 2.4-develop-sidecar-pr3
2 parents 066ad89 + 8ce9202 commit 331dba1

9 files changed

+207
-7
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAddOptionForDropdownAttributeActionGroup">
12+
<annotations>
13+
<description>Click on new value of selector attribute and fill the values for storefront view, and admin product edit page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storefrontViewAttributeValue" defaultValue="{{ProductAttributeOption8.label}}" type="string" />
17+
<argument name="adminAttributeValue" defaultValue="{{ProductAttributeOption8.label}}" type="string" />
18+
<argument name="rowNumber" defaultValue="0" type="string"/>
19+
</arguments>
20+
<scrollTo selector="{{AdminCreateNewProductAttributeSection.addValue}}" stepKey="scrollToOption"/>
21+
<click selector="{{AdminCreateNewProductAttributeSection.addValue}}" stepKey="clickOnAddValueButton"/>
22+
<waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.defaultStoreView(rowNumber)}}" stepKey="waitForDefaultStoreViewToVisible"/>
23+
<fillField selector="{{AdminCreateNewProductAttributeSection.defaultStoreView(rowNumber)}}" userInput="{{storefrontViewAttributeValue}}" stepKey="fillDefaultStoreView"/>
24+
<fillField selector="{{AdminCreateNewProductAttributeSection.adminOption(rowNumber)}}" userInput="{{adminAttributeValue}}" stepKey="fillAdminField"/>
25+
</actionGroup>
26+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertProductAttributeInAttributeGridActionGroup">
12+
<annotations>
13+
<description>Assert columns label, visible, searchable and comparable for attribute on the product attribute grid</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productAttributeLabel" type="string"/>
17+
<argument name="productAttributeVisible" defaultValue="Yes" type="string"/>
18+
<argument name="productAttributeSearch" defaultValue="Yes" type="string"/>
19+
<argument name="productAttributeCompare" defaultValue="No" type="string"/>
20+
</arguments>
21+
<see selector="{{AdminProductAttributeGridSection.defaultLabelColumn}}" userInput="{{productAttributeLabel}}" stepKey="seeDefaultLabel"/>
22+
<see selector="{{AdminProductAttributeGridSection.isVisibleColumn}}" userInput="{{productAttributeVisible}}" stepKey="seeIsVisibleColumn"/>
23+
<see selector="{{AdminProductAttributeGridSection.isSearchableColumn}}" userInput="{{productAttributeSearch}}" stepKey="seeSearchableColumn"/>
24+
<see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="{{productAttributeCompare}}" stepKey="seeComparableColumn"/>
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminAssertProductAttributeOnProductEditPageActionGroup">
12+
<annotations>
13+
<description>Assert if product attribute present on the product Create/Edit page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeCode" defaultValue="{{newProductAttribute.attribute_code}}" type="string"/>
17+
<argument name="attributeLabel" defaultValue="{{ProductAttributeFrontendLabel.label}}" type="string"/>
18+
</arguments>
19+
<conditionalClick selector="{{AdminProductFormSection.attributeTab}}" dependentSelector="{{AdminProductFormSection.attributeTabOpened}}" visible="false" stepKey="clickToOpen"/>
20+
<scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTab"/>
21+
<seeElement selector="{{AdminProductFormSection.attributeLabelByText(attributeLabel)}}" stepKey="seeAttributeLabelInProductForm"/>
22+
<seeElement selector="{{AdminProductFormSection.newAddedAttribute(attributeCode)}}" stepKey="seeProductAttributeIsAdded"/>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AdminStartCreateProductAttributeOnProductPageActionGroup">
12+
<annotations>
13+
<description>On the Create/Edit product page create new Attribute</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeCode" defaultValue="{{newProductAttribute.attribute_code}}" type="string" />
17+
<argument name="attributeLabel" defaultValue="{{ProductAttributeFrontendLabel.label}}" type="string" />
18+
<argument name="inputType" defaultValue="Dropdown" type="string" />
19+
</arguments>
20+
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/>
21+
<waitForElementVisible selector="{{AdminProductFormSection.createNewAttributeBtn}}" stepKey="waitForCreateBtn"/>
22+
<click selector="{{AdminProductFormSection.createNewAttributeBtn}}" stepKey="clickCreateNewAttributeButton"/>
23+
<waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.defaultLabel}}" stepKey="waitForLabelInput"/>
24+
<fillField selector="{{AdminCreateNewProductAttributeSection.defaultLabel}}" userInput="{{attributeLabel}}" stepKey="fillAttributeLabel"/>
25+
<selectOption selector="{{AdminCreateNewProductAttributeSection.inputType}}" userInput="{{inputType}}" stepKey="setInputType"/>
26+
<click selector="{{AdminCreateNewProductAttributeSection.advancedAttributeProperties}}" stepKey="clickOnAdvancedAttributeProperties"/>
27+
<waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.attributeCode}}" stepKey="waitForAttributeCodeToVisible"/>
28+
<fillField selector="{{AdminCreateNewProductAttributeSection.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCode"/>
29+
</actionGroup>
30+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCreateNewProductAttributeSection">
12-
<element name="saveAttribute" type="button" selector="#save"/>
12+
<element name="saveAttribute" type="button" selector="#save" timeout="30"/>
1313
<element name="defaultLabel" type="input" selector="input[name='frontend_label[0]']"/>
1414
<element name="inputType" type="select" selector="select[name='frontend_input']" timeout="30"/>
1515
<element name="addValue" type="button" selector="//button[contains(@data-action,'add_new_row')]" timeout="30"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
<element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/>
1919
<element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/>
2020
<element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/>
21-
<element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-label col-frontend_label')]"/>
21+
<element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//table[@id='attributeGrid_table']//tbody//td[contains(@class,'col-label col-frontend_label')]"/>
2222
<element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/>
2323
<element name="scopeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_global')]"/>
2424
<element name="isSearchableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_searchable')]"/>
2525
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
2626
</section>
2727
</sections>
28+

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@
4848
<element name="contentTab" type="button" selector="//strong[contains(@class, 'admin__collapsible-title')]/span[text()='Content']"/>
4949
<element name="fieldError" type="text" selector="//input[@name='product[{{fieldName}}]']/following-sibling::label[@class='admin__field-error']" parameterized="true"/>
5050
<element name="priceFieldError" type="text" selector="//input[@name='product[price]']/parent::div/parent::div/label[@class='admin__field-error']"/>
51-
<element name="addAttributeBtn" type="button" selector="#addAttribute"/>
52-
<element name="createNewAttributeBtn" type="button" selector="button[data-index='add_new_attribute_button']"/>
51+
<element name="addAttributeBtn" type="button" selector="#addAttribute" timeout="30"/>
52+
<element name="createNewAttributeBtn" type="button" selector="button[data-index='add_new_attribute_button']" timeout="30"/>
5353
<element name="save" type="button" selector="#save-button" timeout="30"/>
5454
<element name="saveNewAttribute" type="button" selector="//aside[contains(@class, 'create_new_attribute_modal')]//button[@id='save']"/>
5555
<element name="successMessage" type="text" selector="#messages"/>
5656
<element name="attributeTab" type="button" selector="//strong[contains(@class, 'admin__collapsible-title')]/span[text()='Attributes']"/>
57+
<element name="attributeTabOpened" type="button" selector="//div[contains(@class, 'admin__collapsible-block-wrapper') and contains(@class, '_show') ]//span[text()='Attributes']"/>
5758
<element name="attributeLabel" type="input" selector="//input[@name='frontend_label[0]']"/>
5859
<element name="frontendInput" type="select" selector="select[name = 'frontend_input']"/>
5960
<element name="productFormTab" type="button" selector="//strong[@class='admin__collapsible-title']/span[contains(text(), '{{tabName}}')]" parameterized="true"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminCreateCustomProductAttributeWithDropdownFieldTest">
11+
<test name="AdminCreateCustomProductAttributeWithDropdownFieldTest" deprecated="Use AdminVerifyCreateCustomProductAttributeTest">
1212
<annotations>
1313
<stories value="Create product Attribute"/>
14-
<title value="Create Custom Product Attribute Dropdown Field (Not Required) from Product Page"/>
14+
<title value="DEPRECATED: Create Custom Product Attribute Dropdown Field (Not Required) from Product Page"/>
1515
<description value="login as admin and create configurable product attribute with Dropdown field"/>
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MC-10905"/>
1818
<group value="mtf_migrated"/>
1919
<skip>
20-
<issueId value="MC-15474"/>
20+
<issueId value="DEPRECATED">Use AdminVerifyCreateCustomProductAttributeTest</issueId>
2121
</skip>
2222
</annotations>
2323

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminVerifyCreateCustomProductAttributeTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create product Attribute"/>
15+
<title value="Create Custom Product Attribute Dropdown Field (Not Required) from Product Page"/>
16+
<description value="login as admin and create simple product with attribute Dropdown field"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-26027"/>
19+
<group value="mtf_migrated"/>
20+
<group value="catalog"/>
21+
</annotations>
22+
<before>
23+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteCreatedAttribute">
33+
<argument name="productAttributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminPanel"/>
36+
</after>
37+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="navigateToProductPage">
38+
<argument name="productId" value="$createProduct.id$"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminStartCreateProductAttributeOnProductPageActionGroup" stepKey="createDropdownAttribute">
41+
<argument name="attributeCode" value="{{newProductAttribute.attribute_code}}" />
42+
<argument name="attributeLabel" value="{{ProductAttributeFrontendLabel.label}}" />
43+
<argument name="inputType" value="Dropdown" />
44+
</actionGroup>
45+
<scrollTo selector="{{AdminCreateNewProductAttributeSection.storefrontProperties}}" stepKey="scrollToStorefrontProperties"/>
46+
<click selector="{{AdminCreateNewProductAttributeSection.storefrontProperties}}" stepKey="clickOnStorefrontProperties"/>
47+
<waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.inSearch}}" stepKey="waitForStoreFrontProperties"/>
48+
<checkOption selector="{{AdminCreateNewProductAttributeSection.inSearch}}" stepKey="enableInSearchOption"/>
49+
<checkOption selector="{{AdminCreateNewProductAttributeSection.advancedSearch}}" stepKey="enableAdvancedSearch"/>
50+
<checkOption selector="{{AdminCreateNewProductAttributeSection.visibleOnStorefront}}" stepKey="enableVisibleOnStorefront"/>
51+
<checkOption selector="{{AdminCreateNewProductAttributeSection.sortProductListing}}" stepKey="enableSortProductListing"/>
52+
<actionGroup ref="AdminAddOptionForDropdownAttributeActionGroup" stepKey="createDropdownOption">
53+
<argument name="storefrontViewAttributeValue" value="{{ProductAttributeOption8.label}}"/>
54+
<argument name="adminAttributeLabel" value="{{ProductAttributeOption8.label}}"/>
55+
</actionGroup>
56+
<checkOption selector="{{AdminCreateNewProductAttributeSection.defaultRadioButton('1')}}" stepKey="selectRadioButton"/>
57+
<click selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}" stepKey="clickOnSaveAttribute"/>
58+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveTheProduct"/>
59+
<actionGroup ref="AdminAssertProductAttributeOnProductEditPageActionGroup" stepKey="adminProductAssertAttribute">
60+
<argument name="attributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
61+
<argument name="attributeCode" value="{{newProductAttribute.attribute_code}}"/>
62+
</actionGroup>
63+
<actionGroup ref="SearchAttributeByCodeOnProductAttributeGridActionGroup" stepKey="searchAttributeByCodeOnProductAttributeGrid">
64+
<argument name="productAttributeCode" value="{{newProductAttribute.attribute_code}}"/>
65+
</actionGroup>
66+
<actionGroup ref="AdminAssertProductAttributeInAttributeGridActionGroup" stepKey="assertAttributeOnProductAttributesGrid">
67+
<argument name="productAttributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
68+
</actionGroup>
69+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPageOnStorefront">
70+
<argument name="product" value="$createProduct$"/>
71+
</actionGroup>
72+
<actionGroup ref="StorefrontAssertUpdatedProductPriceInStorefrontProductPageActionGroup" stepKey="checkProductPriceAndNameInStorefrontProductPage">
73+
<argument name="productName" value="$createProduct.name$"/>
74+
<argument name="expectedPrice" value="$createProduct.price$"/>
75+
</actionGroup>
76+
<scrollTo selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="scrollToAttribute"/>
77+
<actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkAttributeInMoreInformationTab">
78+
<argument name="attributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
79+
<argument name="attributeValue" value="{{ProductAttributeOption8.value}}"/>
80+
</actionGroup>
81+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductAttribute">
82+
<argument name="phrase" value="{{ProductAttributeOption8.value}}"/>
83+
</actionGroup>
84+
<actionGroup ref="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup" stepKey="assertAttributeWithOptionInLayeredNavigation">
85+
<argument name="attributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
86+
<argument name="attributeOptionLabel" value="{{ProductAttributeOption8.value}}"/>
87+
</actionGroup>
88+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="assertProductPresentOnSearchPage">
89+
<argument name="productName" value="$createProduct.name$"/>
90+
</actionGroup>
91+
</test>
92+
</tests>

0 commit comments

Comments
 (0)