Skip to content

Commit b159dfb

Browse files
committed
#20772: MTF test fix.
1 parent 4c71a22 commit b159dfb

File tree

3 files changed

+46
-47
lines changed

3 files changed

+46
-47
lines changed

dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\User\Test\Constraint;
8+
9+
use Magento\User\Test\Page\Adminhtml\UserEdit;
10+
use Magento\Mtf\Constraint\AbstractConstraint;
11+
12+
/**
13+
* Assert that success message appears after click on 'Force Sing-In' button.
14+
*/
15+
class AssertAccessTokensSuccessfullyRevoked extends AbstractConstraint
16+
{
17+
/**
18+
* User revoke tokens success message.
19+
*/
20+
const SUCCESS_MESSAGE = 'You have revoked the user\'s tokens.';
21+
22+
/**
23+
* Assert that success message appears after click on 'Force Sing-In' button.
24+
*
25+
* @param UserEdit $userEdit
26+
* @return void
27+
*/
28+
public function processAssert(UserEdit $userEdit): void
29+
{
30+
\PHPUnit\Framework\Assert::assertEquals(
31+
self::SUCCESS_MESSAGE,
32+
$userEdit->getMessagesBlock()->getSuccessMessage()
33+
);
34+
}
35+
36+
/**
37+
* Return string representation of object
38+
*
39+
* @return string
40+
*/
41+
public function toString()
42+
{
43+
return self::SUCCESS_MESSAGE . ' message is present on UserEdit page.';
44+
}
45+
}

dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<testCase name="Magento\User\Test\TestCase\RevokeAllAccessTokensForAdminWithoutTokensTest" summary="Revoke All Access Tokens for Admin without Tokens" ticketId="MAGETWO-29675">
1010
<variation name="RevokeAllAccessTokensForAdminWithoutTokensTestVariation1">
1111
<data name="user/dataset" xsi:type="string">custom_admin</data>
12-
<constraint name="Magento\User\Test\Constraint\AssertAccessTokensErrorRevokeMessage" />
12+
<constraint name="Magento\User\Test\Constraint\AssertAccessTokensSuccessfullyRevoked" />
1313
</variation>
1414
</testCase>
1515
</config>

0 commit comments

Comments
 (0)