Skip to content

Commit f2f89a6

Browse files
committed
Merge branch 'MC-244' into RE-develop
2 parents 6216112 + 00094dc commit f2f89a6

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductAttributeSetGridSection">
12+
<element name="filter" type="input" selector="#setGrid_filter_set_name"/>
13+
<element name="searchBtn" type="button" selector="#container button[title='Search']" timeout="30"/>
14+
<element name="nthRow" type="block" selector="#setGrid_table tbody tr:nth-of-type({{var1}})" parameterized="true"/>
1215
<element name="AttributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
16+
<element name="addAttributeSetBtn" type="button" selector="button.add-set" timeout="30"/>
1317
</section>
1418
</sections>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductAttributeSetSection">
12+
<element name="name" type="input" selector="#attribute_set_name"/>
13+
<element name="basedOn" type="select" selector="#skeleton_set"/>
14+
<element name="saveBtn" type="button" selector="button.save-attribute-set" timeout="30"/>
15+
<element name="deleteBtn" type="button" selector="button[title='Delete']" timeout="30"/>
16+
<element name="attribute" type="button" selector="//span[text()='{{var1}}']" parameterized="true"/>
17+
<element name="addNewGroupBtn" type="button" selector="button.add" timeout="30"/>
18+
<element name="newGroupName" type="input" selector="input[name='name']"/>
19+
<element name="modalOk" type="button" selector="button.action-accept" timeout="30"/>
20+
</section>
1121
<section name="AttributeSetSection">
1222
<element name="Save" type="button" selector="button[title='Save']" />
1323
</section>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1010
<section name="AdminProductFormSection">
11+
<element name="attributeSet" type="select" selector="div[data-index='attribute_set_id'] .admin__field-control"/>
12+
<element name="attributeSetFilter" type="input" selector="div[data-index='attribute_set_id'] .admin__field-control input"/>
13+
<element name="attributeSetFilterResult" type="input" selector="div[data-index='attribute_set_id'] .action-menu-item._last" timeout="30"/>
1114
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
1215
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
1316
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
@@ -33,6 +36,7 @@
3336
<element name="productFormTabState" type="text" selector="//strong[@class='admin__collapsible-title']/span[contains(text(), '{{tabName}}')]/parent::*/parent::*[@data-state-collapsible='{{state}}']" parameterized="true"/>
3437
<element name="visibility" type="select" selector="//select[@name='product[visibility]']"/>
3538
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
39+
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
3640
</section>
3741
<section name="ProductInWebsitesSection">
3842
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="AdminCreateProductCustomAttributeSet">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/Update attribute set"/>
15+
<title value="Admin should be able to create a simple product using a custom attribute set"/>
16+
<description value="Admin should be able to create a simple product using a custom attribute set"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-244"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
</before>
25+
26+
<after>
27+
<!-- Delete the new attribute set -->
28+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
29+
<waitForPageLoad stepKey="wait1"/>
30+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="filterByName"/>
31+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
32+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
33+
<waitForPageLoad stepKey="wait2"/>
34+
<click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/>
35+
<click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/>
36+
<waitForPageLoad stepKey="wait3"/>
37+
38+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
39+
</after>
40+
41+
<!-- Create a new attribute set -->
42+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
43+
<waitForPageLoad stepKey="wait1"/>
44+
<click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/>
45+
<fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillName"/>
46+
<selectOption selector="{{AdminProductAttributeSetSection.basedOn}}" userInput="Default" stepKey="selectDefaultSet"/>
47+
<click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/>
48+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('meta_keyword')}}" selector2="{{AdminProductAttributeSetSection.attribute('manufacturer')}}" stepKey="unassign1"/>
49+
<click selector="{{AdminProductAttributeSetSection.addNewGroupBtn}}" stepKey="clickAddNewGroup"/>
50+
<fillField selector="{{AdminProductAttributeSetSection.newGroupName}}" userInput="TestGroupName" stepKey="fillNewGroupName"/>
51+
<click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="clickOkInModal"/>
52+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('manufacturer')}}" selector2="{{AdminProductAttributeSetSection.attribute('TestGroupName')}}" stepKey="assignManufacturer"/>
53+
<click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave2"/>
54+
55+
<!-- Go to new product page and see a default attribute -->
56+
<amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToNewProductPage"/>
57+
<waitForPageLoad stepKey="wait2"/>
58+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="expandSEOSection"/>
59+
<seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('meta_keyword')}}" stepKey="seeMetaKeyword"/>
60+
<dontSeeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="dontSeeTestGroupName"/>
61+
62+
<!-- Switch from default attribute set to new attribute set -->
63+
<!-- A scrollToTopOfPage is needed to hide the floating header -->
64+
<scrollToTopOfPage stepKey="scrollToTop"/>
65+
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
66+
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/>
67+
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
68+
69+
<!-- See new attibute set -->
70+
<seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="seeTestGroupName"/>
71+
<dontSeeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('meta_keyword')}}" stepKey="dontSeeMetaKeyword"/>
72+
73+
<!-- Finish filling the new product page -->
74+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain">
75+
<argument name="product" value="_defaultProduct"/>
76+
</actionGroup>
77+
<actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/>
78+
79+
<!-- Check the storefront -->
80+
<amOnPage url="{{_defaultProduct.name}}.html" stepKey="goToProductPage"/>
81+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
82+
<seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitlte"/>
83+
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
84+
<see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
85+
<see userInput="${{_defaultProduct.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
86+
</test>
87+
</tests>

0 commit comments

Comments
 (0)