Skip to content

Commit 9e27604

Browse files
committed
ACQE-8956: To check max session size in admin.
- Test coverage to check max session size in admin.
1 parent ef95248 commit 9e27604

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:ActionGroup/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSessionMaxSizeCliActionGroup">
12+
<annotations>
13+
<description>Set or restore max session size in admin</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="size" type="string" defaultValue="256000"/>
17+
</arguments>
18+
<magentoCLI command="config:set system/security/max_session_size_admin {{size}}" stepKey="setAdminSessionSize"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminSessionMaxSizeUrl">
12+
<data key="urlName">#system_security-head</data>
13+
</entity>
14+
</entities>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/sectionSchema.xsd">
11+
<section name="AdminSystemSecurityConfigSection">
12+
<element name="maxSessionSizeAdminInheritSystemValue" type="checkbox" selector="#system_security_max_session_size_admin_inherit"/>
13+
</section>
14+
</sections>
15+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminMaxSessionSizeTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Validate max session size in admin."/>
15+
<title value="To check max session size in admin."/>
16+
<description value="Set admin max session size to 0 and verify admin and storefront logins."/>
17+
<testCaseId value="AC-3093"/>
18+
<severity value="MAJOR"/>
19+
<group value="customer"/>
20+
</annotations>
21+
<before>
22+
<!-- Precondition 1: Create Customer and login to storefront-->
23+
<createData entity="Simple_US_Customer" stepKey="customer"/>
24+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
25+
<argument name="Customer" value="$customer$"/>
26+
</actionGroup>
27+
<!-- Step 1,2: Set max session size in admin to 0 -->
28+
<actionGroup ref="AdminSessionMaxSizeCliActionGroup" stepKey="setAdminMaxSessionSizeToZero">
29+
<argument name="size" value="0"/>
30+
</actionGroup>
31+
</before>
32+
<after>
33+
<!-- Logout from storefront, delete customer, restore default max session size, check system value and logout from admin-->
34+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/>
35+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
36+
<actionGroup ref="AdminSessionMaxSizeCliActionGroup" stepKey="restoreDefaultMaxSessionSize"/>
37+
<actionGroup ref="AdminNavigateToConfigurationSystemSectionActionGroup" stepKey="navigateToAdminSessionMaxSize">
38+
<argument name="section" value="{{AdminSessionMaxSizeUrl.urlName}}"/>
39+
</actionGroup>
40+
<checkOption selector="{{AdminSystemSecurityConfigSection.maxSessionSizeAdminInheritSystemValue}}" stepKey="checkUseSystemValue"/>
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
42+
</after>
43+
<!-- Step 3: Logout and login to admin and verify User is able to login successfully -->
44+
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
45+
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/>
46+
<!-- Step 4: Logout and login to storefront and verify User is able to login successfully -->
47+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromTheStorefront"/>
48+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
49+
<argument name="Customer" value="$customer$"/>
50+
</actionGroup>
51+
<actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="assertCustomerLoggedIn">
52+
<argument name="customerFullName" value="$$customer.firstname$$ $$customer.lastname$$" />
53+
</actionGroup>
54+
</test>
55+
</tests>

0 commit comments

Comments
 (0)