Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertUserFailedLoginMessage.php
Go to the documentation of this file.
1 <?php
8 
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertUserFailedLoginMessage extends AbstractConstraint
17 {
19  'The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.';
20 
28  public function processAssert(
29  AdminAuthLogin $adminAuth,
30  User $customAdmin
31  ) {
32  $adminAuth->open();
33  $adminAuth->getLoginBlock()->fill($customAdmin);
34  $adminAuth->getLoginBlock()->submit();
35 
36  \PHPUnit\Framework\Assert::assertEquals(
37  self::FAILED_LOGIN_MESSAGE,
38  $adminAuth->getMessagesBlock()->getErrorMessage(),
39  'Message "' . self::FAILED_LOGIN_MESSAGE . '" is not visible.'
40  );
41  }
42 
48  public function toString()
49  {
50  return 'Invalid credentials message was displayed.';
51  }
52 }
processAssert(AdminAuthLogin $adminAuth, User $customAdmin)