|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 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="StorefrontAssertsCustomerBehaviourForProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Product Sorting for guest/customer in storefront"/> |
| 15 | + <title value="Sorting of product for guest/customer on storefront if remember category pagination is enabled"/> |
| 16 | + <description value="Guest/Customer should able to verify the sorting of product on storefront when remember category pagination is enabled"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-8905"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Precondition Step.1: Magento should be installed.with Sample Data --> |
| 23 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 24 | + <createData entity="SimpleProduct" stepKey="product1"> |
| 25 | + <requiredEntity createDataKey="category"/> |
| 26 | + <field key="name">Bag</field> |
| 27 | + <field key="price">120</field> |
| 28 | + </createData> |
| 29 | + <createData entity="_defaultProduct" stepKey="product2"> |
| 30 | + <requiredEntity createDataKey="category"/> |
| 31 | + <field key="name">Red Bag</field> |
| 32 | + <field key="price">130</field> |
| 33 | + </createData> |
| 34 | + <createData entity="ApiSimpleProduct" stepKey="product3"> |
| 35 | + <requiredEntity createDataKey="category"/> |
| 36 | + <field key="name">Green Bag</field> |
| 37 | + <field key="price">140</field> |
| 38 | + </createData> |
| 39 | + <createData entity="SimpleProduct" stepKey="product4"> |
| 40 | + <requiredEntity createDataKey="category"/> |
| 41 | + </createData> |
| 42 | + <createData entity="Simple_US_Customer" stepKey="customer"/> |
| 43 | + <!-- Precondition Step.2: Enable Remember Category Pagination in configuration --> |
| 44 | + <actionGroup ref="AdminEnableRememberCategoryPaginationActionGroup" stepKey="enableRememberCategoryPagination"/> |
| 45 | + </before> |
| 46 | + <after> |
| 47 | + <!-- Delete data --> |
| 48 | + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> |
| 49 | + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> |
| 50 | + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> |
| 51 | + <deleteData createDataKey="product4" stepKey="deleteProduct4"/> |
| 52 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 53 | + <deleteData createDataKey="customer" stepKey="deleteCustomer1"/> |
| 54 | + <!-- Set remember category pagination as no--> |
| 55 | + <actionGroup ref="AdminDisableRememberCategoryPaginationActionGroup" stepKey="disableRememberCategoryPagination"/> |
| 56 | + <!-- Logout From Storefront --> |
| 57 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> |
| 58 | + </after> |
| 59 | + <!-- Step 1: Go to frontend --> |
| 60 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 61 | + <argument name="Customer" value="$$customer$$"/> |
| 62 | + </actionGroup> |
| 63 | + <!-- Step 2: Search for the product Bag --> |
| 64 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> |
| 65 | + <argument name="query" value="Bag"/> |
| 66 | + </actionGroup> |
| 67 | + <waitForText userInput="$product1.name$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="seeProduct1"/> |
| 68 | + <waitForText userInput="$product2.name$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="seeProduct2"/> |
| 69 | + <waitForText userInput="$product3.name$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="seeProduct3"/> |
| 70 | + <!-- Step 3: Sort by Change to "Price". --> |
| 71 | + <selectOption selector="{{StorefrontCategoryTopToolbarSection.sortByDropdown}}" userInput="Price" stepKey="selectSortByPriceFromDropdown"/> |
| 72 | + <!-- Step 4: Click the arrow to sort by price desc/asc by clicking on UP/Down arrow. --> |
| 73 | + <actionGroup ref="StorefrontCategoryPageSortDescendingActionGroup" stepKey="setDescendingDirection"/> |
| 74 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductFirstPosition"> |
| 75 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('1')}}"/> |
| 76 | + <argument name="userInput" value="$$product1.name$$"/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductSecondPosition"> |
| 79 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('2')}}"/> |
| 80 | + <argument name="userInput" value="$$product2.name$$"/> |
| 81 | + </actionGroup> |
| 82 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductThirdPosition"> |
| 83 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('3')}}"/> |
| 84 | + <argument name="userInput" value="$$product3.name$$"/> |
| 85 | + </actionGroup> |
| 86 | + <!-- Step 5: Clicking on arrows for asc/desc of products --> |
| 87 | + <actionGroup ref="StorefrontCategoryPageSortAscendingActionGroup" stepKey="setAscendingDirection"/> |
| 88 | + <!-- Verify the products in ascending by price --> |
| 89 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductFirstPosition1"> |
| 90 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('1')}}"/> |
| 91 | + <argument name="userInput" value="$$product3.name$$"/> |
| 92 | + </actionGroup> |
| 93 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductSecondPosition1"> |
| 94 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('2')}}"/> |
| 95 | + <argument name="userInput" value="$$product2.name$$"/> |
| 96 | + </actionGroup> |
| 97 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductThirdPosition1"> |
| 98 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('3')}}"/> |
| 99 | + <argument name="userInput" value="$$product1.name$$"/> |
| 100 | + </actionGroup> |
| 101 | + <!-- Sort product by descending order --> |
| 102 | + <actionGroup ref="StorefrontCategoryPageSortDescendingActionGroup" stepKey="setDescendingDirection2"/> |
| 103 | + <!-- Verify the products in descending by price --> |
| 104 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductFirstPosition2"> |
| 105 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('1')}}"/> |
| 106 | + <argument name="userInput" value="$$product1.name$$"/> |
| 107 | + </actionGroup> |
| 108 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductSecondPosition2"> |
| 109 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('2')}}"/> |
| 110 | + <argument name="userInput" value="$$product2.name$$"/> |
| 111 | + </actionGroup> |
| 112 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductThirdPosition2"> |
| 113 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('3')}}"/> |
| 114 | + <argument name="userInput" value="$$product3.name$$"/> |
| 115 | + </actionGroup> |
| 116 | + <!-- Sort product by ascending order --> |
| 117 | + <actionGroup ref="StorefrontCategoryPageSortAscendingActionGroup" stepKey="setAscendingDirection3"/> |
| 118 | + <!-- Verify the products in ascending by price --> |
| 119 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductFirstPosition3"> |
| 120 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('1')}}"/> |
| 121 | + <argument name="userInput" value="$$product3.name$$"/> |
| 122 | + </actionGroup> |
| 123 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductSecondPosition3"> |
| 124 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('2')}}"/> |
| 125 | + <argument name="userInput" value="$$product2.name$$"/> |
| 126 | + </actionGroup> |
| 127 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductThirdPosition3"> |
| 128 | + <argument name="selector" value="{{StorefrontCategoryMainSection.lineProductName('3')}}"/> |
| 129 | + <argument name="userInput" value="$$product1.name$$"/> |
| 130 | + </actionGroup> |
| 131 | + </test> |
| 132 | +</tests> |
0 commit comments