Skip to content

Commit 60f5710

Browse files
committed
add MFTF test for creating new user with valid expiration date (#22833)
1 parent 437cbf0 commit 60f5710

File tree

5 files changed

+119
-0
lines changed

5 files changed

+119
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateNewUserWithUserExpirationActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided User with an expiration date and saves.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="user" defaultValue="NewAdminUserWithValidExpiration"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/>
20+
<waitForPageLoad stepKey="waitForUsersPage" />
21+
<fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="enterUserName" />
22+
<fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstName}}" stepKey="enterFirstName" />
23+
<fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastName}}" stepKey="enterLastName" />
24+
<fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" />
25+
<fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="enterPassword" />
26+
<fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password}}" stepKey="confirmPassword" />
27+
<fillField selector="{{AdminNewUserFormSection.userExpiresField}}" userInput="{{user.expires_at}}" stepKey="enterUserExpiration" />
28+
<fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
29+
<click selector="{{AdminNewUserFormSection.save}}" stepKey="clickSaveUser" />
30+
<waitForPageLoad stepKey="waitForSaveTheUser" />
31+
<see userInput="You saved the user." stepKey="seeSuccessMessage" />
32+
33+
</actionGroup>
34+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<entity name="NewAdminUserWithValidExpiration" type="user">
12+
<data key="username" unique="suffix">adminExpired</data>
13+
<data key="firstname">John</data>
14+
<data key="lastname">Doe</data>
15+
<data key="email" unique="prefix">[email protected]</data>
16+
<data key="password">123123q</data>
17+
<data key="password_confirmation">123123q</data>
18+
<data key="interface_local">en_US</data>
19+
<data key="interface_local_label">English (United States)</data>
20+
<data key="is_active">true</data>
21+
<data key="is_active_label">Active</data>
22+
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
23+
<data key="role">Administrators</data>
24+
<data key="expires_at">Sep 3, 2030 4:42:36 PM</data>
25+
<array key="roles">
26+
<item>1</item>
27+
</array>
28+
</entity>
29+
</entities>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AdminUserCreateNewUserWithExpirationTest">
11+
<annotations>
12+
<features value="Security"/>
13+
<stories value="Create new user with expiration date."/>
14+
<title value="Create new user with expiration date"/>
15+
<description value="Create new user with expiration date."/>
16+
<testCaseId value="" />
17+
<severity value="CRITICAL"/>
18+
<group value="security"/>
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="AdminCreateNewUserWithUserExpirationActionGroup" stepKey="createNewUserWithValidExpiration">
27+
<argument name="user" value="NewAdminUserWithValidExpiration" />
28+
</actionGroup>
29+
</test>
30+
</tests>

0 commit comments

Comments
 (0)