|
| 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="StorefrontVerifyRecentlyViewedWidgetTaxPricesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Tax"/> |
| 14 | + <stories value="Recently Viewed Widget Tax Price Display"/> |
| 15 | + <title value="Display tax inclusive and exclusive prices in Recently Viewed Widget"/> |
| 16 | + <description value="Verify that Recently Viewed Widget displays correct prices including and excluding tax based on tax configuration"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-8327"/> |
| 19 | + <group value="Tax"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Pre-Condition 1:- Create Bundle Product --> |
| 23 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 24 | + <createData entity="SimpleProduct2" stepKey="createYogaStrap6Foot"> |
| 25 | + <field key="name">Sprite Yoga Strap 6 Foot</field> |
| 26 | + <field key="sku" unique="suffix">24-WG085</field> |
| 27 | + <field key="price">14.00</field> |
| 28 | + <requiredEntity createDataKey="category"/> |
| 29 | + </createData> |
| 30 | + <createData entity="SimpleProduct2" stepKey="createYogaStrap8Foot"> |
| 31 | + <field key="name">Sprite Yoga Strap 8 Foot</field> |
| 32 | + <field key="sku" unique="suffix">24-WG086</field> |
| 33 | + <field key="price">17.00</field> |
| 34 | + <requiredEntity createDataKey="category"/> |
| 35 | + </createData> |
| 36 | + <createData entity="SimpleProduct2" stepKey="createYogaStrap10Foot"> |
| 37 | + <field key="name">Sprite Yoga Strap 10 Foot</field> |
| 38 | + <field key="sku" unique="suffix">24-WG087</field> |
| 39 | + <field key="price">21.00</field> |
| 40 | + <requiredEntity createDataKey="category"/> |
| 41 | + </createData> |
| 42 | + <createData entity="ApiBundleProduct" stepKey="createSpriteYogaStrapsBundle"> |
| 43 | + <field key="name">Set of Sprite Yoga Straps</field> |
| 44 | + <field key="sku" unique="suffix">24-WG085-bundle-dynamic</field> |
| 45 | + <field key="price">52.00</field> |
| 46 | + <requiredEntity createDataKey="category"/> |
| 47 | + </createData> |
| 48 | + <createData entity="MultipleSelectOption" stepKey="createBundleOption1"> |
| 49 | + <requiredEntity createDataKey="createSpriteYogaStrapsBundle"/> |
| 50 | + <field key="title">Choose Your Yoga Straps</field> |
| 51 | + <field key="required">true</field> |
| 52 | + <field key="type">multi</field> |
| 53 | + </createData> |
| 54 | + <createData entity="ApiBundleLink" stepKey="linkYogaStrap6Foot"> |
| 55 | + <requiredEntity createDataKey="createSpriteYogaStrapsBundle"/> |
| 56 | + <requiredEntity createDataKey="createBundleOption1"/> |
| 57 | + <requiredEntity createDataKey="createYogaStrap6Foot"/> |
| 58 | + <field key="qty">1</field> |
| 59 | + <field key="is_default">true</field> |
| 60 | + <field key="price_type">0</field> |
| 61 | + </createData> |
| 62 | + <createData entity="ApiBundleLink" stepKey="linkYogaStrap8Foot"> |
| 63 | + <requiredEntity createDataKey="createSpriteYogaStrapsBundle"/> |
| 64 | + <requiredEntity createDataKey="createBundleOption1"/> |
| 65 | + <requiredEntity createDataKey="createYogaStrap8Foot"/> |
| 66 | + <field key="qty">1</field> |
| 67 | + <field key="is_default">false</field> |
| 68 | + <field key="price_type">0</field> |
| 69 | + </createData> |
| 70 | + <createData entity="ApiBundleLink" stepKey="linkYogaStrap10Foot"> |
| 71 | + <requiredEntity createDataKey="createSpriteYogaStrapsBundle"/> |
| 72 | + <requiredEntity createDataKey="createBundleOption1"/> |
| 73 | + <requiredEntity createDataKey="createYogaStrap10Foot"/> |
| 74 | + <field key="qty">1</field> |
| 75 | + <field key="is_default">false</field> |
| 76 | + <field key="price_type">0</field> |
| 77 | + </createData> |
| 78 | + <!-- Pre-Condition 2:- Taxable Goods has Tax Class configured (20%) --> |
| 79 | + <createData entity="US_All_Rate_20" stepKey="createUSAllTaxRate20"/> |
| 80 | + <!-- Step 1:- Login as admin --> |
| 81 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 82 | + <actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createDefaultTaxRule"> |
| 83 | + <argument name="taxRate" value="$$createUSAllTaxRate20$$"/> |
| 84 | + <argument name="taxRule" value="defaultTaxRule"/> |
| 85 | + </actionGroup> |
| 86 | + <!-- Pre-Condition 3:- Price Display is set to show both prices including and excluding from Stores >> Configuration >> Sales >> Tax >> Price Display Settings. --> |
| 87 | + <magentoCLI command="config:set {{CustomDisplayProductPricesInCatalog.path}} {{CustomDisplayProductPricesInCatalog.value}}" stepKey="setPriceDisplayToBothPrices"/> |
| 88 | + </before> |
| 89 | + <after> |
| 90 | + <magentoCLI command="config:set {{DisplayProductPricesInCatalog.path}} {{DisplayProductPricesInCatalog.value}}" stepKey="resetTaxDisplayToDefault"/> |
| 91 | + <deleteData createDataKey="createSpriteYogaStrapsBundle" stepKey="deleteBundleProduct"/> |
| 92 | + <deleteData createDataKey="createYogaStrap6Foot" stepKey="deleteYogaStrap6Foot"/> |
| 93 | + <deleteData createDataKey="createYogaStrap8Foot" stepKey="deleteYogaStrap8Foot"/> |
| 94 | + <deleteData createDataKey="createYogaStrap10Foot" stepKey="deleteYogaStrap10Foot"/> |
| 95 | + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> |
| 96 | + <argument name="taxRuleCode" value="{{defaultTaxRule.code}}"/> |
| 97 | + </actionGroup> |
| 98 | + <deleteData createDataKey="createUSAllTaxRate20" stepKey="deleteTaxRate"/> |
| 99 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 100 | + <actionGroup ref="AdminOpenCmsPageActionGroup" stepKey="navigateToEditHomePageToReset"> |
| 101 | + <argument name="page_id" value="{{CmsHomePageContent.page_id}}"/> |
| 102 | + </actionGroup> |
| 103 | + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisibleToReset"/> |
| 104 | + <waitForPageLoad stepKey="waitForPageLoadContentSectionToReset"/> |
| 105 | + <actionGroup ref="ClickEditWithPageBuilderButtonActionGroup" stepKey="clickEditWithPageBuilderButtonActionGroupToReset"/> |
| 106 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStageToReset"> |
| 107 | + <argument name="contentType" value="PageBuilderHtmlContentType"/> |
| 108 | + </actionGroup> |
| 109 | + <actionGroup ref="fillSlideOutPanelTextArea" stepKey="clearRecentlyViewedWidgetsFromCMSContent"> |
| 110 | + <argument name="property" value="PageBuilderHtmlCmsHomePageContent"/> |
| 111 | + </actionGroup> |
| 112 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsBlockAfterReset"/> |
| 113 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreenAfterReset"/> |
| 114 | + <actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPageAfterReset"/> |
| 115 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 116 | + </after> |
| 117 | + <!-- Step 2:- Create "Recently Viewed Widget" and add it to the home page --> |
| 118 | + <actionGroup ref="AdminOpenCmsPageActionGroup" stepKey="navigateToEditHomePage"> |
| 119 | + <argument name="page_id" value="{{CmsHomePageContent.page_id}}"/> |
| 120 | + </actionGroup> |
| 121 | + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisible"/> |
| 122 | + <waitForPageLoad stepKey="waitForPageLoadContentSection"/> |
| 123 | + <actionGroup ref="ClickEditWithPageBuilderButtonActionGroup" stepKey="clickEditWithPageBuilderButtonActionGroup"/> |
| 124 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage"> |
| 125 | + <argument name="contentType" value="PageBuilderHtmlContentType"/> |
| 126 | + </actionGroup> |
| 127 | + <actionGroup ref="AdminSelectRecentlyViewedProductWidgetFromInsertWidgetSlideOutActionGroup" stepKey="insertRecentlyViewedWidget"> |
| 128 | + <argument name="attributeSelector1" value="show_attributes"/> |
| 129 | + <argument name="attributeSelector2" value="show_buttons"/> |
| 130 | + <argument name="productAttributeSection1" value="1"/> |
| 131 | + <argument name="productAttributeSection2" value="4"/> |
| 132 | + <argument name="buttonToShowSection2" value="3"/> |
| 133 | + </actionGroup> |
| 134 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsBlock"/> |
| 135 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/> |
| 136 | + <actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/> |
| 137 | + <!-- Step 3:- Create "Catalog Product List Widget" and add it to the home page (for comparison), limit the visible SKU to created bundle product sku --> |
| 138 | + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisibleAgain"/> |
| 139 | + <waitForPageLoad stepKey="waitForPageLoadContentSectionAgain"/> |
| 140 | + <actionGroup ref="ClickEditWithPageBuilderButtonActionGroup" stepKey="clickEditWithPageBuilderButtonActionGroupAgain"/> |
| 141 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStageAgain"> |
| 142 | + <argument name="contentType" value="PageBuilderHtmlContentType"/> |
| 143 | + </actionGroup> |
| 144 | + <actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertCatalogProductsListWidget"> |
| 145 | + <argument name="widgetType" value="{{CatalogProductsListWidget.type}}"/> |
| 146 | + </actionGroup> |
| 147 | + <actionGroup ref="AdminFillCatalogProductsListWidgetSkuActionGroup" stepKey="addSkuCondition"> |
| 148 | + <argument name="sku" value="$$createSpriteYogaStrapsBundle.sku$$"/> |
| 149 | + </actionGroup> |
| 150 | + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="insertWidget"/> |
| 151 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsBlockAgain"/> |
| 152 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreenAgain"/> |
| 153 | + <actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveHomePageAfterCatalogProductListWidgetCreation"/> |
| 154 | + <!-- Step 4:- Search for "Set of Sprite Yoga Straps" product (the sample grouped product) and add to the cart --> |
| 155 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> |
| 156 | + <argument name="tags" value="full_page"/> |
| 157 | + </actionGroup> |
| 158 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> |
| 159 | + <waitForElementVisible selector="{{StorefrontCategoryProductSection.widgetProduct($$createSpriteYogaStrapsBundle.name$$)}}" stepKey="waitForProductListWidget"/> |
| 160 | + <click selector="{{StorefrontCategoryProductSection.widgetProduct($$createSpriteYogaStrapsBundle.name$$)}}" stepKey="clickOnBundleProductFromWidget"/> |
| 161 | + <actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addBundleProductToCart"> |
| 162 | + <argument name="productName" value="$$createSpriteYogaStrapsBundle.name$$"/> |
| 163 | + </actionGroup> |
| 164 | + <!-- Step 4 Result:- Verify the price of the "Set of Sprite Yoga Straps" both including and excluding price should be displayed correctly.(including : 15.16 and excluding 14) --> |
| 165 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.includingTaxPrice}}" stepKey="waitForIncludingTaxPrice"/> |
| 166 | + <waitForText selector="{{StorefrontProductInfoMainSection.includingTaxPrice}}" userInput="$16.80" stepKey="seeIncludingTaxPrice"/> |
| 167 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.excludingTaxPrice}}" stepKey="waitForExcludingTaxPrice"/> |
| 168 | + <waitForText selector="{{StorefrontProductInfoMainSection.excludingTaxPrice}}" userInput="$14.00" stepKey="seeExcludingTaxPrice"/> |
| 169 | + </test> |
| 170 | +</tests> |
0 commit comments