Skip to content

Commit 2d65a4b

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-92954' into 2.2-develop-mftf-pr2
# Conflicts: # app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
2 parents 3dce7c9 + c2eef01 commit 2d65a4b

14 files changed

+302
-4
lines changed
Lines changed: 37 additions & 0 deletions
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssignAttributeToGroup">
12+
<arguments>
13+
<argument name="group" type="string"/>
14+
<argument name="attribute" type="string"/>
15+
</arguments>
16+
<conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.lineItemAttributeGroup(group, '1')}}" stepKey="dragAndDropToGroupProductDetails"/>
19+
<waitForPageLoad stepKey="waitForPageLoad2"/>
20+
<see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
21+
</actionGroup>
22+
<actionGroup name="UnassignAttributeFromGroup">
23+
<arguments>
24+
<argument name="group" type="string"/>
25+
<argument name="attribute" type="string"/>
26+
</arguments>
27+
<conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/>
28+
<waitForPageLoad stepKey="waitForPageLoad1"/>
29+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.lineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/>
30+
<waitForPageLoad stepKey="waitForPageLoad2"/>
31+
<see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/>
32+
</actionGroup>
33+
<actionGroup name="SaveAttributeSet">
34+
<click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/>
35+
<see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/>
36+
</actionGroup>
37+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="CheckAttributeInAdditionalInformationTabActionGroup">
11+
<arguments>
12+
<argument name="attributeLabel" type="string"/>
13+
<argument name="attributeValue" type="string"/>
14+
</arguments>
15+
<click selector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" stepKey="clickTab"/>
16+
<see userInput="{{attributeLabel}}" selector=" {{StorefrontProductAdditionalInformationSection.attributeLabel}}" stepKey="seeAttributeLabel"/>
17+
<see userInput="{{attributeValue}}" selector="{{StorefrontProductAdditionalInformationSection.attributeValue}}" stepKey="seeAttributeValue"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="CheckAttributeNotInAdditionalInformationTabActionGroup">
11+
<arguments>
12+
<argument name="attributeLabel" type="string"/>
13+
</arguments>
14+
<conditionalClick selector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" dependentSelector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" visible="true" stepKey="clickTab"/>
15+
<dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductAdditionalInformationSection.additionalInfoContainer}}" stepKey="dontSeeAttributeLabel"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
3434
</entity>
3535
<entity name="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
36-
<data key="attribute_code">testattribute</data>
36+
<data key="attribute_code" unique="suffix">testattribute</data>
3737
<data key="frontend_input">select</data>
3838
<data key="scope">global</data>
3939
<data key="is_required">false</data>

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,18 @@
152152
<requiredEntity type="media_gallery_entries">ProductAttributeMediaGalleryEntryMagentoLogo</requiredEntity>
153153
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
154154
</entity>
155+
<entity name="ApiProductWithDescription" type="product">
156+
<data key="sku" unique="suffix">api-simple-product</data>
157+
<data key="type_id">simple</data>
158+
<data key="attribute_set_id">4</data>
159+
<data key="visibility">4</data>
160+
<data key="name" unique="suffix">Api Simple Product</data>
161+
<data key="price">123.00</data>
162+
<data key="urlKey" unique="suffix">api-simple-product</data>
163+
<data key="status">1</data>
164+
<data key="quantity">100</data>
165+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
166+
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
167+
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
168+
</entity>
155169
</entities>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
10+
<page name="AdminProductAttributeSetEditPage" url="catalog/product_set/edit/id/{{var1}}" area="admin" module="Magento_Catalog" parameterized="true">
11+
<section name="AdminProductAttributeSetEditSection"/>
12+
<section name="AdminProductAttributeSetActionSection"/>
13+
</page>
14+
</pages>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontProductPage.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11-
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Category" parameterized="true">
11+
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Category" parameterized="true">
1212
<section name="StorefrontProductPageSection"/>
13+
<section name="StorefrontProductAdditionalInformationSection"/>
1314
</page>
1415
</pages>
Lines changed: 16 additions & 0 deletions
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+
<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="AdminProductAttributeSetActionSection">
12+
<element name="save" type="button" selector="button[title='Save']" timeout="30"/>
13+
<element name="reset" type="button" selector="button[title='Reset']" timeout="30"/>
14+
<element name="back" type="button" selector="button[title='Back']" timeout="30"/>
15+
</section>
16+
</sections>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AdminProductAttributeSetEditSection">
12+
<!-- Groups Column -->
13+
<element name="groupTree" type="block" selector="#tree-div1"/>
14+
<element name="attributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']" parameterized="true"/>
15+
<element name="attributeGroupExtender" type="button" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']" parameterized="true"/>
16+
<element name="attributeGroupCollapsed" type="button" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*[contains(@class, 'collapsed')]" parameterized="true"/>
17+
<element name="assignedAttribute" type="text" selector="//*[@id='tree-div1']//span[text()='{{attributeName}}']" parameterized="true"/>
18+
<element name="lineItemYthAttributeGroup" type="text" selector="//*[@id='tree-div1']/ul/div/li[{{y}}]//li[{{x}}]" parameterized="true"/>
19+
<element name="lineItemAttributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*/parent::*//li[{{x}}]//a/span" parameterized="true"/>
20+
<!-- Unassigned Attributes Column -->
21+
<element name="unassignedAttributesTree" type="block" selector="#tree-div2"/>
22+
<element name="unassignedAttribute" type="text" selector="//*[@id='tree-div2']//span[text()='{{attributeName}}']" parameterized="true"/>
23+
<element name="lineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a/span" parameterized="true"/>
24+
</section>
25+
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
2828
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
2929
<element name="attributeSetSearchCount" type="text" selector="div[data-index='attribute_set_id'] .admin__action-multiselect-search-count"/>
30+
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
3031
</section>
3132
<section name="ProductInWebsitesSection">
3233
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>

0 commit comments

Comments
 (0)