6
6
7
7
namespace Magento \Captcha \Test \TestCase ;
8
8
9
+ use Magento \Backend \Test \Page \AdminAuthLogin ;
9
10
use Magento \Mtf \TestCase \Injectable ;
10
11
use Magento \Mtf \TestStep \TestStepFactory ;
11
12
use Magento \User \Test \Fixture \User ;
29
30
*/
30
31
class CaptchaOnAdminLoginTest extends Injectable
31
32
{
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
-
46
33
/**
47
34
* Admin login page.
48
35
*
@@ -57,58 +44,47 @@ class CaptchaOnAdminLoginTest extends Injectable
57
44
*/
58
45
private $ systemConfigEditPage ;
59
46
60
- /**
61
- * Configuration setting.
62
- *
63
- * @var string
64
- */
65
- private $ configData ;
66
-
67
47
/**
68
48
* Injection data.
69
49
*
70
- * @param AdminAuthLoginWithCaptcha $adminAuthWithCaptcha
71
- * @param TestStepFactory $stepFactory
72
- * @param AssertCaptchaFieldOnBackend $assertCaptcha
73
50
* @param SystemConfigEdit $systemConfigEditPage
74
51
* @return void
75
52
*/
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
+ {
85
55
$ this ->systemConfigEditPage = $ systemConfigEditPage ;
86
56
}
87
57
88
58
/**
89
- * Login user on backend .
59
+ * Log in user to Admin .
90
60
*
61
+ * @param AdminAuthLoginWithCaptcha $adminAuthWithCaptcha
62
+ * @param TestStepFactory $stepFactory
63
+ * @param AssertCaptchaFieldOnBackend $assertCaptcha
91
64
* @param User $customAdmin
65
+ * @param AdminAuthLogin $adminAuthLogin
92
66
* @param string $configData
93
67
* @return void
94
68
*/
95
69
public function test (
70
+ AdminAuthLoginWithCaptcha $ adminAuthWithCaptcha ,
71
+ TestStepFactory $ stepFactory ,
72
+ AssertCaptchaFieldOnBackend $ assertCaptcha ,
96
73
User $ customAdmin ,
74
+ AdminAuthLogin $ adminAuthLogin ,
97
75
$ configData
98
76
) {
99
- $ this ->configData = $ configData ;
100
77
$ customAdmin ->persist ();
101
78
102
79
// Preconditions
103
- $ this -> stepFactory ->create (
80
+ $ stepFactory ->create (
104
81
\Magento \Config \Test \TestStep \SetupConfigurationStep::class,
105
- ['configData ' => $ this -> configData ]
82
+ ['configData ' => $ configData ]
106
83
)->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 ();
112
88
}
113
89
114
90
/**
0 commit comments