Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 63e5713

Browse files
author
Alexander Akimov
authored
Merge pull request #2299 from magento-plankton/MAGETWO-89382
[plankton] MAGETWO-89382: Automate MAGETWO-46344 MFTF
2 parents d2a037f + 803dbe4 commit 63e5713

12 files changed

+231
-30
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="MoveCategoryActionGroup">
12+
<arguments>
13+
<argument name="childCategory"/>
14+
<argument name="parentCategory"/>
15+
</arguments>
16+
<click stepKey="expandAllCategoriesTree" selector="{{AdminCategorySidebarTreeSection.expandAll}}"/>
17+
<waitForAjaxLoad stepKey="waitForCategoriesExpand"/>
18+
<dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree('childCategory')}}" selector2="{{AdminCategorySidebarTreeSection.categoryInTree('parentCategory')}}" stepKey="moveCategory"/>
19+
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForWarningMessageVisible"/>
20+
<see selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessage"/>
21+
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/>
22+
<waitForPageLoad stepKey="waitForCategoryPageReload"/>
23+
</actionGroup>
24+
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/StorefrontCategoryActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<actionGroup name="StorefrontCheckCategoryActionGroup">
1313
<arguments>
1414
<argument name="category"/>
15-
<argument name="productCount"/>
15+
<argument name="productCount" type="string"/>
1616
</arguments>
1717
<seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/>
1818
<seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/CategoryData.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,17 @@
2323
<data key="is_active">true</data>
2424
<data key="include_in_menu">true</data>
2525
</entity>
26+
<entity name="NewRootCategory" type="category">
27+
<data key="name" unique="suffix">NewRootCategory</data>
28+
<data key="name_lwr" unique="suffix">newrootcategory</data>
29+
<data key="is_active">true</data>
30+
<data key="include_in_menu">true</data>
31+
<data key="parent_id">1</data>
32+
</entity>
33+
<entity name="SubCategoryWithParent" type="category">
34+
<data key="name" unique="suffix">subCategory</data>
35+
<data key="name_lwr" unique="suffix">subCategory</data>
36+
<data key="is_active">true</data>
37+
<var key="parent_id" entityType="category" entityKey="id" />
38+
</entity>
2639
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,19 @@
133133
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
134134
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
135135
</entity>
136+
<entity name="productWithDescription" type="product">
137+
<data key="sku" unique="suffix">testProductWithDescriptionSku</data>
138+
<data key="type_id">simple</data>
139+
<data key="attribute_set_id">4</data>
140+
<data key="visibility">4</data>
141+
<data key="name" unique="suffix">testProductWithDescriptionName</data>
142+
<data key="price">123.00</data>
143+
<data key="urlKey" unique="suffix">testproductwithdescriptionurlkey</data>
144+
<data key="status">1</data>
145+
<data key="quantity">100</data>
146+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
147+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
148+
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
149+
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
150+
</entity>
136151
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminCategoryModalSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<element name="message" type="text" selector="aside.confirm div.modal-content"/>
1313
<element name="title" type="text" selector="aside.confirm .modal-header .modal-title"/>
1414
<element name="ok" type="button" selector="aside.confirm .modal-footer .action-primary"/>
15-
<element name="cancel" type="button" selector="aside.confirm .modal-footer .action-dismiss"/>
15+
<element name="cancel" type="button" selector="aside.confirm .modal-footer .action-secondary"/>
1616
</section>
1717
</sections>
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="DeleteCategoriesTest">
12+
<annotations>
13+
<features value="Delete categories"/>
14+
<title value="Delete categories."/>
15+
<description value="Delete Default Root Category and subcategories and vefify after products on storefront."/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MAGETWO-46344"/>
18+
<group value="testNotIsolated"/>
19+
</annotations>
20+
<before>
21+
<createData entity="_defaultCategory" stepKey="createCategoryC"/>
22+
<createData entity="productWithDescription" stepKey="createProduct1">
23+
<requiredEntity createDataKey="createCategoryC"/>
24+
</createData>
25+
<createData entity="SubCategoryWithParent" stepKey="createSubCategory">
26+
<requiredEntity createDataKey="createCategoryC"/>
27+
</createData>
28+
<createData entity="productWithDescription" stepKey="createProduct2">
29+
<requiredEntity createDataKey="createSubCategory"/>
30+
</createData>
31+
<createData entity="_defaultCategory" stepKey="createCategoryB"/>
32+
<createData entity="productWithDescription" stepKey="createProduct3">
33+
<requiredEntity createDataKey="createCategoryB"/>
34+
</createData>
35+
<createData entity="NewRootCategory" stepKey="createNewRootCategoryA"/>
36+
</before>
37+
<after>
38+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
39+
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/>
40+
<deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/>
41+
<deleteData createDataKey="createProduct3" stepKey="deleteProduct3"/>
42+
</after>
43+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
44+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage1"/>
45+
<waitForPageLoad time="30" stepKey="waitForPageCategoryLoadAfterNavigate"/>
46+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createNewRootCategoryA.name$$)}}" stepKey="openNewRootCategory"/>
47+
<waitForPageLoad stepKey="waitForPageCategoryLoadAfterClickOnNewRootCategory"/>
48+
<seeElement selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="assertDeleteButtonIsPresent"/>
49+
<!--Move categories from Default Category to NewRootCategory. -->
50+
<actionGroup ref="MoveCategoryActionGroup" stepKey="MoveCategoryBToNewRootCategory">
51+
<argument name="childCategory" value="$$createCategoryC.name$$"/>
52+
<argument name="parentCategory" value="$$createNewRootCategoryA.name$$"/>
53+
</actionGroup>
54+
<actionGroup ref="MoveCategoryActionGroup" stepKey="MoveCategoryCToNewRootCategory">
55+
<argument name="childCategory" value="$$createCategoryB.name$$"/>
56+
<argument name="parentCategory" value="$$createNewRootCategoryA.name$$"/>
57+
</actionGroup>
58+
<!-- Change root category for Main Website Store. -->
59+
<amOnPage stepKey="s1" url="{{AdminSystemStorePage.url}}"/>
60+
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" />
61+
<click stepKey="s2" selector="{{AdminStoresGridSection.resetButton}}"/>
62+
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterResetButton" time="10"/>
63+
<fillField stepKey="s4" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store"/>
64+
<click stepKey="s5" selector="{{AdminStoresGridSection.searchButton}}"/>
65+
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterSearchButton"/>
66+
<click stepKey="s7" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" />
67+
<waitForPageLoad stepKey="waitForPageAdminStoresGroupEditLoad" />
68+
<selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{NewRootCategory.name}}" stepKey="setNewCategoryForStoreGroup"/>
69+
<click selector="{{AdminNewStoreViewActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/>
70+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModalSaveStoreGroup"/>
71+
<see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarning"/>
72+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptModal" />
73+
<waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageAdminStoresGridReload"/>
74+
<see userInput="You saved the store." stepKey="seeSavedMessage"/>
75+
76+
<!-- @TODO: Uncomment commented below code after MQE-903 is fixed -->
77+
<!-- Perform cli reindex. -->
78+
<!--<magentoCLI command="indexer:reindex" stepKey="magentoCli"/>-->
79+
80+
<!-- Delete Default Root Category. -->
81+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterCLIReindexCommand"/>
82+
<waitForPageLoad time="30" stepKey="waitForPageCategoryLoadAfterCLIReindexCommand"/>
83+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree('Default Category')}}" stepKey="clickOnDefaultRootCategory"/>
84+
<waitForPageLoad stepKey="waitForPageDefaultCategoryEditLoad" />
85+
<seeElement selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="assertDeleteButtonIsPresent1"/>
86+
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="DeleteDefaultRootCategory"/>
87+
<waitForElementVisible selector="{{AdminCategoryModalSection.ok}}" stepKey="waitForModalDeleteDefaultRootCategory" />
88+
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="acceptModal1"/>
89+
<waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="waitForPageReloadAfterDeleteDefaultCategory"/>
90+
<!-- Verify categories 1 and 3 their products. -->
91+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage"/>
92+
<waitForPageLoad stepKey="homeWaitForPageLoad"/>
93+
94+
<!-- @TODO: Uncomment commented below code after MQE-903 is fixed -->
95+
<!--<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryC.name$$)}}" stepKey="browseClickCategoryC"/>-->
96+
<!--<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertCategoryC">-->
97+
<!--<argument name="category" value="$$createCategoryC$$"/>-->
98+
<!--<argument name="productCount" value="2"/>-->
99+
<!--</actionGroup>-->
100+
<!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1">-->
101+
<!--<argument name="product" value="$$createProduct1$$"/>-->
102+
<!--</actionGroup>-->
103+
104+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryC.name$$)}}" stepKey="hoverCategory"/>
105+
<waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="waitForSubcategory"/>
106+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="browseClickSubCategory"/>
107+
<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertSubcategory">
108+
<argument name="category" value="$$createSubCategory$$"/>
109+
<argument name="productCount" value="1"/>
110+
</actionGroup>
111+
<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2">
112+
<argument name="product" value="$$createProduct2$$"/>
113+
</actionGroup>
114+
115+
<!-- @TODO: Uncomment commented below code after MQE-903 is fixed -->
116+
<!--<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertCategoryB">-->
117+
<!--<argument name="category" value="$$createCategoryB$$"/>-->
118+
<!--<argument name="productCount" value="1"/>-->
119+
<!--</actionGroup>-->
120+
<!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct3">-->
121+
<!--<argument name="product" value="$$createProduct3$$"/>-->
122+
<!--</actionGroup>-->
123+
124+
<!-- Delete Categories 1(with subcategory) and 3. -->
125+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterStoreFrontCategoryAssertions"/>
126+
<waitForPageLoad time="30" stepKey="waitForCategoryPageLoadAfterStoreFrontCategoryAssertions"/>
127+
<actionGroup ref="DeleteCategory" stepKey="deleteCategoryC">
128+
<argument name="categoryEntity" value="$$createCategoryC$$"/>
129+
</actionGroup>
130+
<actionGroup ref="DeleteCategory" stepKey="deleteCategoryB">
131+
<argument name="categoryEntity" value="$$createCategoryB$$"/>
132+
</actionGroup>
133+
<!-- Verify categories 1 and 3 are absent -->
134+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage1"/>
135+
<waitForPageLoad stepKey="waitHomePageLoadAfterDeletingCategories"/>
136+
<dontSee selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryB.name$$)}}" stepKey="browseClickCategoryB"/>
137+
<dontSee selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryC.name$$)}}" stepKey="browseClickCategoryC"/>
138+
<!-- Verify products 1-3 are available on storefront -->
139+
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct1.custom_attributes[url_key]$$.html" stepKey="amOnProduct1Page"/>
140+
<waitForPageLoad stepKey="product1WaitForPageLoad"/>
141+
<actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page">
142+
<argument name="product" value="$$createProduct1$$"/>
143+
</actionGroup>
144+
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct2.custom_attributes[url_key]$$.html" stepKey="amOnProduct2Page"/>
145+
<waitForPageLoad stepKey="product2WaitForPageLoad"/>
146+
<actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page">
147+
<argument name="product" value="$$createProduct2$$"/>
148+
</actionGroup>
149+
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct3.custom_attributes[url_key]$$.html" stepKey="amOnProduct3Page"/>
150+
<waitForPageLoad stepKey="product3WaitForPageLoad"/>
151+
<actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct3Page">
152+
<argument name="product" value="$$createProduct3$$"/>
153+
</actionGroup>
154+
<!-- Rename New Root Category to Default category -->
155+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterStoreFrontProductsAssertions"/>
156+
<waitForPageLoad time="30" stepKey="waitForCategoryPageLoadAfterStoreFrontProductsAssertions"/>
157+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree('$$createNewRootCategoryA.name$$')}}" stepKey="clickOnNewRootCategoryA"/>
158+
<waitForPageLoad stepKey="waitForPageNewRootCategoryALoad" />
159+
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="Default Category" stepKey="enterCategoryNameAsDefaultCategory"/>
160+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryDefaultCategory"/>
161+
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessageAfterSaveDefaultCategory"/>
162+
</test>
163+
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/EndToEndB2CGuestUserTest.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="browseClickCategory"/>
6969
<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertCategory">
7070
<argument name="category" value="$$createCategory$$"/>
71-
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
72-
<argument name="productCount" value="CONST.three"/>
71+
<argument name="productCount" value="3"/>
7372
</actionGroup>
7473
<!-- Check simple product 1 in category -->
7574
<comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" />
@@ -120,8 +119,7 @@
120119
<waitForLoadingMaskToDisappear stepKey="waitForCategoryloaded" />
121120
<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="compareAssertCategory">
122121
<argument name="category" value="$$createCategory$$"/>
123-
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
124-
<argument name="productCount" value="CONST.three"/>
122+
<argument name="productCount" value="3"/>
125123
</actionGroup>
126124
<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1">
127125
<argument name="product" value="$$createSimpleProduct1$$"/>
@@ -147,8 +145,7 @@
147145
<waitForLoadingMaskToDisappear stepKey="waitForCompareCategory1loaded" />
148146
<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="compareAssertCategory1">
149147
<argument name="category" value="$$createCategory$$"/>
150-
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
151-
<argument name="productCount" value="CONST.three"/>
148+
<argument name="productCount" value="3"/>
152149
</actionGroup>
153150
<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2">
154151
<argument name="product" value="$$createSimpleProduct2$$"/>
@@ -196,8 +193,7 @@
196193
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="compareClickCategoryBeforeClear" after="commentClearComparisonSidebar"/>
197194
<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="compareAssertCategory2">
198195
<argument name="category" value="$$createCategory$$"/>
199-
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
200-
<argument name="productCount" value="CONST.three"/>
196+
<argument name="productCount" value="3"/>
201197
</actionGroup>
202198
<actionGroup ref="StorefrontClearCompareActionGroup" stepKey="compareClearCompare"/>
203199
<comment userInput="End of Comparing Products" stepKey="endOfComparingProducts" />

0 commit comments

Comments
 (0)