Skip to content

Commit 94e4491

Browse files
committed
MAGETWO-66310: [FT] Magento\Captcha\Test\TestCase\CaptchaOnAdminLoginTest is failing
1 parent aa27856 commit 94e4491

File tree

2 files changed

+19
-43
lines changed

2 files changed

+19
-43
lines changed

dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnAdminLoginTest.php

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Captcha\Test\TestCase;
88

9+
use Magento\Backend\Test\Page\AdminAuthLogin;
910
use Magento\Mtf\TestCase\Injectable;
1011
use Magento\Mtf\TestStep\TestStepFactory;
1112
use Magento\User\Test\Fixture\User;
@@ -29,20 +30,6 @@
2930
*/
3031
class CaptchaOnAdminLoginTest extends Injectable
3132
{
32-
/**
33-
* Step factory.
34-
*
35-
* @var TestStepFactory
36-
*/
37-
private $stepFactory;
38-
39-
/**
40-
* Assert Captcha.
41-
*
42-
* @var AssertCaptchaFieldOnBackend
43-
*/
44-
private $assertCaptcha;
45-
4633
/**
4734
* Admin login page.
4835
*
@@ -57,58 +44,47 @@ class CaptchaOnAdminLoginTest extends Injectable
5744
*/
5845
private $systemConfigEditPage;
5946

60-
/**
61-
* Configuration setting.
62-
*
63-
* @var string
64-
*/
65-
private $configData;
66-
6747
/**
6848
* Injection data.
6949
*
70-
* @param AdminAuthLoginWithCaptcha $adminAuthWithCaptcha
71-
* @param TestStepFactory $stepFactory
72-
* @param AssertCaptchaFieldOnBackend $assertCaptcha
7350
* @param SystemConfigEdit $systemConfigEditPage
7451
* @return void
7552
*/
76-
public function __inject(
77-
AdminAuthLoginWithCaptcha $adminAuthWithCaptcha,
78-
TestStepFactory $stepFactory,
79-
AssertCaptchaFieldOnBackend $assertCaptcha,
80-
SystemConfigEdit $systemConfigEditPage
81-
) {
82-
$this->stepFactory = $stepFactory;
83-
$this->adminAuthWithCaptcha = $adminAuthWithCaptcha;
84-
$this->assertCaptcha = $assertCaptcha;
53+
public function __inject(SystemConfigEdit $systemConfigEditPage)
54+
{
8555
$this->systemConfigEditPage = $systemConfigEditPage;
8656
}
8757

8858
/**
89-
* Login user on backend.
59+
* Log in user to Admin.
9060
*
61+
* @param AdminAuthLoginWithCaptcha $adminAuthWithCaptcha
62+
* @param TestStepFactory $stepFactory
63+
* @param AssertCaptchaFieldOnBackend $assertCaptcha
9164
* @param User $customAdmin
65+
* @param AdminAuthLogin $adminAuthLogin
9266
* @param string $configData
9367
* @return void
9468
*/
9569
public function test(
70+
AdminAuthLoginWithCaptcha $adminAuthWithCaptcha,
71+
TestStepFactory $stepFactory,
72+
AssertCaptchaFieldOnBackend $assertCaptcha,
9673
User $customAdmin,
74+
AdminAuthLogin $adminAuthLogin,
9775
$configData
9876
) {
99-
$this->configData = $configData;
10077
$customAdmin->persist();
10178

10279
// Preconditions
103-
$this->stepFactory->create(
80+
$stepFactory->create(
10481
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
105-
['configData' => $this->configData]
82+
['configData' => $configData]
10683
)->run();
107-
108-
$this->adminAuthWithCaptcha->open();
109-
$this->adminAuthWithCaptcha->getLoginBlockWithCaptcha()->fill($customAdmin);
110-
$this->assertCaptcha->processAssert($this->adminAuthWithCaptcha);
111-
$this->adminAuthWithCaptcha->getLoginBlockWithCaptcha()->submit();
84+
$adminAuthLogin->open();
85+
$adminAuthWithCaptcha->getLoginBlockWithCaptcha()->fill($customAdmin);
86+
$assertCaptcha->processAssert($adminAuthWithCaptcha);
87+
$adminAuthWithCaptcha->getLoginBlockWithCaptcha()->submit();
11288
}
11389

11490
/**

dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnAdminLoginTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<data name="customAdmin/data/captcha" xsi:type="string">111</data>
1313
<data name="pageTitle" xsi:type="string">Dashboard</data>
1414
<data name="configData" xsi:type="string">captcha_backend_login</data>
15-
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/>
15+
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" />
1616
</variation>
1717
</testCase>
1818
</config>

0 commit comments

Comments
 (0)