Skip to content

Commit 63cdff5

Browse files
committed
Finish the test
1 parent 4f660a1 commit 63cdff5

File tree

5 files changed

+70
-8
lines changed

5 files changed

+70
-8
lines changed

app/code/Magento/Config/Test/Mftf/ActionGroup/AdminOpenAdminSectionPageActionGroup.xml renamed to app/code/Magento/Config/Test/Mftf/ActionGroup/AdminOpenConfigAdminPageActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="AdminOpenAdminSectionPageActionGroup">
11-
<amOnPage url="{{AdminEditAdminSectionPage.url}}" stepKey="goToConfigurationPage"/>
10+
<actionGroup name="AdminOpenConfigAdminPageActionGroup">
11+
<amOnPage url="{{AdminConfigAdminPage.url}}" stepKey="goToAdminSectionPage"/>
1212
<waitForPageLoad stepKey="waitForPageLoad"/>
1313
</actionGroup>
1414
</actionGroups>

app/code/Magento/Config/Test/Mftf/ActionGroup/AdminSetMaximumLoginFailuresToLockoutAccountActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminSetMaximumLoginFailuresToLockoutAccountActionGroup">
1212
<arguments>
13-
<argument name="qty" type="string" defaultValue="5"/>
13+
<argument name="qty" type="string" defaultValue="3"/>
1414
</arguments>
1515
<uncheckOption selector="{{AdminSection.systemValueForMaximumLoginFailures}}" stepKey="uncheckUseSystemValue"/>
1616
<fillField selector="{{AdminSection.MaximumLoginFailures}}" userInput="{{qty}}" stepKey="setMaximumLoginFailures"/>

app/code/Magento/Config/Test/Mftf/Page/AdminConfigurationAdminSectionPage.xml renamed to app/code/Magento/Config/Test/Mftf/Page/AdminConfigAdminPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
9-
<page name="AdminEditAdminSectionPage" url="admin/system_config/edit/section/admin" module="Magento_Config" area="admin">
9+
<page name="AdminConfigAdminPage" url="admin/system_config/edit/section/admin" module="Magento_Config" area="admin">
1010
<section name="AdminSection"/>
1111
</page>
1212
</pages>

app/code/Magento/User/Test/Mftf/Data/UserData.xml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,40 @@
108108
<item>1</item>
109109
</array>
110110
</entity>
111-
111+
<entity name="adminUserCorrectPassword" type="user">
112+
<data key="username">admin_user_with_correct_password</data>
113+
<data key="firstname">John</data>
114+
<data key="lastname">Doe</data>
115+
<data key="email" unique="prefix">[email protected]</data>
116+
<data key="password">123123q</data>
117+
<data key="password_confirmation">123123q</data>
118+
<data key="interface_local">en_US</data>
119+
<data key="interface_local_label">English (United States)</data>
120+
<data key="is_active">true</data>
121+
<data key="is_active_label">Active</data>
122+
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
123+
<data key="role">Administrators</data>
124+
<array key="roles">
125+
<item>1</item>
126+
</array>
127+
</entity>
128+
<entity name="adminUserIncorrectPassword" type="user">
129+
<data key="username">admin_user_with_correct_password</data>
130+
<data key="firstname">John</data>
131+
<data key="lastname">Doe</data>
132+
<data key="email" unique="prefix">[email protected]</data>
133+
<data key="password">123123123q</data>
134+
<data key="password_confirmation">123123123q</data>
135+
<data key="interface_local">en_US</data>
136+
<data key="interface_local_label">English (United States)</data>
137+
<data key="is_active">true</data>
138+
<data key="is_active_label">Active</data>
139+
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
140+
<data key="role">Administrators</data>
141+
<array key="roles">
142+
<item>1</item>
143+
</array>
144+
</entity>
112145
<!--
113146
Since User delete action is performed via POST request we created this entity to be able to delete it.
114147
Please use "AdminDeleteUserViaCurlActionGroup".

app/code/Magento/User/Test/Mftf/Test/LockAdminUserEntityTest.xml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,44 @@
2828
<!--Create New User-->
2929
<actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/>
3030
<actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillNewUserForm">
31-
<argument name="user" value="NewAdminUser"/>
31+
<argument name="user" value="adminUserCorrectPassword"/>
3232
</actionGroup>
3333
<actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/>
3434

3535
<!--Configure 'Maximum Login Failures to Lockout Account'-->
36-
<actionGroup ref="AdminOpenAdminSectionPageActionGroup" stepKey="goToConfigurationPage"/>
36+
<actionGroup ref="AdminOpenConfigAdminPageActionGroup" stepKey="goToAdminSectionPage"/>
3737
<actionGroup ref="AdminExpandSecurityTabActionGroup" stepKey="openSecurityTab"/>
3838
<actionGroup ref="AdminSetMaximumLoginFailuresToLockoutAccountActionGroup" stepKey="setMaximumLoginFailures"/>
39-
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveCahges"/>
39+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveChanges"/>
40+
41+
<!-- Log in to Admin Panel with incorrect password specified number of times-->
42+
<actionGroup ref="logout" stepKey="logoutAsDefaultUser"/>
43+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserFirstAttempt">
44+
<argument name="adminUser" value="adminUserIncorrectPassword"/>
45+
</actionGroup>
46+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorFirstAttempt"/>
47+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserSecondAttempt">
48+
<argument name="adminUser" value="adminUserIncorrectPassword"/>
49+
</actionGroup>
50+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorSecondAttempt"/>
51+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserThirdAttempt">
52+
<argument name="adminUser" value="adminUserIncorrectPassword"/>
53+
</actionGroup>
54+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorThirdAttempt"/>
55+
56+
<!-- Log in to Admin Panel with correct password-->
57+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserFourthAttempt">
58+
<argument name="adminUser" value="adminUserCorrectPassword"/>
59+
</actionGroup>
60+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorFourthAttempt"/>
61+
62+
<!--Login as default admin user-->
63+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/>
64+
65+
<!--Delete new User-->
66+
<actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser">
67+
<argument name="user" value="adminUserCorrectPassword"/>
68+
</actionGroup>
4069

4170
</test>
4271
</tests>

0 commit comments

Comments
 (0)