Skip to content

Commit 3dd5138

Browse files
committed
Merge remote-tracking branch 'origin/MC-5274' into 2.3-develop-mftf-pr16
2 parents cdfe946 + 72f651a commit 3dd5138

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ class View extends AbstractConfigureBlock
220220
*/
221221
private $thresholdMessage = '.availability.only';
222222

223+
/**
224+
* Qty field error message selector.
225+
*
226+
* @var string
227+
*/
228+
private $qtyErrorMessage = '#qty-error';
229+
223230
/**
224231
* Checks if threshold message is displayed.
225232
*
@@ -677,4 +684,16 @@ public function checkVideoDataPresence($videoData)
677684
$dataVideoSelector = $this->productVideo . '[data-code="' . $videoData. '"]';
678685
return $this->_rootElement->find($dataVideoSelector)->isPresent();
679686
}
687+
688+
/**
689+
* Resolve qty field error message.
690+
*
691+
* @return string
692+
*/
693+
public function getQtyErrorMessage()
694+
{
695+
$this->waitForElementVisible($this->qtyErrorMessage);
696+
697+
return $this->_rootElement->find($this->qtyErrorMessage)->getText();
698+
}
680699
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInventoryMaxAllowedQty.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AssertProductInventoryMaxAllowedQty extends AbstractConstraint
2222
*
2323
* @var string
2424
*/
25-
private $errorMessage = 'The most you may purchase is %s.';
25+
private $errorMessage = 'The maximum you may purchase is %s.';
2626

2727
/**
2828
* Check if max qty setting is working correctly.
@@ -48,8 +48,8 @@ public function processAssert(
4848
$catalogProductView->getViewBlock()->waitLoader();
4949
$catalogProductView->getViewBlock()->setQtyAndClickAddToCart($maxQty * 2);
5050
\PHPUnit\Framework\Assert::assertEquals(
51-
$catalogProductView->getMessagesBlock()->getErrorMessage(),
5251
sprintf($this->errorMessage, $maxQty),
52+
$catalogProductView->getViewBlock()->getQtyErrorMessage(),
5353
'The maximum purchase warning message is not appears.'
5454
);
5555

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInventoryMinAllowedQty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function processAssert(
4848
$catalogProductView->getViewBlock()->waitLoader();
4949
$catalogProductView->getViewBlock()->setQtyAndClickAddToCart(1);
5050
\PHPUnit\Framework\Assert::assertEquals(
51-
$catalogProductView->getMessagesBlock()->getErrorMessage(),
5251
sprintf($this->errorMessage, $minQty),
52+
$catalogProductView->getViewBlock()->getQtyErrorMessage(),
5353
'The minimum purchase warning message is not appears.'
5454
);
5555

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityPartOneTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Catalog\Test\TestCase\Product\CreateSimpleProductEntityPartOneTest" summary="Create Simple Product" ticketId="MAGETWO-23414">
1010
<variation name="CreateSimpleProductEntityTestVariation12" summary="Create product that visible only in search and check min/max qty allowed in the shopping cart" ticketId="MAGETWO-43376, MAGETWO-43359">
11-
<data name="issue" xsi:type="string">MAGETWO-63217: Error message doesn't appear on add in the cart less products than configured</data>
1211
<data name="configData" xsi:type="string">inventory_min_qty_3, inventory_max_qty_5</data>
1312
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
1413
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>

0 commit comments

Comments
 (0)