Skip to content

Commit 0c16bd8

Browse files
author
Kogut Dmitro
committed
MAGETWO-90117: Automate creating and showing categories and subcategories
1 parent fa21a5d commit 0c16bd8

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@
1717
<testCaseId value="MAGETWO-46142"/>
1818
<group value="category"/>
1919
</annotations>
20+
<!--Delete all created data during the test execution and assign Default Root Category to Store-->
21+
<after>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/>
23+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnPageAdminSystemStore"/>
24+
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" />
25+
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
26+
<waitForPageLoad time="10" stepKey="waitForPageAdminStoresGridLoadAfterResetButton"/>
27+
<fillField selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store" stepKey="fillFieldOnWebsiteStore"/>
28+
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickOnSearchButton"/>
29+
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterSearchButton"/>
30+
<click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickOnstoreGrpNameInFirstRow"/>
31+
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad1" />
32+
<selectOption userInput="Default Category" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectOptionDefaultCategory"/>
33+
<click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/>
34+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkOnModalDialog2"/>
35+
<actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory">
36+
<argument name="categoryEntity" value="NewRootCategory"/>
37+
</actionGroup>
38+
<actionGroup ref="logout" stepKey="logout2"/>
39+
</after>
2040
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
2141
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/>
2242
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
@@ -47,9 +67,9 @@
4767
<click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickOnstoreGrpNameInFirstRow"/>
4868
<waitForPageLoad stepKey="waitForPageAdminStoresGroupEditLoad" />
4969
<selectOption userInput="{{NewRootCategory.name}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectOptionCreatedNewRootCategory"/>
50-
<click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/>
70+
<click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/>
5171
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkOnModalDialog1"/>
52-
<actionGroup ref="logout" stepKey="logout"/>
72+
<actionGroup ref="logout" stepKey="logout1"/>
5373
<!--Go to storefront and verify created subcategory on frontend-->
5474
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/>
5575
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad2"/>
@@ -59,25 +79,5 @@
5979
<actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCreatedSubcategory2OnFrontend">
6080
<argument name="categoryEntity" value="SubCategoryWithParent"/>
6181
</actionGroup>
62-
<!--Delete all created data during the test execution and assign Default Root Category to Store-->
63-
<after>
64-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/>
65-
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnPageAdminSystemStore"/>
66-
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" />
67-
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
68-
<waitForPageLoad time="10" stepKey="waitForPageAdminStoresGridLoadAfterResetButton"/>
69-
<fillField selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store" stepKey="fillFieldOnWebsiteStore"/>
70-
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickOnSearchButton"/>
71-
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterSearchButton"/>
72-
<click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickOnstoreGrpNameInFirstRow"/>
73-
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad1" />
74-
<selectOption userInput="Default Category" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectOptionDefaultCategory"/>
75-
<click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/>
76-
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkOnModalDialog2"/>
77-
<actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory">
78-
<argument name="categoryEntity" value="NewRootCategory"/>
79-
</actionGroup>
80-
<actionGroup ref="logout" stepKey="logout"/>
81-
</after>
8282
</test>
8383
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage2"/>
4848
<waitForPageLoad stepKey="waitForPageLoad3"/>
4949
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategory1"/>
50-
<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="SetNoToIncludeInMenuSelect"/>
50+
<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="setNoToIncludeInMenuSelect"/>
5151
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton1"/>
5252
<seeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="seeCheckboxEnableCategoryIsChecked"/>
5353
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="dontSeeCheckboxIncludeInMenuIsChecked"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStorePage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<page name="AdminSystemStorePage" url="/admin/system_store/" area="admin" module="Store">
1010
<section name="AdminStoresMainActionsSection"/>
1111
<section name="AdminStoresGridSection"/>
12+
<section name="AdminStoreGroupActionsSection"/>
1213
</page>
1314
</pages>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
9-
<section name="AdminNewStoreGroupActionsSection">
9+
<section name="AdminStoreGroupActionsSection">
1010
<element name="saveButton" type="button" selector="#save" timeout="30" />
1111
</section>
1212
</sections>

0 commit comments

Comments
 (0)