|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCreateCategoryWithAPIForMultiStoresTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Create categories"/> |
| 13 | + <title value="Create Category Using API post"/> |
| 14 | + <description value="Create Category Using API post when there are more than stores existing"/> |
| 15 | + <testCaseId value="AC-5384"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <group value="Catalog"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> |
| 23 | + <!--Create a new additional store view for the default website and store--> |
| 24 | + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createNewSecondStoreviewForDefaultStore"> |
| 25 | + <argument name="storeView" value="SecondStoreGroupUnique"/> |
| 26 | + </actionGroup> |
| 27 | + <!--Create a new second store for the default website--> |
| 28 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStoreForMainWebsite"> |
| 29 | + <argument name="website" value="{{_defaultWebsite.name}}"/> |
| 30 | + <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> |
| 31 | + <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> |
| 32 | + </actionGroup> |
| 33 | + <!--Create a store view for the second store--> |
| 34 | + <actionGroup ref="CreateCustomStoreViewActionGroup" stepKey="createStoreviewForSecondStore"/> |
| 35 | + <!--Create a second custom website--> |
| 36 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createNewWebsite"> |
| 37 | + <argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/> |
| 38 | + <argument name="websiteCode" value="{{secondCustomWebsite.code}}"/> |
| 39 | + </actionGroup> |
| 40 | + <!--Create a store for the second website--> |
| 41 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStoreForNewWebsite"> |
| 42 | + <argument name="website" value="{{secondCustomWebsite.name}}"/> |
| 43 | + <argument name="storeGroupName" value="{{NewStoreData.name}}"/> |
| 44 | + <argument name="storeGroupCode" value="{{NewStoreData.code}}"/> |
| 45 | + </actionGroup> |
| 46 | + <!--Create a store view of the new store of second website--> |
| 47 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 48 | + <argument name="StoreGroup" value="NewStoreData"/> |
| 49 | + <argument name="customStore" value="staticSecondStore"/> |
| 50 | + </actionGroup> |
| 51 | + </before> |
| 52 | + |
| 53 | + <after> |
| 54 | + <!--Delete the created category--> |
| 55 | + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> |
| 56 | + <argument name="categoryEntity" value="SimpleSubCategory"/> |
| 57 | + </actionGroup> |
| 58 | + <!--Set the main website as default--> |
| 59 | + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setMainWebsiteAsDefault"> |
| 60 | + <argument name="websiteName" value="{{_defaultWebsite.name}}"/> |
| 61 | + </actionGroup> |
| 62 | + <!--Delete the second created website--> |
| 63 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteCreatedWebsite"> |
| 64 | + <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> |
| 65 | + </actionGroup> |
| 66 | + <!--Create a second store created for main website--> |
| 67 | + <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCreatedCustomWebsiteStore"> |
| 68 | + <argument name="storeGroupName" value="customStoreGroup.name"/> |
| 69 | + </actionGroup> |
| 70 | + <!--Create a second store view created for main website--> |
| 71 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCreatedCustomStoreview"> |
| 72 | + <argument name="customStore" value="SecondStoreGroupUnique"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 75 | + </after> |
| 76 | + <!--Create a category and check that in storefront --> |
| 77 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 78 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> |
| 79 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="cartClickCategory"/> |
| 80 | + <see userInput="$$createCategory.name$$" stepKey="assertCategoryNameOnStorefront" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> |
| 81 | + <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad"/> |
| 82 | + <!--Switch to second store view and check that created category in storefront--> |
| 83 | + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToSecondMainStoreView"> |
| 84 | + <argument name="storeView" value="SecondStoreGroupUnique"/> |
| 85 | + </actionGroup> |
| 86 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="cartClickCategory2"/> |
| 87 | + <see userInput="$$createCategory.name$$" stepKey="assertCategoryNameOnSecondMainStoreView" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> |
| 88 | + <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad2"/> |
| 89 | + <!--Switch to second store and check that created category in storefront--> |
| 90 | + <actionGroup ref="StorefrontSwitchStoreActionGroup" stepKey="switchToSecondMainStore"> |
| 91 | + <argument name="storeName" value="{{customStoreGroup.name}}"/> |
| 92 | + </actionGroup> |
| 93 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="cartClickCategory3"/> |
| 94 | + <see userInput="$$createCategory.name$$" stepKey="assertCategoryNameOnSecondMainStore" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> |
| 95 | + <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad3"/> |
| 96 | + <!--Switch to second website and check that created category in storefront--> |
| 97 | + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setNewWebsiteAsDefault"> |
| 98 | + <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> |
| 99 | + </actionGroup> |
| 100 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage2"/> |
| 101 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="cartClickCategory4"/> |
| 102 | + <see userInput="$$createCategory.name$$" stepKey="assertCategoryNameOnSecondWebsite" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> |
| 103 | + <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad4"/> |
| 104 | + </test> |
| 105 | +</tests> |
0 commit comments