Skip to content

Commit 7a6e646

Browse files
committed
Refactoring ProductAvailableAfterEnablingSubCategoriesTest
1 parent 8349594 commit 7a6e646

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminEnableCategoryActionGroup">
12+
<annotations>
13+
<description>Enable the category</description>
14+
</annotations>
15+
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="enableCategory"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,26 @@
3737
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3838
</after>
3939

40-
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryStorefront2"/>
41-
<waitForPageLoad stepKey="waitForCategoryStorefront"/>
42-
<dontSeeElement selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct.name$$)}}" stepKey="dontSeeCreatedProduct"/>
43-
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryIndexPage"/>
44-
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandAll"/>
45-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$simpleSubCategory.name$$)}}" stepKey="clickOnCreatedSimpleSubCategoryBeforeDelete"/>
46-
<waitForPageLoad stepKey="AdminCategoryEditPageLoad"/>
47-
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="EnableCategory"/>
48-
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryWithProducts"/>
49-
<waitForPageLoad stepKey="waitForCategorySaved"/>
40+
<actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="doNotSeeProductOnCategoryPage">
41+
<argument name="categoryUrlKey" value="$$createCategory.name$$"/>
42+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
43+
</actionGroup>
44+
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="openCreatedSubCategory">
45+
<argument name="Category" value="$$simpleSubCategory$$"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminEnableCategoryActionGroup" stepKey="enableCategory"/>
48+
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>
5049
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="seeSuccessMessage"/>
5150

5251
<!--Run re-index task-->
5352
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
5453

55-
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryStorefront"/>
56-
<waitForPageLoad stepKey="waitForCategoryStorefrontPage"/>
57-
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct.name$$)}}" stepKey="seeCreatedProduct"/>
54+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/>
55+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openEnabledCategory">
56+
<argument name="categoryName" value="$$createCategory.name$$"/>
57+
</actionGroup>
58+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeCreatedProduct">
59+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
60+
</actionGroup>
5861
</test>
5962
</tests>

0 commit comments

Comments
 (0)