Skip to content

Commit f3c8d79

Browse files
committed
MC-31083: [FT] [MFTF] Fix test AdminCreateImageSwatchTest - delete created swatch attribute in after
1 parent 606c3e8 commit f3c8d79

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
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"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
20+
<waitForPageLoad stepKey="waitForProductAttributeGridPageLoad"/>
21+
<fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabelFilter"/>
22+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeLabelFromTheGrid"/>
23+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
24+
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="clickOnDeleteAttributeButton"/>
25+
<waitForElementVisible selector="{{ModalConfirmationSection.modalContent}}" stepKey="waitForConfirmationPopUpVisible"/>
26+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickOnConfirmationButton"/>
27+
<waitForPageLoad stepKey="waitForAttributeGridPageLoad"/>
28+
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessageVisible"/>
29+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You deleted the product attribute." 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"/>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
</before>
2525
<after>
2626
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
27-
<actionGroup ref="logout" stepKey="logout"/>
27+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct">
28+
<argument name="sku" value="{{BaseConfigurableProduct.sku}}"/>
29+
</actionGroup>
30+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute">
31+
<argument name="productAttributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
32+
</actionGroup>
33+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
2834
</after>
2935

3036
<!-- Begin creating a new product attribute of type "Image Swatch" -->

0 commit comments

Comments
 (0)