Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 3be6811

Browse files
author
Joan He
authored
Merge pull request #3097 from magento-borg/BugFixPR
[2.3.0-Regression] Bug fixes PR
2 parents bce847d + e65b236 commit 3be6811

File tree

49 files changed

+1258
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1258
-269
lines changed

app/code/Magento/Backup/Model/BackupFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan
3939
*/
4040
public function create($timestamp, $type)
4141
{
42-
$fsCollection = $this->_objectManager->get(\Magento\Backup\Model\Fs\Collection::class);
43-
$backupInstance = $this->_objectManager->get(\Magento\Backup\Model\Backup::class);
42+
$fsCollection = $this->_objectManager->create(\Magento\Backup\Model\Fs\Collection::class);
43+
$backupInstance = $this->_objectManager->create(\Magento\Backup\Model\Backup::class);
4444

4545
foreach ($fsCollection as $backup) {
4646
if ($backup->getTime() === (int) $timestamp && $backup->getType() === $type) {

app/code/Magento/Backup/Model/Fs/Collection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ protected function _generateRow($filename)
115115
if (isset($row['display_name']) && $row['display_name'] == '') {
116116
$row['display_name'] = 'WebSetupWizard';
117117
}
118-
$row['id'] = $row['time'] . '_' . $row['type'] . (isset($row['display_name']) ? $row['display_name'] : '');
118+
$row['id'] = $row['time'] . '_' . $row['type']
119+
. (isset($row['display_name']) ? '_' . $row['display_name'] : '');
119120
return $row;
120121
}
121122
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
12+
<actionGroup name="createSystemBackup">
13+
<arguments>
14+
<argument name="backup" defaultValue="SystemBackup"/>
15+
</arguments>
16+
<click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/>
17+
<waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/>
18+
<fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/>
19+
<click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/>
20+
<waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/>
21+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/>
22+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
23+
<see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/>
24+
</actionGroup>
25+
26+
<actionGroup name="createMediaBackup">
27+
<arguments>
28+
<argument name="backup" defaultValue="MediaBackup"/>
29+
</arguments>
30+
<click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/>
31+
<waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/>
32+
<fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/>
33+
<click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/>
34+
<waitForPageLoad time="120" stepKey="waitForBackupProcess"/>
35+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/>
36+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
37+
<see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/>
38+
</actionGroup>
39+
40+
<actionGroup name="createDatabaseBackup">
41+
<arguments>
42+
<argument name="backup" defaultValue="DatabaseBackup"/>
43+
</arguments>
44+
<click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/>
45+
<waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/>
46+
<fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/>
47+
<click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/>
48+
<waitForPageLoad time="120" stepKey="waitForBackupProcess"/>
49+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/>
50+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
51+
<see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/>
52+
</actionGroup>
53+
54+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
12+
<actionGroup name="deleteBackup">
13+
<arguments>
14+
<argument name="backup"/>
15+
</arguments>
16+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
17+
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
18+
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
19+
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
20+
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
21+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
22+
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
23+
</actionGroup>
24+
25+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SystemBackup" type="backup">
12+
<data key="name" unique="suffix">systemBackup</data>
13+
<data key="type">System</data>
14+
</entity>
15+
<entity name="MediaBackup" type="backup">
16+
<data key="name" unique="suffix">mediaBackup</data>
17+
<data key="type">Database and Media</data>
18+
</entity>
19+
<entity name="DatabaseBackup" type="backup">
20+
<data key="name" unique="suffix">databaseBackup</data>
21+
<data key="type">Database</data>
22+
</entity>
23+
</entities>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="BackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
12+
<section name="AdminMainActionsSection"/>
13+
<section name="AdminGridTableSection"/>
14+
<section name="AdminCreateBackupFormSection"/>
15+
</page>
16+
</pages>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCreateBackupFormSection">
12+
<element name="backupNameField" type="input" selector="input[name='backup_name']"/>
13+
<element name="maintenanceModeCheckbox" type="checkbox" selector="input[name='maintenance_mode']"/>
14+
<element name="excludeMediaCheckbox" type="checkbox" selector="input[name='exclude_media']"/>
15+
<element name="ok" type="button" selector=".modal-header button.primary"/>
16+
<element name="cancel" type="button" selector=".modal-header button.cancel"/>
17+
</section>
18+
</sections>
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 © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminGridActionSection">
12+
<element name="actionSelect" type="select" selector="#backupsGrid_massaction-select"/>
13+
<element name="submitButton" type="button" selector="#backupsGrid_massaction button[title='Submit']"/>
14+
</section>
15+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminGridTableSection">
12+
<element name="backupNameColumn" type="text" selector="table.data-grid td[data-column='display_name']"/>
13+
<element name="backupTypeByName" type="text" selector="//table//td[contains(., '{{name}}')]/parent::tr/td[@data-column='type']" parameterized="true"/>
14+
<element name="backupRowCheckbox" type="checkbox" selector="//table//td[contains(., '{{name}}')]/parent::tr/td[@data-column='massaction']//input" parameterized="true"/>
15+
</section>
16+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminMainActionsSection">
12+
<element name="systemBackup" type="button" selector="button[data-ui-id*='createsnapshotbutton']"/>
13+
<element name="mediaBackup" type="button" selector="button[data-ui-id*='createmediabackupbutton']"/>
14+
<element name="databaseBackup" type="button" selector="button.database-backup[data-ui-id*='createbutton']"/>
15+
</section>
16+
</sections>

0 commit comments

Comments
 (0)