Skip to content

Commit 196e353

Browse files
author
Burlacu Vasilii
committed
refactored MFTF tests
1 parent 32b6ce6 commit 196e353

5 files changed

+56
-10
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminProductAttributePageSwitchTabActionGroup">
12+
<annotations>
13+
<description>Switches the active tab on the Product Attribute New/Edit Page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="tabName" type="string"/>
17+
</arguments>
18+
19+
<click selector="#product_attribute_tabs a[title='{{tabName}}']" stepKey="changeProductAttributeActiveTab"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="AssertSeeProductAttributeValidationErrorActionGroup">
11+
<actionGroup name="AssertSeeProductAttributeValidationErrorOnPropertiesTabActionGroup">
1212
<annotations>
13-
<description>Check whenever the validation is present for the product attribute</description>
13+
<description>Check whenever the validation error is present for the product attribute in the "Properties" Tab</description>
1414
</annotations>
1515

1616
<arguments>
17-
<argument name="selector" type="string"/>
17+
<argument name="selector" type="string" defaultValue=".field-attribute_label .mage-error"/>
1818
<argument name="message" type="string"/>
1919
</arguments>
2020

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="AssertSeeProductAttributeValidationErrorOnManageLabelsTabActionGroup">
12+
<annotations>
13+
<description>Check whenever the validation error is present for the product attribute in the "Manage Labels" Tab</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="selector" type="string" defaultValue="#attribute-labels-table .mage-error"/>
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/Section/AdminProductAttributeManageLabelsSection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminProductAttributeManageLabelsSection">
12-
<element name="ManageLabelsTab" selector="#product_attribute_tabs_labels" type="button"/>
1312
<element name="DefaultStoreLabel" type="input" selector="#attribute-labels-table [name='frontend_label[1]']"/>
1413
</section>
1514
</sections>

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,25 @@
3131
<argument name="attributeType" value="{{productAttributeWithHtmlTagsInLabel.frontend_input}}" />
3232
</actionGroup>
3333

34-
<click selector="{{AdminProductAttributeManageLabelsSection.ManageLabelsTab}}" stepKey="clickManageLabelsTab"/>
34+
<actionGroup ref="AdminProductAttributePageSwitchTabActionGroup" stepKey="makeManageLabelsTabActive">
35+
<argument name="tabName" value="Manage Labels"/>
36+
</actionGroup>
3537

3638
<actionGroup ref="AdminFillProductAttributeDefaultStoreViewActionGroup" stepKey="fillAttributeDefaultStoreViewLabel">
3739
<argument name="value" value="{{productAttributeWithHtmlTagsInLabel.default_store_label}}"/>
3840
</actionGroup>
3941

4042
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveAttribute"/>
4143

42-
<actionGroup ref="AssertSeeProductAttributeValidationErrorActionGroup" stepKey="validateAttributeStoreViewLabelForHtmlTags">
43-
<argument name="selector" value="#attribute-labels-table .mage-error"/>
44+
<actionGroup ref="AssertSeeProductAttributeValidationErrorOnManageLabelsTabActionGroup" stepKey="validateAttributeStoreViewLabelForHtmlTags">
4445
<argument name="message" value="HTML tags are not allowed"/>
4546
</actionGroup>
4647

47-
<click selector="{{AttributePropertiesSection.propertiesTab}}" stepKey="clickPropertiesTab"/>
48+
<actionGroup ref="AdminProductAttributePageSwitchTabActionGroup" stepKey="makePropertiesTabActive">
49+
<argument name="tabName" value="Properties"/>
50+
</actionGroup>
4851

49-
<actionGroup ref="AssertSeeProductAttributeValidationErrorActionGroup" stepKey="validateAttributeLabelForHtmlTags">
50-
<argument name="selector" value=".field-attribute_label .mage-error"/>
52+
<actionGroup ref="AssertSeeProductAttributeValidationErrorOnPropertiesTabActionGroup" stepKey="validateAttributeLabelForHtmlTags">
5153
<argument name="message" value="HTML tags are not allowed"/>
5254
</actionGroup>
5355
</test>

0 commit comments

Comments
 (0)