Skip to content

Commit ed9a79e

Browse files
committed
Refactoring AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest
1 parent cb1557e commit ed9a79e

File tree

3 files changed

+55
-25
lines changed

3 files changed

+55
-25
lines changed
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="AdminSubmitCategoriesPopupActionGroup">
12+
<annotations>
13+
<description>Clicks on Done on the search categories popup.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneButton" />
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertAdminStoreValueIsSetForUrlRewriteActionGroup">
12+
<annotations>
13+
<description>Validates that the proper Store Value is used for URL Rewrite.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeValue" type="string"/>
17+
</arguments>
18+
19+
<see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Store View')}}" userInput="{{storeValue}}" stepKey="seeStoreValueForCategoryId"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,43 +64,24 @@
6464

6565
<!-- Create simple product with categories created in create data -->
6666
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductsGrid"/>
67-
<!--<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/>-->
68-
<!--<waitForPageLoad stepKey="waitForProductCatalogPage"/>-->
69-
7067
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
7168
<argument name="product" value="$$createProduct$$"/>
7269
</actionGroup>
73-
7470
<actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/>
75-
<!--<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/>-->
76-
<!--<waitForPageLoad stepKey="waitUntilProductIsOpened"/>-->
77-
7871
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="unselectInitialCategory">
7972
<argument name="categoryName" value="$$rootCategory.name$$"/>
8073
</actionGroup>
74+
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="pressDoneButton"/>
8175
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="setNewCategory">
8276
<argument name="categoryName" value="$$category.name$$"/>
8377
</actionGroup>
84-
85-
<!--<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>-->
86-
<!--<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$rootCategory.name$$" stepKey="fillSearchForInitialCategory"/>-->
87-
<!--<waitForPageLoad stepKey="waitForCategory1"/>-->
88-
<!--<click selector="{{AdminProductFormSection.selectCategory($$rootCategory.name$$)}}" stepKey="unselectInitialCategory"/>-->
89-
<!--<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$category.name$$" stepKey="fillSearchCategory"/>-->
90-
<!--<waitForPageLoad stepKey="waitForCategory2"/>-->
91-
<!--<click selector="{{AdminProductFormSection.selectCategory($$category.name$$)}}" stepKey="clickOnCategory"/>-->
92-
<!--<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategorySelect"/>-->
93-
78+
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneButton"/>
9479
<actionGroup ref="SaveProductFormNoSuccessCheckActionGroup" stepKey="saveProduct"/>
95-
<!--<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>-->
96-
<!--<click selector="{{AdminProductFormSection.save}}" stepKey="clickSaveButton"/>-->
97-
<!--<waitForPageLoad stepKey="waitForSimpleProductSaved"/>-->
9880

9981
<!-- Verify customer see success message -->
10082
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage">
10183
<argument name="message" value="You saved the product."/>
10284
</actionGroup>
103-
<!--<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>-->
10485

10586
<!-- Grab category Id -->
10687
<actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="grabCategoryId">
@@ -113,8 +94,13 @@
11394
<argument name="redirectType" value="No"/>
11495
<argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/>
11596
</actionGroup>
116-
<see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Store View')}}" userInput="{{customStoreGroup.name}}" stepKey="seeStoreValueForCategoryId"/>
117-
<see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Store View')}}" userInput="{{customStoreEN.name}}" stepKey="seeStoreViewValueForCategoryId"/>
97+
98+
<actionGroup ref="AssertAdminStoreValueIsSetForUrlRewriteActionGroup" stepKey="seeStoreValueForCategoryId">
99+
<argument name="storeValue" value="{{customStoreGroup.name}}"/>
100+
</actionGroup>
101+
<actionGroup ref="AssertAdminStoreValueIsSetForUrlRewriteActionGroup" stepKey="seeStoreViewValueForCategoryId">
102+
<argument name="storeValue" value="{{customStoreEN.name}}"/>
103+
</actionGroup>
118104

119105
<!-- Grab product Id -->
120106
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="grabProductId">
@@ -127,7 +113,12 @@
127113
<argument name="redirectType" value="No"/>
128114
<argument name="targetPath" value="catalog/product/view/id/{$productId}"/>
129115
</actionGroup>
130-
<see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Store View')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/>
131-
<see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Store View')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/>
116+
117+
<actionGroup ref="AssertAdminStoreValueIsSetForUrlRewriteActionGroup" stepKey="seeStoreValueForProductId">
118+
<argument name="storeValue" value="{{customStore.name}}"/>
119+
</actionGroup>
120+
<actionGroup ref="AssertAdminStoreValueIsSetForUrlRewriteActionGroup" stepKey="seeStoreViewValueForProductId">
121+
<argument name="storeValue" value="{{storeViewData.name}}"/>
122+
</actionGroup>
132123
</test>
133124
</tests>

0 commit comments

Comments
 (0)