-
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.
Merge branch 'mftf' into project_pepe
- Loading branch information
Showing
8 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...de/Magento/Security/Test/Mftf/ActionGroup/AdminCreateNewUserWithExpirationActionGroup.xml
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,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminCreateNewUserWithExpirationActionGroup"> | ||
<annotations> | ||
<description>Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided User with an expiration date and saves.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="user" defaultValue="NewAdminUserWithValidExpiration"/> | ||
</arguments> | ||
|
||
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> | ||
<waitForPageLoad stepKey="waitForUsersPage" /> | ||
<fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="enterUserName" /> | ||
<fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstName}}" stepKey="enterFirstName" /> | ||
<fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastName}}" stepKey="enterLastName" /> | ||
<fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" /> | ||
<fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="enterPassword" /> | ||
<fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password}}" stepKey="confirmPassword" /> | ||
<fillField selector="{{AdminNewUserFormSection.userExpiresField}}" userInput="{{user.expires_at}}" stepKey="enterUserExpiration" /> | ||
<fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" /> | ||
<click selector="{{AdminNewUserFormSection.save}}" stepKey="clickSaveUser" /> | ||
<waitForPageLoad stepKey="waitForSaveTheUser" /> | ||
</actionGroup> | ||
</actionGroups> |
16 changes: 16 additions & 0 deletions
16
...code/Magento/Security/Test/Mftf/ActionGroup/AdminSaveUserInvalidExpirationActionGroup.xml
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSaveUserInvalidExpirationActionGroup"> | ||
<annotations> | ||
<description>Error message for saving an admin user with an invalid expiration date.</description> | ||
</annotations> | ||
<see selector="{{AdminMessagesSection.errorMessage}}" userInput='"Expiration date" must be later than the current date.' stepKey="seeErrorMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
16 changes: 16 additions & 0 deletions
16
app/code/Magento/Security/Test/Mftf/ActionGroup/AdminSaveUserSuccessActionGroup.xml
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSaveUserSuccessActionGroup"> | ||
<annotations> | ||
<description>Success message for saving an admin user successfully.</description> | ||
</annotations> | ||
<see userInput="You saved the user." stepKey="seeSuccessMessage" /> | ||
</actionGroup> | ||
</actionGroups> |
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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
|
||
<entity name="NewAdminUserWithValidExpiration" type="user"> | ||
<data key="username" unique="suffix">adminExpiresAt</data> | ||
<data key="firstname">John</data> | ||
<data key="lastname">Doe</data> | ||
<data key="email" unique="prefix">[email protected]</data> | ||
<data key="password">123123q</data> | ||
<data key="password_confirmation">123123q</data> | ||
<data key="interface_local">en_US</data> | ||
<data key="interface_local_label">English (United States)</data> | ||
<data key="is_active">true</data> | ||
<data key="is_active_label">Active</data> | ||
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> | ||
<data key="role">Administrators</data> | ||
<data key="expires_at">Sep 3, 2030 4:42:36 PM</data> | ||
<array key="roles"> | ||
<item>1</item> | ||
</array> | ||
</entity> | ||
|
||
<entity name="NewAdminUserWithInvalidExpiration" type="user" extends="NewAdminUserWithValidExpiration"> | ||
<data key="expires_at">Sep 3, 2000 4:42:36 PM</data> | ||
</entity> | ||
</entities> |
13 changes: 13 additions & 0 deletions
13
app/code/Magento/Security/Test/Mftf/Section/AdminEditUserSection.xml
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminEditUserSection"> | ||
<element name="userExpiresField" type="input" selector="#user_expires_at"/> | ||
</section> | ||
</sections> |
13 changes: 13 additions & 0 deletions
13
app/code/Magento/Security/Test/Mftf/Section/AdminNewUserFormSection.xml
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminNewUserFormSection"> | ||
<element name="userExpiresField" type="input" selector="#page_tabs_main_section_content input[name='expires_at']"/> | ||
</section> | ||
</sections> |
32 changes: 32 additions & 0 deletions
32
app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithInvalidExpirationTest.xml
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,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminUserCreateNewUserWithInvalidExpirationTest"> | ||
<annotations> | ||
<features value="Security"/> | ||
<stories value="Create new user with invalid expiration date."/> | ||
<title value="Create new user with invalid expiration date"/> | ||
<description value="Create new user with invalid expiration date."/> | ||
<testCaseId value="" /> | ||
<severity value="CRITICAL"/> | ||
<group value="security_userexpiration"/> | ||
</annotations> | ||
<before> | ||
<!-- Log in to Admin Panel --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
|
||
<!-- Create new user with user expiration set --> | ||
<actionGroup ref="AdminCreateNewUserWithExpirationActionGroup" stepKey="fillInNewUserWithInvalidExpiration"> | ||
<argument name="user" value="NewAdminUserWithInvalidExpiration" /> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminSaveUserInvalidExpirationActionGroup" stepKey="saveNewUserWithInvalidExpirationError" /> | ||
</test> | ||
</tests> |
32 changes: 32 additions & 0 deletions
32
app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithValidExpirationTest.xml
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,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminUserCreateNewUserWithValidExpirationTest"> | ||
<annotations> | ||
<features value="Security"/> | ||
<stories value="Create new user with valid expiration date."/> | ||
<title value="Create new user with valid expiration date"/> | ||
<description value="Create new user with valid expiration date."/> | ||
<testCaseId value="" /> | ||
<severity value="CRITICAL"/> | ||
<group value="security_userexpiration"/> | ||
</annotations> | ||
<before> | ||
<!-- Log in to Admin Panel --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
|
||
<!-- Create new user with user expiration set --> | ||
<actionGroup ref="AdminCreateNewUserWithExpirationActionGroup" stepKey="fillInNewUserWithValidExpiration"> | ||
<argument name="user" value="NewAdminUserWithValidExpiration" /> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminSaveUserSuccessActionGroup" stepKey="saveNewUserWithValidExpirationSuccess" /> | ||
</test> | ||
</tests> |