-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add MFTF tests for logging in and fix timezone issue (#22833: Short-t…
…erm admin accounts)
- Loading branch information
Showing
5 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
37 changes: 37 additions & 0 deletions
37
app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithInvalidExpiration.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,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
|
||
<test name="AdminLoginAdminUserWithInvalidExpiration"> | ||
<annotations> | ||
<features value="Security"/> | ||
<stories value="Try to login as a user with an invalid expiration date."/> | ||
<title value="Try to login as a user with an invalid expiration date"/> | ||
<description value="Try to login as a user with an invalid expiration date."/> | ||
<testCaseId value=""/> | ||
<severity value="CRITICAL"/> | ||
<group value="security"/> | ||
</annotations> | ||
|
||
<before> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
|
||
<actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="openNewUserPage" /> | ||
<generateDate date="+1 minute" format="M d, Y h:i:s" stepKey="expiresDateTime"/> | ||
<actionGroup ref="AdminFillInUserWithExpirationActionGroup" stepKey="fillInNewUserWithValidExpiration"> | ||
<argument name="expires_at" value="{$expiresDateTime}"/> | ||
</actionGroup> | ||
<grabValueFrom selector="{{AdminNewUserFormSection.username}}" stepKey="grabUsername"/> | ||
<grabValueFrom selector="{{AdminNewUserFormSection.password}}" stepKey="grabPassword"/> | ||
<actionGroup ref="AdminSaveUserSuccessActionGroup" stepKey="saveNewUserWithValidExpirationSuccess"/> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
<wait time="60" stepKey="waitForUserToExpire"/> | ||
<actionGroup ref="LoginAdminWithCredentialsActionGroup" stepKey="loginAsNewAdmin"> | ||
<argument name="adminUser" value="{$grabUsername}"/> | ||
<argument name="adminPassword" value="{$grabPassword}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginMessage" /> | ||
|
||
</test> | ||
</tests> |
39 changes: 39 additions & 0 deletions
39
app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithValidExpiration.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,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
|
||
<test name="AdminLoginAdminUserWithValidExpiration"> | ||
<annotations> | ||
<features value="Security"/> | ||
<stories value="Login as a user with a valid expiration date."/> | ||
<title value="Login as a user with a valid expiration date"/> | ||
<description value="Login as a user with a valid expiration date."/> | ||
<testCaseId value=""/> | ||
<severity value="CRITICAL"/> | ||
<group value="security"/> | ||
</annotations> | ||
|
||
<before> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="openNewUserPage" /> | ||
<generateDate date="+5 day" format="M d, Y h:i:s" stepKey="expiresDateTime"/> | ||
<actionGroup ref="AdminFillInUserWithExpirationActionGroup" stepKey="fillInNewUserWithValidExpiration"> | ||
<argument name="expires_at" value="{$expiresDateTime}"/> | ||
</actionGroup> | ||
<grabValueFrom selector="{{AdminNewUserFormSection.username}}" stepKey="grabUsername"/> | ||
<grabValueFrom selector="{{AdminNewUserFormSection.password}}" stepKey="grabPassword"/> | ||
<actionGroup ref="AdminSaveUserSuccessActionGroup" stepKey="saveNewUserWithValidExpirationSuccess"/> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
<actionGroup ref="LoginAdminWithCredentialsActionGroup" stepKey="loginAsNewAdmin"> | ||
<argument name="adminUser" value="{$grabUsername}"/> | ||
<argument name="adminPassword" value="{$grabPassword}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> | ||
|
||
</test> | ||
</tests> |