Skip to content

Commit a5fb8dd

Browse files
committed
Merge branch 'MC-168' into RE-develop
# Conflicts: # dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/StorefrontProductPageActionGroup.xml # dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml
2 parents ee041d4 + e07a872 commit a5fb8dd

9 files changed

+257
-0
lines changed
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="../../../../../../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.xThLineItemAttributeGroup(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.xThLineItemUnassignedAttribute('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>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/StorefrontProductPageActionGroup.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,20 @@
3838
<fillField userInput="abcdefghjklansdmnbvdsasdfghjmn" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput5"/>
3939
<see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(10 too many)" stepKey="assertHint5"/>
4040
</actionGroup>
41+
<actionGroup name="checkAttributeInMoreInformationTab">
42+
<arguments>
43+
<argument name="attributeLabel" type="string"/>
44+
<argument name="attributeValue" type="string"/>
45+
</arguments>
46+
<click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/>
47+
<see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/>
48+
<see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeValue"/>
49+
</actionGroup>
50+
<actionGroup name="checkAttributeNotInMoreInformationTab">
51+
<arguments>
52+
<argument name="attributeLabel" type="string"/>
53+
</arguments>
54+
<click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/>
55+
<dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/>
56+
</actionGroup>
4157
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
10+
<page name="AdminProductAttributeSetEditPage" url="catalog/product_set/edit/id" area="admin" module="Catalog">
11+
<section name="AdminProductAttributeSetEditSection"/>
12+
</page>
13+
</pages>
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="../../../../../../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>
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="../../../../../../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="xThLineItemYthAttributeGroup" type="text" selector="//*[@id='tree-div1']/ul/div/li[{{y}}]//li[{{x}}]" parameterized="true"/>
19+
<element name="xThLineItemAttributeGroup" 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="xThLineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a/span" parameterized="true"/>
24+
</section>
25+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<element name="visibility" type="select" selector="//select[@name='product[visibility]']"/>
3838
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
3939
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
40+
<element name="attributeLabel" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
4041
</section>
4142
<section name="ProductInWebsitesSection">
4243
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="StorefrontProductMoreInformationSection">
12+
<element name="moreInformation" type="button" selector="#tab-label-additional-title" timeout="30"/>
13+
<element name="moreInformationTextArea" type="textarea" selector="#additional"/>
14+
<element name="attributeLabel" type="text" selector=".col.label"/>
15+
<element name="attributeValue" type="text" selector=".col.data"/>
16+
</section>
17+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminAssignProductAttributeToAttributeSetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/Update attribute set"/>
15+
<title value="Admin should be able to assign attributes to an attribute set"/>
16+
<description value="Admin should be able to assign attributes to an attribute set"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-168"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<createData entity="productDropDownAttribute" stepKey="attribute"/>
23+
24+
<createData entity="productAttributeOption1" stepKey="option1">
25+
<requiredEntity createDataKey="attribute"/>
26+
</createData>
27+
<createData entity="productAttributeOption2" stepKey="option2">
28+
<requiredEntity createDataKey="attribute"/>
29+
</createData>
30+
31+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
32+
</before>
33+
<after>
34+
<deleteData createDataKey="attribute" stepKey="deleteAttribute"/>
35+
<actionGroup ref="logout" stepKey="logout"/>
36+
</after>
37+
38+
<!-- Go to default attribute set edit page -->
39+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/>
40+
<!-- Assert created attribute in unassigned section -->
41+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/>
42+
<!-- Assign attribute to a group -->
43+
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup">
44+
<argument name="group" value="Product Details"/>
45+
<argument name="attribute" value="$$attribute.attribute_code$$"/>
46+
</actionGroup>
47+
<!-- Assert attribute in a group -->
48+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
49+
<!-- Save attribute set -->
50+
<actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/>
51+
<!-- Go to create new product page -->
52+
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/>
53+
<!-- Assert attribute can be used in product creation -->
54+
<seeElement selector="{{AdminProductFormSection.attributeLabel($$attribute.attribute[frontend_labels][0][label]$$)}}" stepKey="seeLabel"/>
55+
</test>
56+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminUnassignProductAttributeFromAttributeSetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/Update attribute set"/>
15+
<title value="Admin should be able to unassign attributes from an attribute set"/>
16+
<description value="Admin should be able to unassign attributes from an attribute set"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-194"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<createData entity="productDropDownAttribute" stepKey="attribute"/>
23+
24+
<createData entity="productAttributeOption1" stepKey="option1">
25+
<requiredEntity createDataKey="attribute"/>
26+
</createData>
27+
<createData entity="productAttributeOption2" stepKey="option2">
28+
<requiredEntity createDataKey="attribute"/>
29+
</createData>
30+
31+
<createData entity="AddToDefaultSet" stepKey="addToDefaultSet">
32+
<requiredEntity createDataKey="attribute"/>
33+
</createData>
34+
35+
<createData entity="ApiProductWithDescription" stepKey="product"/>
36+
37+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
38+
</before>
39+
<after>
40+
<deleteData createDataKey="attribute" stepKey="deleteAttribute"/>
41+
<actionGroup ref="logout" stepKey="logout"/>
42+
</after>
43+
44+
<!-- Assert attribute presence in storefront product additional information -->
45+
<amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage1"/>
46+
<waitForPageLoad stepKey="wait1"/>
47+
<actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkAttributeInMoreInformationTab">
48+
<argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/>
49+
<argument name="attributeValue" value="$$option2.option[store_labels][0][label]$$"/>
50+
</actionGroup>
51+
<!-- Go to default attribute set edit page -->
52+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/>
53+
<!-- Assert created attribute in a group -->
54+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
55+
<!-- Unassign attribute from group -->
56+
<actionGroup ref="UnassignAttributeFromGroup" stepKey="UnassignAttributeFromGroup">
57+
<argument name="group" value="Product Details"/>
58+
<argument name="attribute" value="$$attribute.attribute_code$$"/>
59+
</actionGroup>
60+
<!-- Assert attribute in unassigned section -->
61+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/>
62+
<!-- Save attribute set -->
63+
<actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/>
64+
<!-- Go to create new product page -->
65+
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/>
66+
<!-- Assert attribute not present in product creation -->
67+
<dontSeeElement selector="{{AdminProductFormSection.attributeLabel($$attribute.attribute[frontend_labels][0][label]$$)}}" stepKey="seeLabel"/>
68+
<!-- Assert removed attribute not presence in storefront product additional information -->
69+
<amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage2"/>
70+
<waitForPageLoad stepKey="wait2"/>
71+
<!-- Skip because of MAGETWO-92780 -->
72+
<!--actionGroup ref="checkAttributeNotInMoreInformationTab" stepKey="checkAttributeNotInMoreInformationTab">
73+
<argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/>
74+
</actionGroup-->
75+
</test>
76+
</tests>

0 commit comments

Comments
 (0)