-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2299 from magento-plankton/MAGETWO-89382
[plankton] MAGETWO-89382: Automate MAGETWO-46344 MFTF
- Loading branch information
Showing
12 changed files
with
231 additions
and
30 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...e/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/MoveCategoryActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="MoveCategoryActionGroup"> | ||
<arguments> | ||
<argument name="childCategory"/> | ||
<argument name="parentCategory"/> | ||
</arguments> | ||
<click stepKey="expandAllCategoriesTree" selector="{{AdminCategorySidebarTreeSection.expandAll}}"/> | ||
<waitForAjaxLoad stepKey="waitForCategoriesExpand"/> | ||
<dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree('childCategory')}}" selector2="{{AdminCategorySidebarTreeSection.categoryInTree('parentCategory')}}" stepKey="moveCategory"/> | ||
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForWarningMessageVisible"/> | ||
<see selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessage"/> | ||
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/> | ||
<waitForPageLoad stepKey="waitForCategoryPageReload"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
.../acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/DeleteCategoriesTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> | ||
<test name="DeleteCategoriesTest"> | ||
<annotations> | ||
<features value="Delete categories"/> | ||
<title value="Delete categories."/> | ||
<description value="Delete Default Root Category and subcategories and vefify after products on storefront."/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MAGETWO-46344"/> | ||
<group value="testNotIsolated"/> | ||
</annotations> | ||
<before> | ||
<createData entity="_defaultCategory" stepKey="createCategoryC"/> | ||
<createData entity="productWithDescription" stepKey="createProduct1"> | ||
<requiredEntity createDataKey="createCategoryC"/> | ||
</createData> | ||
<createData entity="SubCategoryWithParent" stepKey="createSubCategory"> | ||
<requiredEntity createDataKey="createCategoryC"/> | ||
</createData> | ||
<createData entity="productWithDescription" stepKey="createProduct2"> | ||
<requiredEntity createDataKey="createSubCategory"/> | ||
</createData> | ||
<createData entity="_defaultCategory" stepKey="createCategoryB"/> | ||
<createData entity="productWithDescription" stepKey="createProduct3"> | ||
<requiredEntity createDataKey="createCategoryB"/> | ||
</createData> | ||
<createData entity="NewRootCategory" stepKey="createNewRootCategoryA"/> | ||
</before> | ||
<after> | ||
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> | ||
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> | ||
<deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> | ||
<deleteData createDataKey="createProduct3" stepKey="deleteProduct3"/> | ||
</after> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> | ||
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage1"/> | ||
<waitForPageLoad time="30" stepKey="waitForPageCategoryLoadAfterNavigate"/> | ||
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createNewRootCategoryA.name$$)}}" stepKey="openNewRootCategory"/> | ||
<waitForPageLoad stepKey="waitForPageCategoryLoadAfterClickOnNewRootCategory"/> | ||
<seeElement selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="assertDeleteButtonIsPresent"/> | ||
<!--Move categories from Default Category to NewRootCategory. --> | ||
<actionGroup ref="MoveCategoryActionGroup" stepKey="MoveCategoryBToNewRootCategory"> | ||
<argument name="childCategory" value="$$createCategoryC.name$$"/> | ||
<argument name="parentCategory" value="$$createNewRootCategoryA.name$$"/> | ||
</actionGroup> | ||
<actionGroup ref="MoveCategoryActionGroup" stepKey="MoveCategoryCToNewRootCategory"> | ||
<argument name="childCategory" value="$$createCategoryB.name$$"/> | ||
<argument name="parentCategory" value="$$createNewRootCategoryA.name$$"/> | ||
</actionGroup> | ||
<!-- Change root category for Main Website Store. --> | ||
<amOnPage stepKey="s1" url="{{AdminSystemStorePage.url}}"/> | ||
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" /> | ||
<click stepKey="s2" selector="{{AdminStoresGridSection.resetButton}}"/> | ||
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterResetButton" time="10"/> | ||
<fillField stepKey="s4" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store"/> | ||
<click stepKey="s5" selector="{{AdminStoresGridSection.searchButton}}"/> | ||
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterSearchButton"/> | ||
<click stepKey="s7" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" /> | ||
<waitForPageLoad stepKey="waitForPageAdminStoresGroupEditLoad" /> | ||
<selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{NewRootCategory.name}}" stepKey="setNewCategoryForStoreGroup"/> | ||
<click selector="{{AdminNewStoreViewActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> | ||
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModalSaveStoreGroup"/> | ||
<see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarning"/> | ||
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptModal" /> | ||
<waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageAdminStoresGridReload"/> | ||
<see userInput="You saved the store." stepKey="seeSavedMessage"/> | ||
|
||
<!-- @TODO: Uncomment commented below code after MQE-903 is fixed --> | ||
<!-- Perform cli reindex. --> | ||
<!--<magentoCLI command="indexer:reindex" stepKey="magentoCli"/>--> | ||
|
||
<!-- Delete Default Root Category. --> | ||
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterCLIReindexCommand"/> | ||
<waitForPageLoad time="30" stepKey="waitForPageCategoryLoadAfterCLIReindexCommand"/> | ||
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree('Default Category')}}" stepKey="clickOnDefaultRootCategory"/> | ||
<waitForPageLoad stepKey="waitForPageDefaultCategoryEditLoad" /> | ||
<seeElement selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="assertDeleteButtonIsPresent1"/> | ||
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="DeleteDefaultRootCategory"/> | ||
<waitForElementVisible selector="{{AdminCategoryModalSection.ok}}" stepKey="waitForModalDeleteDefaultRootCategory" /> | ||
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="acceptModal1"/> | ||
<waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="waitForPageReloadAfterDeleteDefaultCategory"/> | ||
<!-- Verify categories 1 and 3 their products. --> | ||
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage"/> | ||
<waitForPageLoad stepKey="homeWaitForPageLoad"/> | ||
|
||
<!-- @TODO: Uncomment commented below code after MQE-903 is fixed --> | ||
<!--<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryC.name$$)}}" stepKey="browseClickCategoryC"/>--> | ||
<!--<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertCategoryC">--> | ||
<!--<argument name="category" value="$$createCategoryC$$"/>--> | ||
<!--<argument name="productCount" value="2"/>--> | ||
<!--</actionGroup>--> | ||
<!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1">--> | ||
<!--<argument name="product" value="$$createProduct1$$"/>--> | ||
<!--</actionGroup>--> | ||
|
||
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryC.name$$)}}" stepKey="hoverCategory"/> | ||
<waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="waitForSubcategory"/> | ||
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="browseClickSubCategory"/> | ||
<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertSubcategory"> | ||
<argument name="category" value="$$createSubCategory$$"/> | ||
<argument name="productCount" value="1"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> | ||
<argument name="product" value="$$createProduct2$$"/> | ||
</actionGroup> | ||
|
||
<!-- @TODO: Uncomment commented below code after MQE-903 is fixed --> | ||
<!--<actionGroup ref="StorefrontCheckCategoryActionGroup" stepKey="browseAssertCategoryB">--> | ||
<!--<argument name="category" value="$$createCategoryB$$"/>--> | ||
<!--<argument name="productCount" value="1"/>--> | ||
<!--</actionGroup>--> | ||
<!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct3">--> | ||
<!--<argument name="product" value="$$createProduct3$$"/>--> | ||
<!--</actionGroup>--> | ||
|
||
<!-- Delete Categories 1(with subcategory) and 3. --> | ||
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterStoreFrontCategoryAssertions"/> | ||
<waitForPageLoad time="30" stepKey="waitForCategoryPageLoadAfterStoreFrontCategoryAssertions"/> | ||
<actionGroup ref="DeleteCategory" stepKey="deleteCategoryC"> | ||
<argument name="categoryEntity" value="$$createCategoryC$$"/> | ||
</actionGroup> | ||
<actionGroup ref="DeleteCategory" stepKey="deleteCategoryB"> | ||
<argument name="categoryEntity" value="$$createCategoryB$$"/> | ||
</actionGroup> | ||
<!-- Verify categories 1 and 3 are absent --> | ||
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage1"/> | ||
<waitForPageLoad stepKey="waitHomePageLoadAfterDeletingCategories"/> | ||
<dontSee selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryB.name$$)}}" stepKey="browseClickCategoryB"/> | ||
<dontSee selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryC.name$$)}}" stepKey="browseClickCategoryC"/> | ||
<!-- Verify products 1-3 are available on storefront --> | ||
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct1.custom_attributes[url_key]$$.html" stepKey="amOnProduct1Page"/> | ||
<waitForPageLoad stepKey="product1WaitForPageLoad"/> | ||
<actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> | ||
<argument name="product" value="$$createProduct1$$"/> | ||
</actionGroup> | ||
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct2.custom_attributes[url_key]$$.html" stepKey="amOnProduct2Page"/> | ||
<waitForPageLoad stepKey="product2WaitForPageLoad"/> | ||
<actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> | ||
<argument name="product" value="$$createProduct2$$"/> | ||
</actionGroup> | ||
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct3.custom_attributes[url_key]$$.html" stepKey="amOnProduct3Page"/> | ||
<waitForPageLoad stepKey="product3WaitForPageLoad"/> | ||
<actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct3Page"> | ||
<argument name="product" value="$$createProduct3$$"/> | ||
</actionGroup> | ||
<!-- Rename New Root Category to Default category --> | ||
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterStoreFrontProductsAssertions"/> | ||
<waitForPageLoad time="30" stepKey="waitForCategoryPageLoadAfterStoreFrontProductsAssertions"/> | ||
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree('$$createNewRootCategoryA.name$$')}}" stepKey="clickOnNewRootCategoryA"/> | ||
<waitForPageLoad stepKey="waitForPageNewRootCategoryALoad" /> | ||
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="Default Category" stepKey="enterCategoryNameAsDefaultCategory"/> | ||
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryDefaultCategory"/> | ||
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessageAfterSaveDefaultCategory"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.