File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
dev/tests/functional/tests/app/Magento/Catalog/Test Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,13 @@ class View extends AbstractConfigureBlock
220
220
*/
221
221
private $ thresholdMessage = '.availability.only ' ;
222
222
223
+ /**
224
+ * Qty field error message selector.
225
+ *
226
+ * @var string
227
+ */
228
+ private $ qtyErrorMessage = '#qty-error ' ;
229
+
223
230
/**
224
231
* Checks if threshold message is displayed.
225
232
*
@@ -677,4 +684,16 @@ public function checkVideoDataPresence($videoData)
677
684
$ dataVideoSelector = $ this ->productVideo . '[data-code=" ' . $ videoData . '"] ' ;
678
685
return $ this ->_rootElement ->find ($ dataVideoSelector )->isPresent ();
679
686
}
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
+ }
680
699
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class AssertProductInventoryMaxAllowedQty extends AbstractConstraint
22
22
*
23
23
* @var string
24
24
*/
25
- private $ errorMessage = 'The most you may purchase is %s. ' ;
25
+ private $ errorMessage = 'The maximum you may purchase is %s. ' ;
26
26
27
27
/**
28
28
* Check if max qty setting is working correctly.
@@ -48,8 +48,8 @@ public function processAssert(
48
48
$ catalogProductView ->getViewBlock ()->waitLoader ();
49
49
$ catalogProductView ->getViewBlock ()->setQtyAndClickAddToCart ($ maxQty * 2 );
50
50
\PHPUnit \Framework \Assert::assertEquals (
51
- $ catalogProductView ->getMessagesBlock ()->getErrorMessage (),
52
51
sprintf ($ this ->errorMessage , $ maxQty ),
52
+ $ catalogProductView ->getViewBlock ()->getQtyErrorMessage (),
53
53
'The maximum purchase warning message is not appears. '
54
54
);
55
55
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ public function processAssert(
48
48
$ catalogProductView ->getViewBlock ()->waitLoader ();
49
49
$ catalogProductView ->getViewBlock ()->setQtyAndClickAddToCart (1 );
50
50
\PHPUnit \Framework \Assert::assertEquals (
51
- $ catalogProductView ->getMessagesBlock ()->getErrorMessage (),
52
51
sprintf ($ this ->errorMessage , $ minQty ),
52
+ $ catalogProductView ->getViewBlock ()->getQtyErrorMessage (),
53
53
'The minimum purchase warning message is not appears. '
54
54
);
55
55
You can’t perform that action at this time.
0 commit comments