Skip to content

Commit 3629c3b

Browse files
committed
ACQE-9080: Improve user experience with roles tree.
- Add test coverage for collapse and expand buttons in integration API and user roles resource trees.
1 parent ef666cd commit 3629c3b

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

app/code/Magento/User/Test/Mftf/Section/AdminCreateRoleSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
<element name="roleNameFilterTextField" type="input" selector="#permissionsUserRolesGrid_filter_role_name"/>
2929
<element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/>
3030
<element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/>
31+
<element name="resourceTreeCollapseAll" type="button" selector="//div[@data-role='resource-tree']/button[not(preceding-sibling::button) and following-sibling::ul]"/>
32+
<element name="resourceTreeExpandAll" type="button" selector="//div[@data-role='resource-tree']/button[preceding-sibling::button and following-sibling::button and following-sibling::ul]"/>
3133
</section>
3234
</sections>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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="AdminVerifyRolesTreeExpandCollapseButtonsTest">
12+
<annotations>
13+
<features value="User"/>
14+
<stories value="ACL resource tree expand and collapse controls in integrations and user roles"/>
15+
<title value="Improve user experience with roles tree"/>
16+
<description value="Verify collapse all and expand all buttons work on integrations API resources tree and user roles resources tree"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-14021"/>
19+
<group value="user"/>
20+
</annotations>
21+
<before>
22+
<!-- Login as admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
</before>
25+
<after>
26+
<!-- Logout as admin -->
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
28+
</after>
29+
<!-- Step 1: Navigate to integrations, create a new integrations, go to API, resources and verify the expand all and collapse all buttons -->
30+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsGrid">
31+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
32+
<argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/>
33+
</actionGroup>
34+
<actionGroup ref="AdminOpenNewIntegrationPageActionGroup" stepKey="openNewIntegrationPage"/>
35+
<waitForElementClickable selector="{{AdminNewIntegrationFormSection.apiTab}}" stepKey="waitApiTabClickable"/>
36+
<click selector="{{AdminNewIntegrationFormSection.apiTab}}" stepKey="openApiTab"/>
37+
<waitForElementVisible selector="{{AdminNewIntegrationFormSection.resourceTree}}" stepKey="waitResourceTreeVisibleOnIntegration"/>
38+
<!-- Click Expand all and verify deep node visible -->
39+
<waitForElementClickable selector="{{AdminCreateRoleSection.resourceTreeExpandAll}}" stepKey="waitExpandAllIntegrationClickable"/>
40+
<click selector="{{AdminCreateRoleSection.resourceTreeExpandAll}}" stepKey="clickExpandAllIntegration"/>
41+
<waitForElementVisible selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink('Magento_Analytics::analytics_api','API')}}" stepKey="assertAnalyticsApiVisibleAfterExpandIntegration"/>
42+
<!-- Click Collapse all and verify deep node hidden -->
43+
<waitForElementClickable selector="{{AdminCreateRoleSection.resourceTreeCollapseAll}}" stepKey="waitCollapseAllIntegrationClickable"/>
44+
<click selector="{{AdminCreateRoleSection.resourceTreeCollapseAll}}" stepKey="clickCollapseAllIntegration"/>
45+
<waitForElementNotVisible selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink('Magento_Analytics::analytics_api','API')}}" stepKey="assertAnalyticsApiHiddenAfterCollapseIntegration"/>
46+
<!-- Step 2: Navigate to user roles, create a new role, go to role resources, and verify the expand all and collapse all buttons -->
47+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToUserRolesGrid">
48+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
49+
<argument name="submenuUiId" value="{{AdminMenuSystemPermissionsUserRoles.dataUiId}}"/>
50+
</actionGroup>
51+
<actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="openCreateRolePage"/>
52+
<actionGroup ref="AdminUserClickRoleResourceTabActionGroup" stepKey="openRoleResourcesTab"/>
53+
<waitForElementVisible selector="{{AdminCreateRoleSection.resourceTree}}" stepKey="waitResourceTreeVisibleOnRole"/>
54+
<!-- Click expand all and verify deep node visible -->
55+
<waitForElementClickable selector="{{AdminCreateRoleSection.resourceTreeExpandAll}}" stepKey="waitExpandAllRoleClickable"/>
56+
<click selector="{{AdminCreateRoleSection.resourceTreeExpandAll}}" stepKey="clickExpandAllRole"/>
57+
<waitForElementVisible selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink('Magento_Analytics::analytics_api','API')}}" stepKey="assertAnalyticsApiVisibleAfterExpandRole"/>
58+
<!-- Click collapse all and verify deep node hidden -->
59+
<waitForElementClickable selector="{{AdminCreateRoleSection.resourceTreeCollapseAll}}" stepKey="waitCollapseAllRoleClickable"/>
60+
<click selector="{{AdminCreateRoleSection.resourceTreeCollapseAll}}" stepKey="clickCollapseAllRole"/>
61+
<waitForElementNotVisible selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink('Magento_Analytics::analytics_api','API')}}" stepKey="assertAnalyticsApiHiddenAfterCollapseRole"/>
62+
</test>
63+
</tests>

0 commit comments

Comments
 (0)