Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCheckoutErrorMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutOnepage;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertCheckoutErrorMessage extends AbstractConstraint
16 {
24  public function processAssert(CheckoutOnepage $checkoutOnepage, $expectedErrorMessage)
25  {
26  \PHPUnit\Framework\Assert::assertEquals(
27  $expectedErrorMessage,
28  $checkoutOnepage->getMessagesBlock()->getErrorMessage(),
29  'Wrong error message is displayed.'
30  );
31  }
32 
38  public function toString()
39  {
40  return 'Error message on Checkout onepage page is correct.';
41  }
42 }
processAssert(CheckoutOnepage $checkoutOnepage, $expectedErrorMessage)