Skip to content

Commit 47878d4

Browse files
committed
Merge remote-tracking branch 'origin/MC-31083' into 2.4-develop-pr11
2 parents 0ad40af + 143cd70 commit 47878d4

File tree

4 files changed

+55
-10
lines changed

4 files changed

+55
-10
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="AdminDeleteProductAttributeByLabelActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productAttributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
20+
<waitForPageLoad stepKey="waitForProductAttributeGridPageLoad"/>
21+
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
22+
<fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabelFilter"/>
23+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeLabelFromTheGrid"/>
24+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
25+
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="clickOnDeleteAttributeButton"/>
26+
<waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmationPopUpVisible"/>
27+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOnConfirmationButton"/>
28+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageVisible"/>
29+
<see selector="{{AdminMessagesSection.success}}" userInput="{{ProductAttributeMessages.remove_success}}" stepKey="seeAttributeDeleteSuccessMessage"/>
30+
</actionGroup>
31+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="DeleteProductAttributeByLabelActionGroup">
1212
<annotations>
13-
<description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description>
13+
<description>DEPRECATED. Please use AdminDeleteProductAttributeByLabelActionGroup instead. Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description>
1414
</annotations>
1515
<arguments>
1616
<argument name="ProductAttribute"/>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="ProductAttributeMessages">
12+
<data key="remove_success">You deleted the product attribute.</data>
13+
</entity>
14+
</entities>

app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
</before>
2525
<after>
2626
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
27-
<actionGroup ref="logout" stepKey="logout"/>
28-
27+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct">
28+
<argument name="sku" value="{{BaseConfigurableProduct.sku}}"/>
29+
</actionGroup>
30+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"/>
31+
<actionGroup ref="NavigateToAndResetProductAttributeGridToDefaultViewActionGroup" stepKey="resetProductAttributeFilters"/>
32+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
2933
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
3034
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
3135
</after>
@@ -99,15 +103,11 @@
99103
</assertContains>
100104

101105
<!-- Create a configurable product to verify the storefront with -->
102-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
103-
<waitForPageLoad time="30" stepKey="waitForProductGrid"/>
104-
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct">
105-
<argument name="product" value="BaseConfigurableProduct"/>
106-
</actionGroup>
106+
<amOnPage url="{{AdminProductCreatePage.url(BaseConfigurableProduct.attribute_set_id, BaseConfigurableProduct.type_id)}}" stepKey="goToCreateConfigurableProduct"/>
107107
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm">
108108
<argument name="product" value="BaseConfigurableProduct"/>
109109
</actionGroup>
110-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>
110+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$createCategory.name$]" stepKey="fillCategory"/>
111111

112112
<!-- Create configurations based off the Image Swatch we created earlier -->
113113
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/>
@@ -147,7 +147,7 @@
147147
</assertContains>
148148

149149
<!-- Go to the product listing page and see text swatch options -->
150-
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPageStorefront"/>
150+
<amOnPage url="$createCategory.custom_attributes[url_key]$.html" stepKey="goToCategoryPageStorefront"/>
151151
<waitForPageLoad stepKey="waitForProductListingPage"/>
152152

153153
<!-- Verify the storefront -->

0 commit comments

Comments
 (0)