-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-3725: MUI controller lacks JSON response, instead returns stat…
…us 200 with empty body #19859
- Loading branch information
Showing
16 changed files
with
281 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...tional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccessWithError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\User\Test\Constraint; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class AssertUserRoleRestrictedAccessWithError extends AssertUserRoleRestrictedAccess | ||
{ | ||
protected $loginStep = 'Magento\User\Test\TestStep\LoginUserOnBackendWithErrorStep'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...sts/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLoginWithError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\User\Test\Constraint; | ||
|
||
use Magento\User\Test\TestStep\LoginUserOnBackendWithErrorStep; | ||
|
||
/** | ||
* Verify whether customer has logged in to the Backend with error alert. | ||
*/ | ||
class AssertUserSuccessLoginWithError extends AssertUserSuccessLogin | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $loginStep = LoginUserOnBackendWithErrorStep::class; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
dev/tests/functional/tests/app/Magento/User/Test/TestStep/CloseErrorAlertStep.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\User\Test\TestStep; | ||
|
||
use Magento\Backend\Test\Page\Adminhtml\Dashboard; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\TestStep\TestStepInterface; | ||
|
||
/** | ||
* Close access error modal message. | ||
*/ | ||
class CloseErrorAlertStep implements TestStepInterface | ||
{ | ||
/** | ||
* @var Dashboard | ||
*/ | ||
private $dashboard; | ||
|
||
/** | ||
* @var BrowserInterface | ||
*/ | ||
private $browser; | ||
|
||
/** | ||
* @param Dashboard $dashboard | ||
* @param BrowserInterface $browser | ||
*/ | ||
public function __construct( | ||
Dashboard $dashboard, | ||
BrowserInterface $browser | ||
) { | ||
$this->dashboard = $dashboard; | ||
$this->browser = $browser; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function run() | ||
{ | ||
$modalMessage = $this->dashboard->getModalMessage(); | ||
try { | ||
$this->browser->waitUntil( | ||
function () use ($modalMessage) { | ||
return $modalMessage->isVisible() ? true : null; | ||
} | ||
); | ||
$modalMessage->acceptAlert(); | ||
} catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { | ||
//There is no modal to accept. | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendWithErrorStep.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\User\Test\TestStep; | ||
|
||
use Magento\Backend\Test\Page\AdminAuthLogin; | ||
use Magento\Backend\Test\Page\Adminhtml\Dashboard; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\User\Test\Fixture\User; | ||
|
||
/** | ||
* Login user on backend with access error. | ||
*/ | ||
class LoginUserOnBackendWithErrorStep extends LoginUserOnBackendStep | ||
{ | ||
/** | ||
* @var CloseErrorAlertStep | ||
*/ | ||
private $closeErrorAlertStep; | ||
|
||
/** | ||
* @param LogoutUserOnBackendStep $logoutUserOnBackendStep | ||
* @param AdminAuthLogin $adminAuth | ||
* @param User $user | ||
* @param Dashboard $dashboard | ||
* @param BrowserInterface $browser | ||
*/ | ||
public function __construct( | ||
LogoutUserOnBackendStep $logoutUserOnBackendStep, | ||
AdminAuthLogin $adminAuth, | ||
User $user, | ||
Dashboard $dashboard, | ||
BrowserInterface $browser, | ||
CloseErrorAlertStep $closeErrorAlertStep | ||
) { | ||
parent::__construct($logoutUserOnBackendStep, $adminAuth, $user, $dashboard, $browser); | ||
$this->closeErrorAlertStep = $closeErrorAlertStep; | ||
} | ||
|
||
/** | ||
* Run step flow. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
parent::run(); | ||
$this->closeErrorAlertStep->run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.