Skip to content

Commit

Permalink
#20772: MTF test fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
p-bystritsky committed Apr 9, 2019
1 parent 4c71a22 commit b159dfb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 47 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\User\Test\Constraint;

use Magento\User\Test\Page\Adminhtml\UserEdit;
use Magento\Mtf\Constraint\AbstractConstraint;

/**
* Assert that success message appears after click on 'Force Sing-In' button.
*/
class AssertAccessTokensSuccessfullyRevoked extends AbstractConstraint
{
/**
* User revoke tokens success message.
*/
const SUCCESS_MESSAGE = 'You have revoked the user\'s tokens.';

/**
* Assert that success message appears after click on 'Force Sing-In' button.
*
* @param UserEdit $userEdit
* @return void
*/
public function processAssert(UserEdit $userEdit): void
{
\PHPUnit\Framework\Assert::assertEquals(
self::SUCCESS_MESSAGE,
$userEdit->getMessagesBlock()->getSuccessMessage()
);
}

/**
* Return string representation of object
*
* @return string
*/
public function toString()
{
return self::SUCCESS_MESSAGE . ' message is present on UserEdit page.';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<testCase name="Magento\User\Test\TestCase\RevokeAllAccessTokensForAdminWithoutTokensTest" summary="Revoke All Access Tokens for Admin without Tokens" ticketId="MAGETWO-29675">
<variation name="RevokeAllAccessTokensForAdminWithoutTokensTestVariation1">
<data name="user/dataset" xsi:type="string">custom_admin</data>
<constraint name="Magento\User\Test\Constraint\AssertAccessTokensErrorRevokeMessage" />
<constraint name="Magento\User\Test\Constraint\AssertAccessTokensSuccessfullyRevoked" />
</variation>
</testCase>
</config>

0 comments on commit b159dfb

Please sign in to comment.