|
| 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="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontCategoryHighlightedAndProductDisplayedTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Category"/> |
| 15 | + <title value="Сheck that current category is highlighted and all products displayed for it"/> |
| 16 | + <description value="Сheck that current category is highlighted and all products displayed for it"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-19626"/> |
| 19 | + <useCaseId value="MAGETWO-98748"/> |
| 20 | + <group value="Catalog"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + <createData entity="SimpleSubCategory" stepKey="category1"/> |
| 25 | + <createData entity="SimpleSubCategory" stepKey="category2"/> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="category3"/> |
| 27 | + <createData entity="SimpleSubCategory" stepKey="category4"/> |
| 28 | + <createData entity="SimpleProduct" stepKey="product1"> |
| 29 | + <requiredEntity createDataKey="category1"/> |
| 30 | + </createData> |
| 31 | + <createData entity="SimpleProduct" stepKey="product2"> |
| 32 | + <requiredEntity createDataKey="category1"/> |
| 33 | + </createData> |
| 34 | + <createData entity="SimpleProduct" stepKey="product3"> |
| 35 | + <requiredEntity createDataKey="category2"/> |
| 36 | + </createData> |
| 37 | + <createData entity="SimpleProduct" stepKey="product4"> |
| 38 | + <requiredEntity createDataKey="category2"/> |
| 39 | + </createData> |
| 40 | + </before> |
| 41 | + <after> |
| 42 | + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> |
| 43 | + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> |
| 44 | + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> |
| 45 | + <deleteData createDataKey="product4" stepKey="deleteProduct4"/> |
| 46 | + <deleteData createDataKey="category1" stepKey="deleteCategory1"/> |
| 47 | + <deleteData createDataKey="category2" stepKey="deleteCategory2"/> |
| 48 | + <deleteData createDataKey="category3" stepKey="deleteCategory3"/> |
| 49 | + <deleteData createDataKey="category4" stepKey="deleteCategory4"/> |
| 50 | + <actionGroup ref="logout" stepKey="logout"/> |
| 51 | + </after> |
| 52 | + <!--Open Storefront home page--> |
| 53 | + <comment userInput="Open Storefront home page" stepKey="openStorefrontHomePage"/> |
| 54 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontHomePage"/> |
| 55 | + <waitForPageLoad stepKey="waitForSimpleProductPage"/> |
| 56 | + <!--Click on first category--> |
| 57 | + <comment userInput="Click on first category" stepKey="openFirstCategoryPage"/> |
| 58 | + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category1.name$$)}}" stepKey="clickCategory1Name"/> |
| 59 | + <waitForPageLoad stepKey="waitForCategory1Page"/> |
| 60 | + <!--Check if current category is highlighted and the others are not--> |
| 61 | + <comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg1NameIsHighlighted"/> |
| 62 | + <grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category1.name$$)}}" userInput="class" stepKey="grabCategory1Class"/> |
| 63 | + <assertContains expectedType="string" expected="active" actual="$grabCategory1Class" stepKey="assertCategory1IsHighlighted"/> |
| 64 | + <executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount"/> |
| 65 | + <assertEquals expectedType="int" expected="1" actual="$highlightedAmount" stepKey="assertRestCategories1IsNotHighlighted"/> |
| 66 | + <!--See products in the category page--> |
| 67 | + <comment userInput="See products in the category page" stepKey="seeProductsInCategoryPage"/> |
| 68 | + <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product1.name$)}}" stepKey="seeProduct1InCategoryPage"/> |
| 69 | + <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product2.name$)}}" stepKey="seeProduct2InCategoryPage"/> |
| 70 | + <!--Click on second category--> |
| 71 | + <comment userInput="Click on second category" stepKey="openSecondCategoryPage"/> |
| 72 | + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category2.name$$)}}" stepKey="clickCategory2Name"/> |
| 73 | + <waitForPageLoad stepKey="waitForCategory2Page"/> |
| 74 | + <!--Check if current category is highlighted and the others are not--> |
| 75 | + <comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg2NameIsHighlighted"/> |
| 76 | + <grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category2.name$$)}}" userInput="class" stepKey="grabCategory2Class"/> |
| 77 | + <assertContains expectedType="string" expected="active" actual="$grabCategory2Class" stepKey="assertCategory2IsHighlighted"/> |
| 78 | + <executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount2"/> |
| 79 | + <assertEquals expectedType="int" expected="1" actual="$highlightedAmount2" stepKey="assertRestCategories1IsNotHighlighted2"/> |
| 80 | + <!--Assert products in second category page--> |
| 81 | + <comment userInput="Assert products in second category page" stepKey="commentAssertProducts"/> |
| 82 | + <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product3.name$)}}" stepKey="seeProduct3InCategoryPage"/> |
| 83 | + <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product4.name$)}}" stepKey="seeProduct4InCategoryPage"/> |
| 84 | + </test> |
| 85 | +</tests> |
0 commit comments