Skip to content

Commit 633b313

Browse files
committed
Coverage mftf test
1 parent 3c64566 commit 633b313

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
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="StorefrontAssertUnableSearchNegativeForPriceFieldActionGroup" extends="StorefrontFillFormAdvancedSearchActionGroup">
12+
<remove keyForRemoval="waitForPageLoad" />
13+
<grabTextFrom selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFromError}}" stepKey="grabPriceFromError"/>
14+
<grabTextFrom selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceToError}}" stepKey="grabPriceToError"/>
15+
<assertEquals stepKey="assertErrorMessagePriceFrom">
16+
<actualResult type="string">{{UnableNegativePrice.Error_message}}</actualResult>
17+
<expectedResult type="string">$grabPriceFromError</expectedResult>
18+
</assertEquals>
19+
<assertEquals stepKey="assertErrorMessagePriceTo">
20+
<actualResult type="string">{{UnableNegativePrice.Error_message}}</actualResult>
21+
<expectedResult type="string">$grabPriceToError</expectedResult>
22+
</assertEquals>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/CatalogSearch/Test/Mftf/Data/MinMaxQueryLengthHintsData.xml renamed to app/code/Magento/CatalogSearch/Test/Mftf/Data/MessageAndHintData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@
1111
<entity name="MinMaxQueryLength" type="constant">
1212
<data key="Hint">This value must be compatible with the corresponding setting in the configured search engine</data>
1313
</entity>
14+
<entity name="UnableNegativePrice" type="constant">
15+
<data key="Error_message">Please enter a number 0 or greater in this field.</data>
16+
</entity>
1417
</entities>

app/code/Magento/CatalogSearch/Test/Mftf/Section/StorefrontCatalogSearchAdvancedFormSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<element name="ShortDescription" type="input" selector="#short_description"/>
1717
<element name="PriceFrom" type="input" selector="#price"/>
1818
<element name="PriceTo" type="input" selector="#price_to"/>
19+
<element name="PriceFromError" type="text" selector="#price-error"/>
20+
<element name="PriceToError" type="text" selector="#price_to-error"/>
1921
<element name="AttributeByCode" type="input" selector="#{{var1}}" parameterized="true"/>
2022
<element name="SubmitButton" type="button" selector="//*[@id='form-validate']//button[@type='submit']"/>
2123
</section>
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontCheckUnableAdvancedSearchWithNegativePriceTest">
12+
<annotations>
13+
<stories value="Use Advanced Search"/>
14+
<title value="Unable negative price use to advanced search"/>
15+
<description value="Check unable negative price use to advanced search by price from and price to"/>
16+
</annotations>
17+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
18+
<actionGroup ref="StorefrontOpenAdvancedSearchActionGroup" stepKey="openAdvancedSearch"/>
19+
<actionGroup ref="StorefrontAssertUnableSearchNegativeForPriceFieldActionGroup" stepKey="assertUnableSearch">
20+
<argument name="price_to" value="-50"/>
21+
<argument name="price_from" value="-10"/>
22+
</actionGroup>
23+
</test>
24+
</tests>

0 commit comments

Comments
 (0)