Skip to content

Commit 4b75b15

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop expedited
Accepted Community Pull Requests: - #28972: MFTF: Admin Delete Newsletter Subscriber (by @DmitryTsymbal) - #28991: [MFTF] use actionGroup go to new product attribute page (by @Usik2203) - #28869: MFTF: Replace repetitive actions with Action Groups in testes (by @kate-kyzyma) - #28810: Fix shipping address id getter misspelling (by @kodubovik) - #28696: Removed unused class imports (by @Usik2203) Fixed GitHub Issues: - #29032: [Issue] MFTF: Admin Delete Newsletter Subscriber (reported by @m2-assistant[bot]) has been fixed in #28972 by @DmitryTsymbal in 2.4-develop branch Related commits: 1. aeba2c4 - #28982: [Issue] Fix shipping address id getter misspelling (reported by @m2-assistant[bot]) has been fixed in #28810 by @kodubovik in 2.4-develop branch Related commits: 1. 4793b6e 2. e2933a9 - #29012: [Issue] Removed unused class imports (reported by @m2-assistant[bot]) has been fixed in #28696 by @Usik2203 in 2.4-develop branch Related commits: 1. e5ab51f 2. d0e0605
2 parents 3261737 + d41ef50 commit 4b75b15

File tree

34 files changed

+389
-190
lines changed

34 files changed

+389
-190
lines changed

app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@
9494
</actionGroup>
9595

9696
<!--Navigate to Product attribute page-->
97-
<amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/>
98-
<waitForPageLoad stepKey="waitForPageLoad"/>
97+
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>
9998
<fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/>
10099
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/>
101100
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminCreateCategoryWithInactiveIncludeInMenuActionGroup" extends="CreateCategoryActionGroup">
12+
<annotations>
13+
<description>EXTENDS: CreateCategory. Add "disableIncludeInMenuOption" step.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
17+
</arguments>
18+
19+
<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="disableIncludeInMenuOption"
20+
after="seeCategoryPageTitle"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminCreateInactiveCategoryActionGroup" extends="CreateCategoryActionGroup">
12+
<annotations>
13+
<description>EXTENDS: CreateCategory. Add "disableCategory" step.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
17+
</arguments>
18+
19+
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="disableCategory"
20+
after="seeCategoryPageTitle"/>
21+
</actionGroup>
22+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminCategoryIsInactiveActionGroup">
12+
<annotations>
13+
<description>Verify the category is disabled</description>
14+
</annotations>
15+
16+
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="seeCategoryIsDisabled"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,12 @@
2626
</after>
2727
<!-- Create In active Category -->
2828
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
29-
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
30-
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="disableCategory"/>
31-
<checkOption selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="enableIncludeInMenu"/>
32-
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="fillCategoryName"/>
33-
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton"/>
34-
<waitForPageLoad stepKey="waitForCategorySaved"/>
35-
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage"/>
36-
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" />
37-
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="dontCategoryIsChecked"/>
38-
<!--Verify InActive Category is created-->
39-
<seeElement selector="{{AdminCategoryContentSection.categoryInTree(_defaultCategory.name)}}" stepKey="seeCategoryInTree" />
29+
<actionGroup ref="AdminCreateInactiveCategoryActionGroup" stepKey="createInactiveCategory"/>
30+
<actionGroup ref="AssertAdminCategoryIsInactiveActionGroup" stepKey="seeDisabledCategory"/>
4031
<!--Verify Category is not listed store front page-->
41-
<amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name)}}" stepKey="amOnCategoryPage"/>
42-
<waitForPageLoad stepKey="waitForPageToBeLoaded"/>
43-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="dontSeeCategoryOnStoreFrontPage"/>
32+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
33+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeCategoryNameInMenu">
34+
<argument name="categoryName" value="{{_defaultCategory.name}}"/>
35+
</actionGroup>
4436
</test>
4537
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,11 @@
2626
</after>
2727
<!--Create Category with not included in menu Subcategory -->
2828
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
29-
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
30-
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/>
31-
<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="disableIncludeInMenu"/>
32-
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="fillCategoryName"/>
33-
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton"/>
34-
<waitForPageLoad stepKey="waitForCategorySaved"/>
35-
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage"/>
36-
<waitForPageLoad stepKey="waitForPageSaved"/>
37-
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" />
38-
<!--Verify Category is created/>-->
39-
<seeElement selector="{{AdminCategoryContentSection.activeCategoryInTree(_defaultCategory.name)}}" stepKey="seeCategoryInTree" />
29+
<actionGroup ref="AdminCreateCategoryWithInactiveIncludeInMenuActionGroup" stepKey="createNotIncludedInMenuCategory"/>
4030
<!--Verify Category in store front page menu/>-->
41-
<amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name)}}" stepKey="amOnCategoryPage"/>
42-
<waitForPageLoad stepKey="waitForPageToBeLoaded"/>
43-
<see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/>
44-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="dontSeeCategoryOnNavigation"/>
31+
<actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="CheckCategoryOnStorefront"/>
32+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeCategoryOnNavigation">
33+
<argument name="categoryName" value="{{_defaultCategory.name}}"/>
34+
</actionGroup>
4535
</test>
4636
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
2828
</after>
2929

30-
<amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/>
31-
<waitForPageLoad stepKey="waitForPageLoad"/>
30+
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>
3231

3332
<!-- Set attribute properties -->
3433
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}"

app/code/Magento/Customer/Setup/Patch/Data/AddCustomerUpdatedAtAttribute.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Customer\Setup\Patch\Data;
89

910
use Magento\Customer\Model\Customer;
1011
use Magento\Customer\Setup\CustomerSetupFactory;
11-
use Magento\Framework\App\ResourceConnection;
1212
use Magento\Framework\Setup\ModuleDataSetupInterface;
1313
use Magento\Framework\Setup\Patch\DataPatchInterface;
1414
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1515

1616
/**
17-
* Class AddCustomerUpdatedAtAttribute
18-
* @package Magento\Customer\Setup\Patch
17+
* Class add customer updated attribute to customer
1918
*/
2019
class AddCustomerUpdatedAtAttribute implements DataPatchInterface, PatchVersionInterface
2120
{
@@ -30,7 +29,6 @@ class AddCustomerUpdatedAtAttribute implements DataPatchInterface, PatchVersionI
3029
private $customerSetupFactory;
3130

3231
/**
33-
* AddCustomerUpdatedAtAttribute constructor.
3432
* @param ModuleDataSetupInterface $moduleDataSetup
3533
* @param CustomerSetupFactory $customerSetupFactory
3634
*/
@@ -43,7 +41,7 @@ public function __construct(
4341
}
4442

4543
/**
46-
* {@inheritdoc}
44+
* @inheritdoc
4745
*/
4846
public function apply()
4947
{
@@ -61,10 +59,12 @@ public function apply()
6159
'system' => false,
6260
]
6361
);
62+
63+
return $this;
6464
}
6565

6666
/**
67-
* {@inheritdoc}
67+
* @inheritdoc
6868
*/
6969
public static function getDependencies()
7070
{
@@ -74,15 +74,15 @@ public static function getDependencies()
7474
}
7575

7676
/**
77-
* {@inheritdoc}
77+
* @inheritdoc
7878
*/
7979
public static function getVersion()
8080
{
8181
return '2.0.4';
8282
}
8383

8484
/**
85-
* {@inheritdoc}
85+
* @inheritdoc
8686
*/
8787
public function getAliases()
8888
{

app/code/Magento/Customer/Setup/Patch/Data/AddNonSpecifiedGenderAttributeOption.php

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Customer\Setup\Patch\Data;
89

910
use Magento\Customer\Model\Customer;
1011
use Magento\Customer\Setup\CustomerSetupFactory;
11-
use Magento\Directory\Model\AllowedCountries;
12-
use Magento\Framework\App\ObjectManager;
13-
use Magento\Framework\Encryption\Encryptor;
14-
use Magento\Framework\Indexer\IndexerRegistry;
15-
use Magento\Framework\Setup\SetupInterface;
16-
use Magento\Framework\Setup\UpgradeDataInterface;
17-
use Magento\Framework\Setup\ModuleContextInterface;
1812
use Magento\Framework\Setup\ModuleDataSetupInterface;
19-
use Magento\Store\Model\ScopeInterface;
20-
use Magento\Store\Model\StoreManagerInterface;
21-
use Magento\Framework\DB\FieldDataConverterFactory;
22-
use Magento\Framework\DB\DataConverter\SerializedToJson;
23-
use Magento\Framework\App\ResourceConnection;
2413
use Magento\Framework\Setup\Patch\DataPatchInterface;
2514
use Magento\Framework\Setup\Patch\PatchVersionInterface;
2615

2716
/**
28-
* Class AddNonSpecifiedGenderAttributeOption
29-
* @package Magento\Customer\Setup\Patch
17+
* Class add non specified gender attribute option to customer
3018
*/
3119
class AddNonSpecifiedGenderAttributeOption implements DataPatchInterface, PatchVersionInterface
3220
{
@@ -41,7 +29,6 @@ class AddNonSpecifiedGenderAttributeOption implements DataPatchInterface, PatchV
4129
private $customerSetupFactory;
4230

4331
/**
44-
* AddNonSpecifiedGenderAttributeOption constructor.
4532
* @param ModuleDataSetupInterface $moduleDataSetup
4633
* @param CustomerSetupFactory $customerSetupFactory
4734
*/
@@ -54,7 +41,7 @@ public function __construct(
5441
}
5542

5643
/**
57-
* {@inheritdoc}
44+
* @inheritdoc
5845
*/
5946
public function apply()
6047
{
@@ -64,10 +51,12 @@ public function apply()
6451

6552
$option = ['attribute_id' => $attributeId, 'values' => [3 => 'Not Specified']];
6653
$customerSetup->addAttributeOption($option);
54+
55+
return $this;
6756
}
6857

6958
/**
70-
* {@inheritdoc}
59+
* @inheritdoc
7160
*/
7261
public static function getDependencies()
7362
{
@@ -77,15 +66,15 @@ public static function getDependencies()
7766
}
7867

7968
/**
80-
* {@inheritdoc}
69+
* @inheritdoc
8170
*/
8271
public static function getVersion()
8372
{
8473
return '2.0.2';
8574
}
8675

8776
/**
88-
* {@inheritdoc}
77+
* @inheritdoc
8978
*/
9079
public function getAliases()
9180
{

app/code/Magento/Customer/Setup/Patch/Data/AddSecurityTrackingAttributes.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Customer\Setup\Patch\Data;
89

910
use Magento\Customer\Model\Customer;
1011
use Magento\Customer\Setup\CustomerSetupFactory;
11-
use Magento\Framework\App\ResourceConnection;
1212
use Magento\Framework\Setup\ModuleDataSetupInterface;
1313
use Magento\Framework\Setup\Patch\DataPatchInterface;
1414
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1515

1616
/**
17-
* Class AddSecurityTrackingAttributes
18-
* @package Magento\Customer\Setup\Patch
17+
* Class add security tracking attributes to customer
1918
*/
2019
class AddSecurityTrackingAttributes implements DataPatchInterface, PatchVersionInterface
2120
{
@@ -30,7 +29,6 @@ class AddSecurityTrackingAttributes implements DataPatchInterface, PatchVersionI
3029
private $customerSetupFactory;
3130

3231
/**
33-
* AddSecurityTrackingAttributes constructor.
3432
* @param ModuleDataSetupInterface $moduleDataSetup
3533
* @param CustomerSetupFactory $customerSetupFactory
3634
*/
@@ -43,7 +41,7 @@ public function __construct(
4341
}
4442

4543
/**
46-
* {@inheritdoc}
44+
* @inheritdoc
4745
*/
4846
public function apply()
4947
{
@@ -94,12 +92,14 @@ public function apply()
9492
$this->moduleDataSetup->getConnection()->update(
9593
$configTable,
9694
['value' => new \Zend_Db_Expr('value*24')],
97-
['path = ?' => \Magento\Customer\Model\Customer::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD]
95+
['path = ?' => Customer::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD]
9896
);
97+
98+
return $this;
9999
}
100100

101101
/**
102-
* {@inheritdoc}
102+
* @inheritdoc
103103
*/
104104
public static function getDependencies()
105105
{
@@ -109,15 +109,15 @@ public static function getDependencies()
109109
}
110110

111111
/**
112-
* {@inheritdoc}
112+
* @inheritdoc
113113
*/
114114
public static function getVersion()
115115
{
116116
return '2.0.7';
117117
}
118118

119119
/**
120-
* {@inheritdoc}
120+
* @inheritdoc
121121
*/
122122
public function getAliases()
123123
{

0 commit comments

Comments
 (0)