Skip to content

Commit acae8f9

Browse files
committed
Merge remote-tracking branch 'origin/MC-4866' into mtf-eol
2 parents e41e9d1 + 4f99c72 commit acae8f9

File tree

5 files changed

+93
-2
lines changed

5 files changed

+93
-2
lines changed

app/code/Magento/Backup/Test/Mftf/ActionGroup/DeleteBackupActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
1818
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
1919
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
20+
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
2021
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
2122
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
2223
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>

app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
<data key="name" unique="suffix">databaseBackup</data>
2121
<data key="type">Database</data>
2222
</entity>
23-
</entities>
23+
<entity name="WebSetupWizardBackup" type="backup">
24+
<data key="name">WebSetupWizard</data>
25+
<data key="type">Database</data>
26+
</entity>
27+
</entities>

app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,33 @@
2323
<selectOption userInput="No" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/>
2424
<click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/>
2525
</actionGroup>
26-
</actionGroups>
26+
<actionGroup name="DeleteCustomStoreBackupEnabledYesActionGroup">
27+
<arguments>
28+
<argument name="storeGroupName" type="string"/>
29+
</arguments>
30+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
31+
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/>
32+
<fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/>
33+
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/>
34+
<see userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/>
35+
<click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/>
36+
<waitForPageLoad stepKey="waitForStoreToLoad"/>
37+
<click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteStoreGroupButtonOnEditStorePage"/>
38+
<selectOption userInput="Yes" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/>
39+
<click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/>
40+
<see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/>
41+
<see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store." stepKey="seeAssertSuccessDeleteStoreGroupMessage"/>
42+
</actionGroup>
43+
<actionGroup name="AssertStoreNotInGrid">
44+
<arguments>
45+
<argument name="storeGroupName" type="string"/>
46+
</arguments>
47+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
48+
<waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/>
49+
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/>
50+
<fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/>
51+
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/>
52+
<waitForPageLoad stepKey="waitForStoreToLoad"/>
53+
<see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/>
54+
</actionGroup>
55+
</actionGroups>

app/code/Magento/Store/Test/Mftf/Section/AdminStoresGridSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@
2121
<element name="storeGrpNameInFirstRow" type="text" selector=".col-group_title>a"/>
2222
<element name="storeNameInFirstRow" type="text" selector=".col-store_title>a"/>
2323
<element name="firstRow" type="textarea" selector="(//*[@id='storeGrid_table']/tbody/tr)[1]"/>
24+
<element name="successMessage" type="text" selector="//div[@class='message message-success success']/div"/>
25+
<element name="emptyText" type="text" selector="//tr[@class='data-grid-tr-no-data even']/td[@class='empty-text']"/>
2426
</section>
2527
</sections>
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 © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<!-- Test XML Example -->
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminDeleteStoreGroupTest">
11+
<annotations>
12+
<stories value="Delete Store Group"/>
13+
<title value="DeleteStoreGroupEntityTestVariation1"/>
14+
<description value="Test log in to Stores and Delete Store Group Test"/>
15+
<testCaseId value="MC-14297"/>
16+
<severity value="CRITICAL"/>
17+
<group value="store"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<magentoCLI command="config:set system/backup/functionality_enabled 1" stepKey="setEnableBackupToYes"/>
23+
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<!--Create custom store group-->
25+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewCustomStoreGroup">
26+
<argument name="website" value="{{_defaultWebsite.name}}"/>
27+
<argument name="storeGroupName" value="{{customStore.name}}"/>
28+
<argument name="storeGroupCode" value="{{customStore.code}}"/>
29+
</actionGroup>
30+
</before>
31+
<after>
32+
<magentoCLI command="config:set system/backup/functionality_enabled 0" stepKey="setEnableBackupToNo"/>
33+
<actionGroup ref="logout" stepKey="logout"/>
34+
</after>
35+
36+
<!--Delete custom store group and verify AssertStoreGroupSuccessDeleteAndBackupMessages-->
37+
<actionGroup ref="DeleteCustomStoreBackupEnabledYesActionGroup" stepKey="deleteCustomStoreGroup">
38+
<argument name="storeGroupName" value="{{customStore.name}}"/>
39+
</actionGroup>
40+
41+
<!--Verify deleted Store group is not present in grid and verify AssertStoreGroupNotInGrid message-->
42+
<actionGroup ref="AssertStoreNotInGrid" stepKey="verifyDeletedStoreGroupNotInGrid">
43+
<argument name="storeGroupName" value="{{customStore.name}}"/>
44+
</actionGroup>
45+
46+
<!--Go to backup index page and verify AssertBackupInGrid-->
47+
<amOnPage url="{{BackupIndexPage.url}}" stepKey="goToBackupIndexPage"/>
48+
<waitForPageLoad stepKey="waitForBackupIndexPageLoad"/>
49+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{WebSetupWizardBackup.name}}" stepKey="seeBackupInGrid"/>
50+
<!--Delete database backup-->
51+
<actionGroup ref="deleteBackup" stepKey="deleteDatabaseBackup">
52+
<argument name="backup" value="WebSetupWizardBackup"/>
53+
</actionGroup>
54+
</test>
55+
</tests>

0 commit comments

Comments
 (0)