Skip to content

Commit fe4f448

Browse files
committed
Merge branch '2.4-develop' of github.com:magento-commerce/magento2ce into eav-graphql
2 parents 1adcba2 + b9101b1 commit fe4f448

14 files changed

+291
-4
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
<data key="is_active">true</data>
3232
<data key="include_in_menu">true</data>
3333
</entity>
34+
<entity name="SimpleSubCat" type="category">
35+
<data key="name" unique="suffix">SubCat</data>
36+
<data key="name_lwr" unique="suffix">simplesubcategory</data>
37+
<data key="urlKey" unique="suffix">simplesubcategory</data>
38+
<data key="is_active">true</data>
39+
<data key="include_in_menu">true</data>
40+
</entity>
3441
<entity name="NewRootCategory" type="category">
3542
<data key="name" unique="suffix">NewRootCategory</data>
3643
<data key="name_lwr" unique="suffix">newrootcategory</data>
@@ -309,4 +316,4 @@
309316
<var key="category_id" entityKey="id" entityType="category"/>
310317
<var key="sku" entityKey="sku" entityType="product"/>
311318
</entity>
312-
</entities>
319+
</entities>

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,29 @@
3131
<data key="used_for_sort_by">true</data>
3232
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
3333
</entity>
34+
<entity name="productAttributeLayered" type="ProductAttribute">
35+
<data key="attribute_code" unique="suffix">attribute</data>
36+
<data key="frontend_input">textarea</data>
37+
<data key="scope">global</data>
38+
<data key="is_required">false</data>
39+
<data key="is_unique">false</data>
40+
<data key="is_searchable">true</data>
41+
<data key="is_visible">true</data>
42+
<data key="backend_type">text</data>
43+
<data key="is_wysiwyg_enabled">true</data>
44+
<data key="is_visible_in_advanced_search">true</data>
45+
<data key="is_visible_on_front">true</data>
46+
<data key="is_filterable">true</data>
47+
<data key="is_filterable_in_search">true</data>
48+
<data key="used_in_product_listing">true</data>
49+
<data key="is_used_for_promo_rules">true</data>
50+
<data key="is_comparable">true</data>
51+
<data key="is_used_in_grid">true</data>
52+
<data key="is_visible_in_grid">true</data>
53+
<data key="is_filterable_in_grid">true</data>
54+
<data key="used_for_sort_by">true</data>
55+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
56+
</entity>
3457
<entity name="productAttributeWithTwoOptions" type="ProductAttribute">
3558
<data key="attribute_code" unique="suffix">attribute</data>
3659
<data key="frontend_input">select</data>
@@ -299,7 +322,7 @@
299322
<data key="frontend_input">date</data>
300323
<data key="is_required_admin">No</data>
301324
</entity>
302-
<entity name="dropdownProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
325+
<entity name="dropdownProductAttribute" extends="productAttributeLayered" type="ProductAttribute">
303326
<data key="frontend_input">select</data>
304327
<data key="frontend_input_admin">Dropdown</data>
305328
<data key="is_required_admin">No</data>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<element name="expandRootCategoryByName" type="button" selector="//div[@class='x-tree-root-node']/li/div/a/span[contains(., '{{categoryName}}')]/../../img[contains(@class, 'x-tree-elbow-end-plus')]" parameterized="true" timeout="30"/>
2424
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
2525
<element name="expandCategoryByName" type="text" selector="//span[contains(text(),'{{categoryName}}')]/ancestor::div[contains(@class,'x-tree-node-el')]//img[contains(@class,'x-tree-elbow-end-plus') or contains(@class,'x-tree-elbow-plus')]" parameterized="true" timeout="30"/>
26-
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SimpleSubCategory') and contains(text(),'({{productCount}})')]" parameterized="true"/>
26+
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SubCat') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2727
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2828
</section>
2929
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<element name="addSwatch" type="button" selector="#add_new_swatch_text_option_button"/>
2626
<element name="dropdownAddOptions" type="button" selector="#add_new_option_button" timeout="30"/>
2727
<element name="storefrontProperties" type="text" selector="//*[@id='product_attribute_tabs_front']/span[1]"/>
28-
28+
<element name="useInSearchResultsLayeredNavigation" type="select" selector="#is_filterable_in_search"/>
2929
<!-- Manage Options nth child-->
3030
<element name="dropdownNthOptionIsDefault" type="checkbox" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) .input-radio" parameterized="true"/>
3131
<element name="dropdownNthOptionAdmin" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(3) input" parameterized="true"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
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')]"/>
26+
<element name="addSelected" type="button" selector="//*[contains(text(),'Add Selected')]" timeout="30"/>
2627
</section>
2728
</sections>
2829

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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="SavingCustomAttributeValuesUsingUITest">
12+
<annotations>
13+
<group value="Custom Attribute"/>
14+
<stories value="Create Customer Attribute with Multi Select Input Type"/>
15+
<title value="Saving custom attribute values using UI"/>
16+
<description value="Saving custom attribute values using UI"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-7325"/>
19+
</annotations>
20+
21+
<before>
22+
<!--Login as admin-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
24+
<!-- Create Simple Product -->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
26+
<!--Navigate to Stores > Attributes > Product.-->
27+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
28+
29+
<!--Create new Product Attribute as TextField, with code and default value.-->
30+
<actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute">
31+
<argument name="attribute" value="multiselectProductAttribute"/>
32+
</actionGroup>
33+
34+
<!--Navigate to Product Attribute, add Product Options and Save - 1-->
35+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1">
36+
<argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/>
37+
</actionGroup>
38+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1">
39+
<argument name="adminName" value="{{multiselectProductAttribute.option1_admin}}"/>
40+
<argument name="frontName" value="{{multiselectProductAttribute.option1_frontend}}"/>
41+
<argument name="row" value="1"/>
42+
</actionGroup>
43+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2">
44+
<argument name="adminName" value="{{multiselectProductAttribute.option2_admin}}"/>
45+
<argument name="frontName" value="{{multiselectProductAttribute.option2_frontend}}"/>
46+
<argument name="row" value="2"/>
47+
</actionGroup>
48+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3">
49+
<argument name="adminName" value="{{multiselectProductAttribute.option3_admin}}"/>
50+
<argument name="frontName" value="{{multiselectProductAttribute.option3_frontend}}"/>
51+
<argument name="row" value="3"/>
52+
</actionGroup>
53+
54+
<actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults">
55+
<argument name="useInLayeredNavigationValue" value="Filterable (with results)"/>
56+
</actionGroup>
57+
<selectOption selector="{{AttributePropertiesSection.useInSearchResultsLayeredNavigation}}" userInput="Yes" stepKey="selectUseInLayeredNavigationOption"/>
58+
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
59+
60+
<magentoCron groups="index" stepKey="reindex"/>
61+
</before>
62+
<after>
63+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteFirstProduct"/>
64+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage">
65+
<argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/>
66+
</actionGroup>
67+
<click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/>
68+
<click stepKey="clickOk" selector="{{AttributeDeleteModalSection.confirm}}"/>
69+
<waitForPageLoad stepKey="waitForDeletion"/>
70+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
71+
<argument name="indices" value=""/>
72+
</actionGroup>
73+
<!--Log out-->
74+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/>
75+
</after>
76+
77+
<!-- Open created product for edit -->
78+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
79+
<argument name="productId" value="$createSimpleProduct.id$"/>
80+
</actionGroup>
81+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
82+
83+
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/>
84+
<waitForPageLoad stepKey="waitForAttributeAdded"/>
85+
<!-- Filter By Attribute Label on Add Attribute Page -->
86+
<click selector="{{AdminProductFiltersSection.filter}}" stepKey="clickOnFilter"/>
87+
<fillField selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{multiselectProductAttribute.attribute_code}}" stepKey="fillAttrCodeField" />
88+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
89+
<click stepKey="clickonFirstRow" selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}"/>
90+
<click stepKey="clickOnAddSelected" selector="{{AdminProductAttributeGridSection.addSelected}}"/>
91+
<waitForPageLoad stepKey="waitForAttributeAdded2"/>
92+
<!-- Expand 'Attributes' tab -->
93+
<actionGroup ref="AdminExpandProductAttributesTabActionGroup" stepKey="expandAttributesTab"/>
94+
<!-- Check created attribute presents in the 'Attributes' tab -->
95+
<seeElement selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" stepKey="assertAttributeIsPresentInTab"/>
96+
<!-- Select attribute options -->
97+
<selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" userInput="{{multiselectProductAttribute.option1_admin}}" stepKey="selectProduct1AttributeOption"/>
98+
<!-- Save product -->
99+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
100+
<!-- Go to Storefront and search for product-->
101+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToFrontPage"/>
102+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
103+
<argument name="phrase" value="$createSimpleProduct.name$"/>
104+
</actionGroup>
105+
<!-- Assert custom Attribute in Layered Navigation-->
106+
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" stepKey="waitForAttributeVisible"/>
107+
<conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandAttribute"/>
108+
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForAttributeOptionsVisible"/>
109+
<wait time="10" stepKey="Wait"/>
110+
<see selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="{{multiselectProductAttribute.option1_frontend}}" stepKey="seeOption2"/>
111+
</test>
112+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="CustomerLoggedInCheckoutFillNewBillingAddressActionGroup" extends="LoggedInCheckoutFillNewBillingAddressActionGroup">
12+
<annotations>
13+
<description>EXTENDS: LoggedInCheckoutFillNewBillingAddressActionGroup. Removes 'selectCountry' and 'selectState' to select state after country.</description>
14+
</annotations>
15+
16+
<remove keyForRemoval="selectCountry"/>
17+
<remove keyForRemoval="selectState"/>
18+
<selectOption stepKey="selectCountryOption" selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="{{Address.country_id}}"/>
19+
<selectOption stepKey="selectStateOption" selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="{{Address.state}}"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@
5151
<element name="stateProvince" type="text" selector="//div[@name='shippingAddress.region_id']//span[contains(text(),'State/Province')]" timeout="30"/>
5252
<element name="stateProvinceWithoutAsterisk" type="text" selector="//div[@class='field' and @name='shippingAddress.region_id']" timeout="30"/>
5353
<element name="stateProvinceWithAsterisk" type="text" selector="//div[@class='field _required' and @name='shippingAddress.region_id']" timeout="30"/>
54+
<element name="selectCountry" type="select" selector="//div[@class='billing-address-form']//select[@name='country_id']"/>
5455
</section>
5556
</sections>

0 commit comments

Comments
 (0)