|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2024 Adobe. |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontAssertsSpecialPriceToDateProductInWidgetBlockTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Widget"/> |
| 13 | + <stories value="Catalog Products list widget"/> |
| 14 | + <title value="Storefront Asserts widget with condition Special date to"/> |
| 15 | + <description value="Testcase verifies Only 1 product which have special price to date have to be displayed in widget block."/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4492"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 21 | + <createData entity="ApiSimpleProduct" stepKey="createFirstSimpleProduct"> |
| 22 | + <requiredEntity createDataKey="createCategory"/> |
| 23 | + <field key="price">9</field> |
| 24 | + </createData> |
| 25 | + <createData entity="ApiSimpleProduct" stepKey="createSecondSimpleProduct"> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + <field key="price">1</field> |
| 28 | + </createData> |
| 29 | + <createData entity="ApiSimpleProduct" stepKey="createThirdSimpleProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + <field key="price">10</field> |
| 32 | + </createData> |
| 33 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 34 | + <!--Open Product On Admin Side--> |
| 35 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductPage"> |
| 36 | + <argument name="productId" value="$createFirstSimpleProduct.id$"/> |
| 37 | + </actionGroup> |
| 38 | + <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="openAdvancedPricingDialog"/> |
| 39 | + <generateDate date="now" format="m/d/Y" stepKey="generateTodayDate"/> |
| 40 | + <generateDate date="+1 day" format="m/d/Y" stepKey="generateTomorrowDate"/> |
| 41 | + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForSpecialPriceToBeVisible"/> |
| 42 | + <fillField userInput="1" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> |
| 43 | + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPriceFrom}}" stepKey="waitForSpecialPriceFromToBeVisible"/> |
| 44 | + <fillField userInput="{$generateTodayDate}" selector="{{AdminProductFormAdvancedPricingSection.specialPriceFrom}}" stepKey="fillSpecialPriceFrom"/> |
| 45 | + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPriceTo}}" stepKey="waitForSpecialPriceToToBeVisible"/> |
| 46 | + <fillField userInput="{$generateTomorrowDate}" selector="{{AdminProductFormAdvancedPricingSection.specialPriceTo}}" stepKey="fillSpecialPriceTo"/> |
| 47 | + <actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="clickDone"/> |
| 48 | + <!--Save the product--> |
| 49 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/> |
| 50 | + </before> |
| 51 | + <after> |
| 52 | + <!--Delete widget catalog product list--> |
| 53 | + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCatalogProductList"> |
| 54 | + <argument name="widget" value="CatalogProductsListWidget"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 57 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 58 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 59 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 60 | + <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> |
| 61 | + </after> |
| 62 | + <actionGroup ref="AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup" stepKey="createProductListWidget"> |
| 63 | + <argument name="widget" value="CatalogProductsListWidget"/> |
| 64 | + <argument name="title" value="Some Title"/> |
| 65 | + <argument name="displayPageControl" value="1"/> |
| 66 | + <argument name="numberOfProductsToDisplay" value="10"/> |
| 67 | + <argument name="condition" value="Category"/> |
| 68 | + <argument name="conditionsOperator" value="is"/> |
| 69 | + <argument name="conditionParameter" value="$createCategory.id$"/> |
| 70 | + <argument name="secondCondition" value="Special Price"/> |
| 71 | + <argument name="secondConditionOperator" value="is"/> |
| 72 | + <argument name="secondConditionParameter" value="1"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveWidget"/> |
| 75 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 76 | + <argument name="indices" value=""/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 79 | + <argument name="tags" value=""/> |
| 80 | + </actionGroup> |
| 81 | + <!-- Open category page --> |
| 82 | + <!-- Navigates to category page --> |
| 83 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage"> |
| 84 | + <argument name="category" value="$$createCategory$$"/> |
| 85 | + </actionGroup> |
| 86 | + <waitForElementVisible selector="{{StorefrontCategoryProductSection.widgetProduct($$createFirstSimpleProduct.name$$)}}" stepKey="assertFirstSimpleProduct"/> |
| 87 | + <waitForElementNotVisible selector="{{StorefrontCategoryProductSection.widgetProduct($$createSecondSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProductIsNotAvaiable"/> |
| 88 | + <waitForElementNotVisible selector="{{StorefrontCategoryProductSection.widgetProduct($$createThirdSimpleProduct.name$$)}}" stepKey="assertThirdSimpleProductIsNotAvaiable"/> |
| 89 | + </test> |
| 90 | +</tests> |
0 commit comments