Skip to content

Commit ddfffa5

Browse files
ENGCOM-7883: Remove backup menu if the backup feature is disabled #29222
- Merge Pull Request #29222 from edenduong/magento2:2.4-contribute/remove_backup_menu_if_disable - Merged commits: 1. 3907936 2. dab9581 3. c3d76f7 4. 50b62ea
2 parents 00f8a8c + 50b62ea commit ddfffa5

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminAssertBackupLinkAbsentInMenuActionGroup">
12+
<annotations>
13+
<description>Verify 'Backup' link is absent in admin menu.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminMenuSection.menuItem('magento-backend-system')}}" stepKey="clickSystem"/>
17+
<dontSeeElement selector="{{AdminMenuSection.menuItem('magento-backup-system-tools-backup')}}" stepKey="dontSeeBackup"/>
18+
</actionGroup>
19+
</actionGroups>
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminSystemBackupMenuTest">
12+
<annotations>
13+
<features value="Backup"/>
14+
<stories value="Backup menu not visible if config disabled"/>
15+
<title value="Backup menu not visible if backup config disabled"/>
16+
<description value="Disable backup config and check backup menu isn't visible"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-36292"/>
19+
<group value="backup"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
26+
</after>
27+
28+
<actionGroup ref="AdminAssertBackupLinkAbsentInMenuActionGroup" stepKey="verifyBackupLinkAbsentInMenu"/>
29+
</test>
30+
</tests>

app/code/Magento/Backup/etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
99
<menu>
10-
<add id="Magento_Backup::system_tools_backup" title="Backups" translate="title" module="Magento_Backup" sortOrder="30" parent="Magento_Backend::system_tools" action="backup/index" resource="Magento_Backup::backup"/>
10+
<add id="Magento_Backup::system_tools_backup" title="Backups" translate="title" module="Magento_Backup" sortOrder="30" parent="Magento_Backend::system_tools" action="backup/index" resource="Magento_Backup::backup" dependsOnConfig="system/backup/functionality_enabled"/>
1111
</menu>
1212
</config>

0 commit comments

Comments
 (0)