Skip to content

Commit bb85f73

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into ACPT-677
2 parents e52e6e9 + 6bb67b9 commit bb85f73

19 files changed

+1022
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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="AdminCreateCustomGroupInAnAttributeSetActionGroup">
12+
<annotations>
13+
<description> Admin Create Custom Group In An Attribute Set</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="name" type="string"/>
18+
<argument name="customGroupName" type="string"/>
19+
</arguments>
20+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
21+
<click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/>
22+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
23+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
24+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
25+
<waitForPageLoad stepKey="waitForClickNewButton"/>
26+
<click selector="{{AdminProductAttributeSetEditSection.AddNewGroup}}" stepKey="clickAddNew"/>
27+
<waitForPageLoad stepKey="waitForFillname"/>
28+
<fillField userInput="" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillName"/>
29+
<waitForPageLoad stepKey="waitForClickOk"/>
30+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOk"/>
31+
<see userInput="This is a required field." selector="{{AdminProductAttributeSetEditSection.errorLabel}}" stepKey="seeErrorMessage"/>
32+
<fillField userInput="{{customGroupName}}" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillCustomGroupName"/>
33+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickButtonOk"/>
34+
<click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/>
35+
<see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/>
36+
37+
</actionGroup>
38+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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="AdminDeleteCustomGroupDragAndDropAttributesInAnAttributeSetActionGroup">
12+
<annotations>
13+
<description> Admin Delete Custom Group In An Attribute Set</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="name" type="string"/>
18+
<argument name="customGroupName" type="string"/>
19+
</arguments>
20+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
21+
<click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/>
22+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
23+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
24+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
25+
<waitForPageLoad stepKey="waitForSelectCustomGroup"/>
26+
<!-- Delete created custom group -->
27+
<click selector="{{AdminProductAttributeSetEditSection.attributeGroup(customGroupName)}}" stepKey="selectCustomGroup"/>
28+
<click selector="{{AdminProductAttributeSetEditSection.DeleteSelectedGroup}}" stepKey="clickDeleteSelectedGroup"/>
29+
<waitForPageLoad stepKey="waitForAttentionMessage"/>
30+
<seeElement selector="{{AdminProductAttributeSetEditSection.attentionMessage}}" stepKey="assertCustomGroup"/>
31+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOk"/>
32+
<waitForPageLoad stepKey="waitForDragAndDropAttributes"/>
33+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('price')}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroup('Product Details')}}" stepKey="dragAndDrop3"/>
34+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('sku')}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroup('Product Details')}}" stepKey="dragAndDrop4"/>
35+
<click selector="{{AdminProductAttributeSetEditSection.attributeGroup('Custom Group')}}" stepKey="selectCustomGroup1"/>
36+
<click selector="{{AdminProductAttributeSetEditSection.DeleteSelectedGroup}}" stepKey="deleteSelectedGroup1"/>
37+
<waitForPageLoad stepKey="waitForClickSave"/>
38+
<click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/>
39+
<see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/>
40+
41+
</actionGroup>
42+
</actionGroups>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
<element name="xThLineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a/span" parameterized="true"/>
2525
<!-- Buttons -->
2626
<element name="AddNewGroup" type="button" selector="button[data-ui-id='adminhtml-catalog-product-set-edit-add-group-button']"/>
27+
<element name="DeleteSelectedGroup" type="button" selector="button[data-ui-id='adminhtml-catalog-product-set-edit-delete-group-button']"/>
2728
<!-- Modal Window Add New Group -->
2829
<element name="newGroupName" type="input" selector="input[data-role='promptField']"/>
2930
<element name="buttonOk" type="button" selector=".modal-footer .action-primary.action-accept"/>
3031
<element name="errorLabel" type="text" selector="label.mage-error"/>
32+
<element name="attentionMessage" type="text" selector="(//div[@class='modal-inner-wrap'])[2]//div[contains(text(),'This group')]"/>
3133
</section>
3234
</sections>
Lines changed: 56 additions & 0 deletions
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="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAlertDoseNotAppearOnProductPageTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product Page"/>
15+
<title value="Admin Observe alert does not appear on Products page"/>
16+
<description value="Admin should be able to create multiple products"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-28810"/>
19+
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
</before>
24+
25+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage"/>
26+
<actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory">
27+
<argument name="categoryEntity" value="_defaultCategory"/>
28+
</actionGroup>
29+
30+
<actionGroup ref="AdminCreateSimpleProductActionGroup" stepKey="createProduct1">
31+
<argument name="category" value="_defaultCategory"/>
32+
<argument name="simpleProduct" value="SimpleProduct"/>
33+
</actionGroup>
34+
35+
<actionGroup ref="AdminCreateSimpleProductActionGroup" stepKey="createProduct2">
36+
<argument name="category" value="_defaultCategory"/>
37+
<argument name="simpleProduct" value="SimpleProduct2"/>
38+
</actionGroup>
39+
40+
<dontSeeElement selector="{{AdminCategoryBasicFieldSection.urlExistsErrorMessage}}" stepKey="validateSameErrorMessages"/>
41+
42+
<after>
43+
<actionGroup ref="DeleteProductActionGroup" stepKey="deleteSimpleProduct">
44+
<argument name="productName" value="SimpleProduct.name"/>
45+
</actionGroup>
46+
<actionGroup ref="DeleteProductActionGroup" stepKey="deleteSimpleProduct2">
47+
<argument name="productName" value="SimpleProduct2.name"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage"/>
50+
<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory">
51+
<argument name="categoryEntity" value="_defaultCategory"/>
52+
</actionGroup>
53+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
54+
</after>
55+
</test>
56+
</tests>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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="AdminDeleteCustomGroupInAnAttributeSetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Delete Custom Group In An attribute set "/>
15+
<title value="Delete Custom Group from attribute set"/>
16+
<description value="Delete Custom Group from attribute set"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-26728"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
22+
<before>
23+
24+
<!-- Login to Admin -->
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
26+
<!-- Create attribute set with custom group -->
27+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
28+
<actionGroup ref="AdminCreateCustomGroupInAnAttributeSetActionGroup" stepKey="createGroupInAttributeSet">
29+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
30+
<argument name="customGroupName" value="Custom Group"/>
31+
</actionGroup>
32+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="OpenAttributeSet">
33+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
34+
</actionGroup>
35+
<waitForPageLoad stepKey="waitForDragAndDropAttributes"/>
36+
<!-- Drag and drop system product attributes in to custom group -->
37+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('price')}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="dragAndDrop"/>
38+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('sku')}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="dragAndDrop1"/>
39+
<!-- Click Save Attribute -->
40+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/>
41+
42+
</before>
43+
44+
<after>
45+
46+
<!-- Delete attribute set -->
47+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
48+
<!-- Logout from Admin -->
49+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
50+
51+
</after>
52+
<!-- Open attribute set and delete custom group -->
53+
<actionGroup ref="AdminDeleteCustomGroupDragAndDropAttributesInAnAttributeSetActionGroup" stepKey="deleteGroupInAttributeSet">
54+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
55+
<argument name="customGroupName" value="Custom Group"/>
56+
</actionGroup>
57+
58+
<!-- Again open attribute set and search for custom group -->
59+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute1">
60+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
61+
</actionGroup>
62+
<!-- Custom Group is absent in attribute set -->
63+
<dontSeeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup('Custom Group')}}" stepKey="assertCustomGroupIsNotPresent"/>
64+
<!-- Navigate to Catalog > Products -->
65+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/>
66+
<!-- Start to create a new simple product with the custom attribute set from the preconditions -->
67+
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
68+
<waitForPageLoad stepKey="waitForSelectAttribute"/>
69+
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute">
70+
<argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/>
71+
</actionGroup>
72+
<!-- Custom Group is absent in attribute set -->
73+
<dontSeeElement selector="{{AdminProductAttributeSection.attributeGroupByName('Custom Group')}}" stepKey="dontSeeCustomGroup"/>
74+
75+
</test>
76+
</tests>
77+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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="AdminRemoveProductAttributeFromAttributeSetUsingDragAndDropTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Remove product attribute from attrribute set using drag and drop"/>
15+
<title value="Remove attribute from attribute set"/>
16+
<description value="Remove attribute from attribute set"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-26720"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
24+
<createData entity="productAttributeWithDropdownTwoOptions" stepKey="createProductAttribute"/>
25+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/>
26+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
27+
<argument name="group" value="Product Details"/>
28+
<argument name="attribute" value="$$createProductAttribute.attribute_code$$"/>
29+
</actionGroup>
30+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/>
31+
</before>
32+
<after>
33+
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
34+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
35+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
36+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
37+
</after>
38+
<!-- Navigate to Stores > Attributes > Attribute Set -->
39+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
40+
<waitForPageLoad stepKey="waitForPageLoad"/>
41+
<!-- Search and open Attribute Set from preconditions -->
42+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute">
43+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
44+
</actionGroup>
45+
<!-- Move system product attribute from assigned to unassigned -->
46+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute('sku')}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemUnassignedAttribute('1')}}" stepKey="dragAndDrop"/>
47+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
48+
<see userInput="You can't remove attributes from this attribute set." stepKey="seeErrorMessage"/>
49+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOk"/>
50+
<waitForPageLoad stepKey="waitForPopUpDisappear"/>
51+
<!-- Move Custom Product attribute from assigned to unassigned -->
52+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute('$$createProductAttribute.attribute_code$$')}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemUnassignedAttribute('1')}}" stepKey="dragAndDrop1"/>
53+
<!-- Click 'Save' -->
54+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/>
55+
<!-- Again open same attribute set -->
56+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute1">
57+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
58+
</actionGroup>
59+
<waitForPageLoad stepKey="waitForAttributeOpen"/>
60+
<!-- Custom product attribute absent in assigned attribute tree -->
61+
<dontSeeElement selector="{{AdminProductAttributeSetEditSection.assignedAttribute('$$createProductAttribute.attribute_code$$')}}" stepKey="assertProductAttributeIsNotPresent"/>
62+
<!-- Navigate to Catalog > Products -->
63+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/>
64+
<!-- Start to create a new simple product with the custom attribute set from the preconditions -->
65+
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
66+
<waitForPageLoad stepKey="waitForNewProductPage"/>
67+
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute">
68+
<argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/>
69+
</actionGroup>
70+
<!-- Custom Product attribute is absent in attribute set -->
71+
<dontSeeElement selector="{{AdminProductAttributeSection.customAttribute('$$createProductAttribute.attribute_code$$')}}" stepKey="assertProductAttributeIsNotPresent1"/>
72+
<!-- System Product attribute is present in attribute set -->
73+
<seeElement selector="{{AdminProductAttributeSection.textAttributeByCode('sku')}}" stepKey="seeAttributePresent"/>
74+
</test>
75+
</tests>

0 commit comments

Comments
 (0)