Skip to content

Commit 71cfd54

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-4529' into functional-testing-automation
2 parents b96e313 + 66bc413 commit 71cfd54

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/AttributeManageSwatchSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
<section name="AttributeManageSwatchSection">
1111
<element name="swatchField" type="input" selector="//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Swatch']" parameterized="true"/>
1212
<element name="descriptionField" type="input" selector="//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Description']" parameterized="true"/>
13+
<element name="swatchField1" type="input" selector="(//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Swatch'])[2]" parameterized="true"/>
14+
<element name="descriptionField1" type="input" selector="(//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Description'])[2]" parameterized="true"/>
15+
<element name="swatchField2" type="input" selector="(//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Swatch'])[3]" parameterized="true"/>
16+
<element name="descriptionField2" type="input" selector="(//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Description'])[3]" parameterized="true"/>
1317
</section>
1418
</sections>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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="AdminCreateSwatchAttributeWithSpecialCharactersTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Create Product Attributes"/>
14+
<title value="Admin should be able to Create Swatch Attribute with special characters"/>
15+
<description value="Create Swatch Attribute with special characters"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4529"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
25+
</after>
26+
<!--Navigate to Product attribute page-->
27+
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>
28+
<fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/>
29+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/>
30+
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>
31+
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
32+
<!-- Fill Swatch and Description fields for Admin -->
33+
<fillField selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" userInput="test" stepKey="fillSwatchForAdmin"/>
34+
<fillField selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" userInput="test" stepKey="fillDescriptionForAdmin"/>
35+
<!-- Grab value Swatch and Description fields for Admin -->
36+
<grabValueFrom selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" stepKey="grabSwatchForAdmin"/>
37+
<grabValueFrom selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" stepKey="grabDescriptionForAdmin"/>
38+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
39+
<click selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}" stepKey="clickOnSaveAttribute"/>
40+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
41+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage">
42+
<argument name="ProductAttribute" value="test_label"/>
43+
</actionGroup>
44+
<!-- Check that Swatch and Description fields for Admin are not empty-->
45+
<assertNotEmpty stepKey="checkSwatchFieldForAdmin">
46+
<actualResult type="const">$grabSwatchForAdmin</actualResult>
47+
</assertNotEmpty>
48+
<assertNotEmpty stepKey="checkDescriptionFieldForAdmin">
49+
<actualResult type="const">$grabDescriptionForAdmin</actualResult>
50+
</assertNotEmpty>
51+
</test>
52+
</tests>

0 commit comments

Comments
 (0)