File tree 8 files changed +187
-0
lines changed
app/code/Magento/Security/Test/Mftf 8 files changed +187
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <actionGroups xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/actionGroupSchema.xsd" >
10
+ <actionGroup name =" AdminCreateNewUserWithExpirationActionGroup" >
11
+ <annotations >
12
+ <description >Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided User with an expiration date and saves.</description >
13
+ </annotations >
14
+ <arguments >
15
+ <argument name =" user" defaultValue =" NewAdminUserWithValidExpiration" />
16
+ </arguments >
17
+
18
+ <amOnPage url =" {{AdminNewUserPage.url}}" stepKey =" navigateToNewUser" />
19
+ <waitForPageLoad stepKey =" waitForUsersPage" />
20
+ <fillField selector =" {{AdminNewUserFormSection.username}}" userInput =" {{user.username}}" stepKey =" enterUserName" />
21
+ <fillField selector =" {{AdminNewUserFormSection.firstname}}" userInput =" {{user.firstName}}" stepKey =" enterFirstName" />
22
+ <fillField selector =" {{AdminNewUserFormSection.lastname}}" userInput =" {{user.lastName}}" stepKey =" enterLastName" />
23
+ <fillField selector =" {{AdminNewUserFormSection.email}}" userInput =" {{user.username}}@magento.com" stepKey =" enterEmail" />
24
+ <fillField selector =" {{AdminNewUserFormSection.password}}" userInput =" {{user.password}}" stepKey =" enterPassword" />
25
+ <fillField selector =" {{AdminNewUserFormSection.passwordConfirmation}}" userInput =" {{user.password}}" stepKey =" confirmPassword" />
26
+ <fillField selector =" {{AdminNewUserFormSection.userExpiresField}}" userInput =" {{user.expires_at}}" stepKey =" enterUserExpiration" />
27
+ <fillField selector =" {{AdminNewUserFormSection.currentPassword}}" userInput =" {{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey =" enterCurrentPassword" />
28
+ <click selector =" {{AdminNewUserFormSection.save}}" stepKey =" clickSaveUser" />
29
+ <waitForPageLoad stepKey =" waitForSaveTheUser" />
30
+ </actionGroup >
31
+ </actionGroups >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <actionGroups xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/actionGroupSchema.xsd" >
10
+ <actionGroup name =" AdminSaveUserInvalidExpirationActionGroup" >
11
+ <annotations >
12
+ <description >Error message for saving an admin user with an invalid expiration date.</description >
13
+ </annotations >
14
+ <see selector =" {{AdminMessagesSection.errorMessage}}" userInput =' "Expiration date" must be later than the current date.' stepKey =" seeErrorMessage" />
15
+ </actionGroup >
16
+ </actionGroups >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <actionGroups xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/actionGroupSchema.xsd" >
10
+ <actionGroup name =" AdminSaveUserSuccessActionGroup" >
11
+ <annotations >
12
+ <description >Success message for saving an admin user successfully.</description >
13
+ </annotations >
14
+ <see userInput =" You saved the user." stepKey =" seeSuccessMessage" />
15
+ </actionGroup >
16
+ </actionGroups >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+
9
+ <entities xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
10
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd" >
11
+
12
+ <entity name =" NewAdminUserWithValidExpiration" type =" user" >
13
+ <data key =" username" unique =" suffix" >adminExpiresAt</data >
14
+ <data key =" firstname" >John</data >
15
+ <data key =" lastname" >Doe</data >
16
+ <
data key =
" email" unique =
" prefix" >
[email protected] </
data >
17
+ <data key =" password" >123123q</data >
18
+ <data key =" password_confirmation" >123123q</data >
19
+ <data key =" interface_local" >en_US</data >
20
+ <data key =" interface_local_label" >English (United States)</data >
21
+ <data key =" is_active" >true</data >
22
+ <data key =" is_active_label" >Active</data >
23
+ <data key =" current_password" >{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data >
24
+ <data key =" role" >Administrators</data >
25
+ <data key =" expires_at" >Sep 3, 2030 4:42:36 PM</data >
26
+ <array key =" roles" >
27
+ <item >1</item >
28
+ </array >
29
+ </entity >
30
+
31
+ <entity name =" NewAdminUserWithInvalidExpiration" type =" user" extends =" NewAdminUserWithValidExpiration" >
32
+ <data key =" expires_at" >Sep 3, 2000 4:42:36 PM</data >
33
+ </entity >
34
+ </entities >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <sections xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Page/etc/SectionObject.xsd" >
10
+ <section name =" AdminEditUserSection" >
11
+ <element name =" userExpiresField" type =" input" selector =" #user_expires_at" />
12
+ </section >
13
+ </sections >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <sections xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Page/etc/SectionObject.xsd" >
10
+ <section name =" AdminNewUserFormSection" >
11
+ <element name =" userExpiresField" type =" input" selector =" #page_tabs_main_section_content input[name='expires_at']" />
12
+ </section >
13
+ </sections >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <tests xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/testSchema.xsd" >
10
+ <test name =" AdminUserCreateNewUserWithInvalidExpirationTest" >
11
+ <annotations >
12
+ <features value =" Security" />
13
+ <stories value =" Create new user with invalid expiration date." />
14
+ <title value =" Create new user with invalid expiration date" />
15
+ <description value =" Create new user with invalid expiration date." />
16
+ <testCaseId value =" " />
17
+ <severity value =" CRITICAL" />
18
+ <group value =" security_userexpiration" />
19
+ </annotations >
20
+ <before >
21
+ <!-- Log in to Admin Panel -->
22
+ <actionGroup ref =" LoginAsAdmin" stepKey =" loginAsAdmin" />
23
+ </before >
24
+
25
+ <!-- Create new user with user expiration set -->
26
+ <actionGroup ref =" AdminCreateNewUserWithExpirationActionGroup" stepKey =" fillInNewUserWithInvalidExpiration" >
27
+ <argument name =" user" value =" NewAdminUserWithInvalidExpiration" />
28
+ </actionGroup >
29
+
30
+ <actionGroup ref =" AdminSaveUserInvalidExpirationActionGroup" stepKey =" saveNewUserWithInvalidExpirationError" />
31
+ </test >
32
+ </tests >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <tests xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/testSchema.xsd" >
10
+ <test name =" AdminUserCreateNewUserWithValidExpirationTest" >
11
+ <annotations >
12
+ <features value =" Security" />
13
+ <stories value =" Create new user with valid expiration date." />
14
+ <title value =" Create new user with valid expiration date" />
15
+ <description value =" Create new user with valid expiration date." />
16
+ <testCaseId value =" " />
17
+ <severity value =" CRITICAL" />
18
+ <group value =" security_userexpiration" />
19
+ </annotations >
20
+ <before >
21
+ <!-- Log in to Admin Panel -->
22
+ <actionGroup ref =" LoginAsAdmin" stepKey =" loginAsAdmin" />
23
+ </before >
24
+
25
+ <!-- Create new user with user expiration set -->
26
+ <actionGroup ref =" AdminCreateNewUserWithExpirationActionGroup" stepKey =" fillInNewUserWithValidExpiration" >
27
+ <argument name =" user" value =" NewAdminUserWithValidExpiration" />
28
+ </actionGroup >
29
+
30
+ <actionGroup ref =" AdminSaveUserSuccessActionGroup" stepKey =" saveNewUserWithValidExpirationSuccess" />
31
+ </test >
32
+ </tests >
You can’t perform that action at this time.
0 commit comments