Skip to content

Commit cbcd37a

Browse files
merge magento/2.3-develop into magento-engcom/graphql-develop-prs
2 parents 42c6116 + e11f0e4 commit cbcd37a

File tree

48 files changed

+1521
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1521
-27
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="AdminAnchorCategoryActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!--Open Category page-->
16+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
17+
<waitForPageLoad stepKey="waitForPageToLoaded"/>
18+
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
19+
<waitForPageLoad stepKey="waitForCategoryToLoad"/>
20+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="selectCategory"/>
21+
<waitForPageLoad stepKey="waitForPageToLoad"/>
22+
23+
<!--Enable Anchor for category -->
24+
<scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/>
25+
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/>
26+
<checkOption selector="{{CategoryDisplaySettingsSection.anchor}}" stepKey="enableAnchor"/>
27+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveSubCategory"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 24 additions & 0 deletions
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="AdminAssignCategoryToProductAndSaveActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!-- on edit Product page catalog/product/edit/id/{{product_id}}/ -->
16+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown"/>
17+
<checkOption selector="{{AdminProductFormSection.selectCategory(categoryName)}}" stepKey="selectCategory"/>
18+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickDone"/>
19+
<waitForPageLoad stepKey="waitForApplyCategory"/>
20+
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSave"/>
21+
<waitForPageLoad stepKey="waitForSavingProduct"/>
22+
<see userInput="You saved the product." selector="{{CatalogProductsSection.messageSuccessSavedProduct}}" stepKey="seeSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminUnassignCategoryOnProductAndSaveActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!-- on edit Product page catalog/product/edit/id/{{product_id}}/ -->
16+
<click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="clearCategory"/>
17+
<waitForPageLoad stepKey="waitForDelete"/>
18+
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSave"/>
19+
<waitForPageLoad stepKey="waitForSavingProduct"/>
20+
<see userInput="You saved the product." selector="{{CatalogProductsSection.messageSuccessSavedProduct}}" stepKey="seeSuccessMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 17 additions & 0 deletions
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="OpenStoreFrontProductPageActionGroup">
11+
<arguments>
12+
<argument name="productUrlKey" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{StorefrontProductPage.url(productUrlKey)}}" stepKey="amOnProductPage"/>
15+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="StorefrontGoToCategoryPageActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="onFrontend"/>
16+
<waitForPageLoad stepKey="waitForStorefrontPageLoad"/>
17+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
18+
<waitForPageLoad stepKey="waitForCategoryPage"/>
19+
</actionGroup>
20+
<actionGroup name="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup">
21+
<arguments>
22+
<argument name="subCategoryName" type="string"/>
23+
</arguments>
24+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
25+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 17 additions & 0 deletions
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="customGroup">
12+
<data key="name">Custom Group</data>
13+
</entity>
14+
<entity name="emptyGroup">
15+
<data key="name">Empty Group</data>
16+
</entity>
17+
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCategoryProductsSection">
1212
<element name="sectionHeader" type="button" selector="div[data-index='assign_products']" timeout="30"/>
13+
<element name="addProducts" type="button" selector="#catalog_category_add_product_tabs" timeout="30"/>
1314
</section>
1415
</sections>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@
1717
<element name="assignedAttribute" type="text" selector="//*[@id='tree-div1']//span[text()='{{attributeName}}']" parameterized="true"/>
1818
<element name="xThLineItemYthAttributeGroup" type="text" selector="//*[@id='tree-div1']/ul/div/li[{{y}}]//li[{{x}}]" parameterized="true"/>
1919
<element name="xThLineItemAttributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*/parent::*//li[{{x}}]//a/span" parameterized="true"/>
20+
<element name="attributesInGroup" type="text" selector="//span[text()='{{GroupName}}']/../../following-sibling::ul/li" parameterized="true"/>
2021
<!-- Unassigned Attributes Column -->
2122
<element name="unassignedAttributesTree" type="block" selector="#tree-div2"/>
2223
<element name="unassignedAttribute" type="text" selector="//*[@id='tree-div2']//span[text()='{{attributeName}}']" parameterized="true"/>
2324
<element name="xThLineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a/span" parameterized="true"/>
25+
<!-- Buttons -->
26+
<element name="AddNewGroup" type="button" selector="button[data-ui-id='adminhtml-catalog-product-set-edit-add-group-button']"/>
27+
<!-- Modal Window Add New Group -->
28+
<element name="newGroupName" type="input" selector="input[data-role='promptField']"/>
29+
<element name="buttonOk" type="button" selector=".modal-footer .action-primary.action-accept"/>
30+
<element name="errorLabel" type="text" selector="label.mage-error"/>
2431
</section>
2532
</sections>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<element name="productTaxClassDisabled" type="select" selector="select[name='product[tax_class_id]'][disabled=true]"/>
3333
<element name="productTaxClassUseDefault" type="checkbox" selector="input[name='use_default[tax_class_id]']"/>
3434
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']" timeout="30"/>
35+
<element name="currentCategory" type="text" selector=".admin__action-multiselect-crumb > span"/>
3536
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
3637
<element name="unselectCategories" type="button" selector="//span[@class='admin__action-multiselect-crumb']/span[contains(.,'{{category}}')]/../button[@data-action='remove-selected-item']" parameterized="true" timeout="30"/>
3738
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
@@ -70,6 +71,7 @@
7071
<element name="selectMultipleCategories" type="input" selector="//*[@data-index='container_category_ids']//*[contains(@class, '_selected')]"/>
7172
<element name="countryOfManufacture" type="select" selector="select[name='product[country_of_manufacture]']"/>
7273
<element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/>
74+
<element name="footerBlock" type="block" selector="//footer"/>
7375
</section>
7476
<section name="ProductInWebsitesSection">
7577
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
@@ -207,5 +209,7 @@
207209
<element name="textAttributeByName" type="text" selector="//div[@data-index='attributes']//fieldset[contains(@class, 'admin__field') and .//*[contains(.,'{{var}}')]]//input" parameterized="true"/>
208210
<element name="dropDownAttribute" type="select" selector="//select[@name='product[{{arg}}]']" parameterized="true" timeout="30"/>
209211
<element name="attributeSection" type="block" selector="//div[@data-index='attributes']/div[contains(@class, 'admin__collapsible-content _show')]" timeout="30"/>
212+
<element name="attributeGroupByName" type="button" selector="//div[@class='fieldset-wrapper-title']//span[text()='{{group}}']" parameterized="true"/>
213+
<element name="attributeByGroupAndName" type="text" selector="//div[@class='fieldset-wrapper-title']//span[text()='{{group}}']/../../following-sibling::div//span[contains(text(),'attribute')]" parameterized="true"/>
210214
</section>
211215
</sections>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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="AdminCreateNewGroupForAttributeSetTest">
12+
<annotations>
13+
<stories value="Edit attribute set"/>
14+
<title value="Admin should be able to create new group in an Attribute Set"/>
15+
<description value="The test verifies creating a new group in an attribute set and a validation message in case of empty group name"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-170"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<!-- Create a custom attribute set and custom product attribute -->
22+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
23+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
24+
25+
<!-- Login to Admin -->
26+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
27+
</before>
28+
<after>
29+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
30+
<actionGroup ref="logout" stepKey="logout"/>
31+
</after>
32+
33+
<!-- Navigate to Stores > Attributes > Attribute Set -->
34+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
35+
<waitForPageLoad stepKey="waitForPageLoad"/>
36+
37+
<!-- Search and open Attribute Set from preconditions -->
38+
<actionGroup ref="goToAttributeSetByName" stepKey="searchAttribute">
39+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
40+
</actionGroup>
41+
42+
<!-- Click 'Add New': Show 'New Group' Modal -->
43+
<click selector="{{AdminProductAttributeSetEditSection.AddNewGroup}}" stepKey="clickAddNew"/>
44+
<waitForAjaxLoad stepKey="waitForAjax"/>
45+
46+
<!-- Fill 'name' for new group and click 'Ok': Name = <empty> -->
47+
<fillField userInput="" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillName"/>
48+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOk"/>
49+
50+
<!-- Error message 'This is a required field.' is displayed -->
51+
<see userInput="This is a required field." selector="{{AdminProductAttributeSetEditSection.errorLabel}}" stepKey="seeErrorMessage"/>
52+
53+
<!-- Fill 'name' for new group and click 'Ok': Name = Custom group -->
54+
<fillField userInput="{{customGroup.name}}" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillCustomGroupName"/>
55+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickButtonOk"/>
56+
57+
<!-- Group is created and displayed in 'Groups' block -->
58+
<seeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup(customGroup.name)}}" stepKey="assertCustomGroup"/>
59+
60+
<!-- Move custom Product Attribute to new 'Custom group' Group -->
61+
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
62+
<click selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="click"/>
63+
<waitForPageLoad stepKey="waitForPageLoadAfterClick"/>
64+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute($$createConfigProductAttribute.attribute_code$$)}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="moveAttribute"/>
65+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
66+
67+
<!-- Attribute is displayed in the new group -->
68+
<see userInput="$$createConfigProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttribute"/>
69+
70+
<!-- Click 'Save' -->
71+
<actionGroup ref="SaveAttributeSet" stepKey="saveAttribute"/>
72+
73+
<actionGroup ref="goToAttributeSetByName" stepKey="backTohAttributeSet">
74+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
75+
</actionGroup>
76+
77+
<!-- Create another group: Name = Empty group -->
78+
<click selector="{{AdminProductAttributeSetEditSection.AddNewGroup}}" stepKey="clickAddEmptyGroup"/>
79+
<waitForAjaxLoad stepKey="waitForLoad"/>
80+
81+
<fillField userInput="{{emptyGroup.name}}" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillGroupName"/>
82+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOnOk"/>
83+
<waitForPageLoad stepKey="waitForNewGroup"/>
84+
85+
<!-- Empty group is created. No attributes are assigned to it. -->
86+
<seeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup(emptyGroup.name)}}" stepKey="assertEmptyGroup"/>
87+
<dontSeeElement selector="{{AdminProductAttributeSetEditSection.attributesInGroup(emptyGroup.name)}}" stepKey="seeNoAttributes"/>
88+
89+
<!-- Navigate to Catalog > Products -->
90+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductPage"/>
91+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
92+
93+
<!-- Start to create a new simple product with the custom attribute set from the preconditions -->
94+
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
95+
<waitForPageLoad stepKey="waitForNewProductPage"/>
96+
97+
<actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttribute">
98+
<argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/>
99+
</actionGroup>
100+
101+
<!-- New Section 'Custom group' is present in form. The section contains the attribute from preconditions -->
102+
<seeElement selector="{{AdminProductAttributeSection.attributeGroupByName(customGroup.name)}}" stepKey="seeSectionCustomGroup"/>
103+
<click selector="{{AdminProductAttributeSection.attributeGroupByName(customGroup.name)}}" stepKey="openCustomGroupSection"/>
104+
<waitForAjaxLoad stepKey="waitForOpenSection"/>
105+
<scrollTo selector="{{AdminProductFormSection.footerBlock}}" stepKey="scrollToFooter"/>
106+
<seeElement selector="{{AdminProductAttributeSection.attributeByGroupAndName(customGroup.name)}}" stepKey="seeAttributePresent"/>
107+
108+
<!-- Empty section is absent in Product Form -->
109+
<dontSeeElement selector="{{AdminProductAttributeSection.attributeGroupByName(emptyGroup.name)}}" stepKey="dontSeeEmptyGroup"/>
110+
</test>
111+
</tests>

0 commit comments

Comments
 (0)