|
| 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="AdminProductWidgetCachingTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Widget"/> |
| 14 | + <stories value="Product Widget Caching"/> |
| 15 | + <title value="Product CMS Widget Caching"/> |
| 16 | + <description value="Verify product price and currency post widget caching"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4045"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Login as Admin--> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + <!--Enable currency options--> |
| 24 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyAsEURandUSD"/> |
| 25 | + <!--Configure currency rates--> |
| 26 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="gotToCurrencyRatesPage"/> |
| 27 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates"> |
| 28 | + <argument name="firstCurrency" value="USD"/> |
| 29 | + <argument name="secondCurrency" value="EUR"/> |
| 30 | + <argument name="rate" value="0.8"/> |
| 31 | + </actionGroup> |
| 32 | + <!--Create category--> |
| 33 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 34 | + <!--Create first simple product--> |
| 35 | + <createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"> |
| 36 | + <field key="sku">simple</field> |
| 37 | + <field key="price">9</field> |
| 38 | + <requiredEntity createDataKey="createCategory"/> |
| 39 | + </createData> |
| 40 | + <!--Create second simple product--> |
| 41 | + <createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"> |
| 42 | + <field key="sku">simple1</field> |
| 43 | + <field key="price">1</field> |
| 44 | + <requiredEntity createDataKey="createCategory"/> |
| 45 | + </createData> |
| 46 | + <!--Create third simple product--> |
| 47 | + <createData entity="SimpleProduct2" stepKey="createThirdSimpleProduct"> |
| 48 | + <field key="sku">simple2</field> |
| 49 | + <field key="price">10</field> |
| 50 | + <requiredEntity createDataKey="createCategory"/> |
| 51 | + </createData> |
| 52 | + <!--Create widget catalog product list with widget options--> |
| 53 | + <actionGroup ref="AdminCreateCatalogProductsListWidgetActionGroup" stepKey="addWidgetCatalogProductList"> |
| 54 | + <argument name="widget" value="CatalogProductsListWidget"/> |
| 55 | + <argument name="title" value="Some Title"/> |
| 56 | + <argument name="displayPageControl" value="1"/> |
| 57 | + <argument name="numberOfProductsToDisplay" value="10"/> |
| 58 | + <argument name="condition" value="SKU"/> |
| 59 | + <argument name="conditionsOperator" value="is one of"/> |
| 60 | + <argument name="conditionParameter" value="$createFirstSimpleProduct.sku$,$createSecondSimpleProduct.sku$"/> |
| 61 | + </actionGroup> |
| 62 | + </before> |
| 63 | + <after> |
| 64 | + <!--Set currency options to default--> |
| 65 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setAllowedCurrencyAsDeafultUSD"/> |
| 66 | + <!--Delete widget catalog product list--> |
| 67 | + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCatalogProductList"> |
| 68 | + <argument name="widget" value="CatalogProductsListWidget"/> |
| 69 | + </actionGroup> |
| 70 | + <!--Delete first simple product--> |
| 71 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 72 | + <!--Delete second simple product--> |
| 73 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 74 | + <!--Delete third simple product--> |
| 75 | + <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> |
| 76 | + <!--Logout from Admin--> |
| 77 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 78 | + </after> |
| 79 | + <!--Navigate to storefront home page--> |
| 80 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> |
| 81 | + <!--Navigate to category page to see all products--> |
| 82 | + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="openCategoryPage"> |
| 83 | + <argument name="categoryUrl" value="$$createCategory.custom_attributes[url_key]$$"/> |
| 84 | + </actionGroup> |
| 85 | + <!--Assert first product name, price & currency displayed in USD--> |
| 86 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="assertFirstProductDetailsInUSD"> |
| 87 | + <argument name="productName" value="$$createFirstSimpleProduct.name$$"/> |
| 88 | + <argument name="productPrice" value="$$createFirstSimpleProduct.price$$"/> |
| 89 | + </actionGroup> |
| 90 | + <!--Assert second product name, price & currency displayed in USD--> |
| 91 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="assertSecondProductDetailsInUSD"> |
| 92 | + <argument name="productName" value="$$createSecondSimpleProduct.name$$"/> |
| 93 | + <argument name="productPrice" value="$$createSecondSimpleProduct.price$$"/> |
| 94 | + </actionGroup> |
| 95 | + <!--Assert third product not present as per widget options condition--> |
| 96 | + <actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="assertThirdProductNotPresent"> |
| 97 | + <argument name="categoryUrlKey" value="$$createCategory.name$$"/> |
| 98 | + <argument name="productName" value="$$createThirdSimpleProduct.name$$"/> |
| 99 | + </actionGroup> |
| 100 | + <!--Switch storefront currency display to EURO--> |
| 101 | + <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchToEURCurrency"> |
| 102 | + <argument name="currency" value="EUR"/> |
| 103 | + </actionGroup> |
| 104 | + <!--Assert first product price & currency as per EURO--> |
| 105 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="assertFirstProductDetailsInEURO"> |
| 106 | + <argument name="productName" value="$$createFirstSimpleProduct.name$$"/> |
| 107 | + <argument name="productPrice" value="€7.20"/> |
| 108 | + </actionGroup> |
| 109 | + <!--Assert second product price & currency as per EURO--> |
| 110 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="assertSecondProductDetailsInEURO"> |
| 111 | + <argument name="productName" value="$$createSecondSimpleProduct.name$$"/> |
| 112 | + <argument name="productPrice" value="€0.80"/> |
| 113 | + </actionGroup> |
| 114 | + </test> |
| 115 | +</tests> |
0 commit comments