Skip to content

Commit 63815db

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

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
<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>
1414
</annotations>
1515
<arguments>
16-
<argument name="productAttributeLabel" type="string"/>
16+
<argument name="productAttributeLabel" type="string" defaultValue="ProductAttributeFrontendLabel.label"/>
1717
</arguments>
1818

1919
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
2020
<waitForPageLoad stepKey="waitForProductAttributeGridPageLoad"/>
21+
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
2122
<fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabelFilter"/>
2223
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeLabelFromTheGrid"/>
2324
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
2425
<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"/>
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"/>
3030
</actionGroup>
3131
</actionGroups>
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: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute">
3131
<argument name="productAttributeLabel" value="{{ProductAttributeFrontendLabel.label}}"/>
3232
</actionGroup>
33+
<actionGroup ref="NavigateToAndResetProductAttributeGridToDefaultViewActionGroup" stepKey="resetProductAttributeFilters"/>
3334
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
3435
</after>
3536

@@ -102,11 +103,7 @@
102103
</assertContains>
103104

104105
<!-- Create a configurable product to verify the storefront with -->
105-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
106-
<waitForPageLoad time="30" stepKey="waitForProductGrid"/>
107-
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct">
108-
<argument name="product" value="BaseConfigurableProduct"/>
109-
</actionGroup>
106+
<amOnPage url="{{AdminProductCreatePage.url(BaseConfigurableProduct.attribute_set_id, BaseConfigurableProduct.type_id)}}" stepKey="goToCreateConfigurableProduct"/>
110107
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm">
111108
<argument name="product" value="BaseConfigurableProduct"/>
112109
</actionGroup>
@@ -150,7 +147,7 @@
150147
</assertContains>
151148

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

156153
<!-- Verify the storefront -->

0 commit comments

Comments
 (0)