Skip to content

Commit 4be13db

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-4186' into functional-testing-automation
2 parents d5fb71a + 1603521 commit 4be13db

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@
8282
<element name="attributeRequiredLabelText" type="text" selector="//*[@class='admin__field-label']//span[text()='{{attributeLabel}}']" parameterized="true"/>
8383
<element name="newAddedAttributeValue" type="text" selector="//option[contains(@data-title,'{{attributeValue}}')]" parameterized="true"/>
8484
<element name="country_Of_Manufacture" type="select" selector="//td[contains(text(), 'country_of_manufacture')]"/>
85+
<element name="textArea" type="text" selector="//textarea[@name='product[test_custom_attribute]']" timeout="30"/>
8586
</section>
8687
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="CreateBundleProductCustomAttributeEntityTextAreaTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Create Bundle Product Custom Attributes"/>
14+
<title value="Admin should be able to create a Bundle Product Custom attribute for text area"/>
15+
<description value="Admin should be able to create a Bundle Product Custom attribute for text area"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4186"/>
18+
<group value="catalog"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<createData entity="SimpleSubCategory" stepKey="simpleCategory1"/>
24+
<createData entity="SimpleProduct" stepKey="simpleProduct1">
25+
<requiredEntity createDataKey="simpleCategory1"/>
26+
</createData>
27+
28+
<!--Create Bundle product-->
29+
<createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct">
30+
<requiredEntity createDataKey="simpleCategory1"/>
31+
</createData>
32+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_1">
33+
<requiredEntity createDataKey="createBundleProduct"/>
34+
<field key="required">True</field>
35+
</createData>
36+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
37+
<requiredEntity createDataKey="createBundleProduct"/>
38+
<requiredEntity createDataKey="createBundleOption1_1"/>
39+
<requiredEntity createDataKey="simpleProduct1"/>
40+
</createData>
41+
</before>
42+
43+
<after>
44+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage">
45+
<argument name="ProductAttribute" value="test_custom_attribute"/>
46+
</actionGroup>
47+
<click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/>
48+
<click stepKey="clickOk" selector="{{AttributeDeleteModalSection.confirm}}"/>
49+
<waitForPageLoad stepKey="waitForDeletion"/>
50+
<deleteData createDataKey="simpleCategory1" stepKey="deleteCategory"/>
51+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
52+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
53+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
54+
</after>
55+
56+
<!-- Navigate to Stores > Attributes > Products > Product Attribute-->
57+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
58+
59+
<!-- Create a custom attribute -->
60+
<!-- Click on Add new Attribute button -->
61+
<click selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="clickAddNewAttributeButton"/>
62+
<!-- Add details to Attribute Properties -->
63+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="test_custom_attribute" stepKey="fillAttributeLabel"/>
64+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Area" stepKey="selectDropdown"/>
65+
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="No" stepKey="selectRequiredAsNo"/>
66+
67+
<!-- Save the Attribute -->
68+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="saveTheAttribute"/>
69+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
70+
71+
<!-- Navigate to Stores > Attributes > Attribute Set -->
72+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
73+
<waitForPageLoad stepKey="waitForPageLoad"/>
74+
75+
<!-- Search and open Attribute Set from preconditions -->
76+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute">
77+
<argument name="name" value="Default"/>
78+
</actionGroup>
79+
80+
<!-- Move created product attribute from unassigned to assigned -->
81+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute('test_custom_attribute')}}" selector2="{{AdminProductAttributeSetEditSection.assignedAttribute('sku')}}" stepKey="dragAndDrop"/>
82+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
83+
84+
<!-- Click 'Save' -->
85+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/>
86+
87+
<!-- open the a bundle product, fill test area and save the product' -->
88+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProduct">
89+
<argument name="productId" value="$$createBundleProduct.id$$"/>
90+
</actionGroup>
91+
<fillField selector="{{AdminProductFormSection.textArea}}" userInput="One, Two, Three" stepKey="fillTextAreaAttribute"/>
92+
<scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/>
93+
<selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/>
94+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
95+
96+
<!-- Open the product created from the product grid, and Verify that the attribute values are preserved' -->
97+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
98+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProduct1">
99+
<argument name="productId" value="$$createBundleProduct.id$$"/>
100+
</actionGroup>
101+
<seeElement selector="{{AdminProductFormSection.textArea}}" stepKey="seeTextAreaAttribute"/>
102+
</test>
103+
</tests>

0 commit comments

Comments
 (0)