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>
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCreateAndDeleteBackupsTest">
12+
<annotations>
13+
<features value="Backup"/>
14+
<stories value="Create and delete backups"/>
15+
<title value="Create and delete backups"/>
16+
<description value="An admin user can create a backup of each type and delete each backup."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-94176"/>
19+
<group value="backup"/>
20+
<group value="skip"/>
21+
</annotations>
22+
23+
<!--Login to admin area-->
24+
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
25+
26+
<!--Go to backup index page-->
27+
<amOnPage url="{{BackupIndexPage.url}}" stepKey="goToBackupPage"/>
28+
<waitForPageLoad stepKey="waitForBackupPage"/>
29+
30+
<!--Create system backup-->
31+
<actionGroup ref="createSystemBackup" stepKey="createSystemBackup"/>
32+
33+
<!--Create database/media backup-->
34+
<actionGroup ref="createMediaBackup" stepKey="createMediaBackup"/>
35+
36+
<!--Create database backup-->
37+
<actionGroup ref="createDatabaseBackup" stepKey="createDatabaseBackup"/>
38+
39+
<!--Delete system backup-->
40+
<actionGroup ref="deleteBackup" stepKey="deleteSystemBackup">
41+
<argument name="backup" value="SystemBackup"/>
42+
</actionGroup>
43+
44+
<!--Delete database/media backup-->
45+
<actionGroup ref="deleteBackup" stepKey="deleteMediaBackup">
46+
<argument name="backup" value="MediaBackup"/>
47+
</actionGroup>
48+
49+
<!--Delete database backup-->
50+
<actionGroup ref="deleteBackup" stepKey="deleteDatabaseBackup">
51+
<argument name="backup" value="DatabaseBackup"/>
52+
</actionGroup>
53+
54+
</test>
55+
</tests>

app/code/Magento/Backup/Test/Unit/Model/BackupFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function setUp()
5656
$this->_objectManager->expects(
5757
$this->at(0)
5858
)->method(
59-
'get'
59+
'create'
6060
)->with(
6161
\Magento\Backup\Model\Fs\Collection::class
6262
)->will(
@@ -65,7 +65,7 @@ protected function setUp()
6565
$this->_objectManager->expects(
6666
$this->at(1)
6767
)->method(
68-
'get'
68+
'create'
6969
)->with(
7070
\Magento\Backup\Model\Backup::class
7171
)->will(

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<!--FirstProductOption-->
6363
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
6464
<!--Category Selection-->
65-
<element name="categoriesDropDown" type="multiselect" selector="//div[@data-index='category_ids']//div" timeout="30"/>
65+
<element name="categoriesDropDown" type="multiselect" selector="//div[@data-index='category_ids']//div[@class='admin__field-control']" timeout="30"/>
6666
<element name="defaultCategory" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), 'Default Category')]"/>
6767
<element name="categoryByName" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), '{{category}}')]" parameterized="true"/>
6868
<element name="searchForCategory" type="input" selector="div.action-menu._active > div.admin__action-multiselect-search-wrap input" timeout="30"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryBasicFieldSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
<element name="enableCategoryLabel" type="text" selector="input[name='is_active']+label"/>
1717
<element name="enableUseDefault" type="checkbox" selector="input[name='use_default[is_active]']"/>
1818
<element name="CategoryNameInput" type="input" selector="input[name='name']"/>
19+
<element name="RequiredFieldIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=name]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
20+
<element name="RequiredFieldIndicatorColor" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=name]&gt;.admin__field-label span'), ':after').getPropertyValue('color');"/>
1921
<element name="categoryNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
2022
<element name="ContentTab" type="input" selector="input[name='name']"/>
2123
<element name="FieldError" type="text" selector=".admin__field-error[data-bind='attr: {for: {{field}}}, text: error']" parameterized="true"/>
24+
<element name="panelFieldControl" type="input" selector='//aside//div[@data-index="{{arg1}}"]/descendant::*[@name="{{arg2}}"]' parameterized="true"/>
2225
</section>
2326
<section name="CategoryContentSection">
2427
<element name="SelectFromGalleryBtn" type="button" selector="//label[text()='Select from Gallery']"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
</section>
3030
<section name="ModifyAttributes">
3131
<!-- Parameter is the attribute name -->
32-
<element name="nthExistingAttribute" type="select" selector="//*[text()='{{attributeName}}']/../..//select" parameterized="true"/>
32+
<element name="nthExistingAttribute" type="select" selector="//*[text()='{{attributeName}}']/../../..//select" parameterized="true"/>
3333
</section>
3434
</sections>

0 commit comments

Comments
 (0)