Skip to content

Commit 32b6ce6

Browse files
author
Burlacu Vasilii
committed
improved the MFTF tests
1 parent ad0844e commit 32b6ce6

File tree

4 files changed

+36
-26
lines changed

4 files changed

+36
-26
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertSeeProductAttributeHtmlTagsValidationErrorActionGroup.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.
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="AssertSeeProductAttributeValidationErrorActionGroup">
12+
<annotations>
13+
<description>Check whenever the validation is present for the product attribute</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="selector" type="string"/>
18+
<argument name="message" type="string"/>
19+
</arguments>
20+
21+
<seeElement selector="{{selector}}" stepKey="seeValidationDomElement"/>
22+
<see userInput="{{message}}" selector="{{selector}}" stepKey="seeValidationMessage"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Page/AdminProductAttributeFormPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1010
<page name="ProductAttributePage" url="catalog/product_attribute/new/" area="admin" module="Catalog">
1111
<section name="AdminCreateProductAttributeSection"/>
12+
<section name="AdminProductAttributeManageLabelsSection"/>
1213
</page>
1314
</pages>

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductAttributeLabelDontAllowHtmlTagsTest.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939

4040
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveAttribute"/>
4141

42-
<actionGroup ref="AssertSeeProductAttributeValidationErrorActionGroup" stepKey="validateAttributeLabelsForHtmlTags"/>
42+
<actionGroup ref="AssertSeeProductAttributeValidationErrorActionGroup" stepKey="validateAttributeStoreViewLabelForHtmlTags">
43+
<argument name="selector" value="#attribute-labels-table .mage-error"/>
44+
<argument name="message" value="HTML tags are not allowed"/>
45+
</actionGroup>
46+
47+
<click selector="{{AttributePropertiesSection.propertiesTab}}" stepKey="clickPropertiesTab"/>
48+
49+
<actionGroup ref="AssertSeeProductAttributeValidationErrorActionGroup" stepKey="validateAttributeLabelForHtmlTags">
50+
<argument name="selector" value=".field-attribute_label .mage-error"/>
51+
<argument name="message" value="HTML tags are not allowed"/>
52+
</actionGroup>
4353
</test>
4454
</tests>

0 commit comments

Comments
 (0)