Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertContactUsSuccessMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Contact\Test\Page\ContactIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertContactUsSuccessMessage extends AbstractConstraint
16 {
20  const SUCCESS_MESSAGE_PART_1 = "Thanks for contacting us with your comments and questions. ";
21 
25  const SUCCESS_MESSAGE_PART_2 = "We'll respond to you very soon.";
26 
33  public function processAssert(ContactIndex $contactIndex)
34  {
35  \PHPUnit\Framework\Assert::assertEquals(
36  self::SUCCESS_MESSAGE_PART_1 . self::SUCCESS_MESSAGE_PART_2,
37  $contactIndex->getMessagesBlock()->getMessage(),
38  'Wrong message is displayed.'
39  );
40  }
41 
47  public function toString()
48  {
49  return 'Success message is present on contact us page.';
50  }
51 }