|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontProductMultipleWidgetsAddToCartSameProductOnce"> |
| 11 | + <annotations> |
| 12 | + <features value="PageBuilder"/> |
| 13 | + <stories value="Add to cart from product widget"/> |
| 14 | + <title value="Adding to cart from product widget when two widgets on the same page, should add to cart once"/> |
| 15 | + <description value="The product should be added to the cart only once from the product widget when the CMS page contains two rows, the first row contains the regular product widget, and the second row contains the product carousel widget and both of them are displaying the same product"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <useCaseId value="ACP2E-1564"/> |
| 18 | + <testCaseId value="AC-7939"/> |
| 19 | + <group value="pagebuilder"/> |
| 20 | + <group value="pagebuilder-cms-page"/> |
| 21 | + <group value="pagebuilder-products"/> |
| 22 | + <group value="pagebuilder-productsCarousel"/> |
| 23 | + </annotations> |
| 24 | + <before> |
| 25 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 26 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="_emptyCmsPage" stepKey="createCMSPage"/> |
| 30 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCreatedCategory"/> |
| 34 | + <deleteData createDataKey="createProduct" stepKey="deleteCreatedProduct"/> |
| 35 | + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> |
| 36 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 37 | + </after> |
| 38 | + |
| 39 | + <!-- Open the newly created CMS Page for editing and expand the Page Builder editor --> |
| 40 | + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> |
| 41 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AdminOpenPageBuilderFromContentPreviewOverlayActionGroup" stepKey="openPageBuilderFullScreen"/> |
| 44 | + |
| 45 | + <!-- Add the product widget with Page Builder, set it to carousel mode and assign the product category --> |
| 46 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer"> |
| 47 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 48 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandMenuSectionAddContent"> |
| 51 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragOntoStage"> |
| 54 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop"> |
| 57 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="chooseVisualSelectOption" stepKey="selectAppearance"> |
| 60 | + <argument name="property" value="PageBuilderProductsProductCarouselAppearance"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="chooseVisualSelectOption" stepKey="chooseSelectProductsBy"> |
| 63 | + <argument name="property" value="PageBuilderProductsSelectProductsByCategory"/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="selectCategoryFromCategoryDropDown" stepKey="selectCategory"> |
| 66 | + <argument name="category" value="$$createCategory.name$$"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/> |
| 69 | + |
| 70 | + <!-- Add the regular product widget with Page Builder and assign the product category --> |
| 71 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragSecondRowToRootContainer"> |
| 72 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 73 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandMenuSectionAddContentForSecondRow"> |
| 76 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragOntoStageForSecondRow"> |
| 79 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 80 | + </actionGroup> |
| 81 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDropForSecondRow"> |
| 82 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 83 | + </actionGroup> |
| 84 | + <actionGroup ref="chooseVisualSelectOption" stepKey="chooseSelectProductsByForSecondRow"> |
| 85 | + <argument name="property" value="PageBuilderProductsSelectProductsByCategory"/> |
| 86 | + </actionGroup> |
| 87 | + <actionGroup ref="selectCategoryFromCategoryDropDown" stepKey="selectCategoryForSecondRow"> |
| 88 | + <argument name="category" value="$$createCategory.name$$"/> |
| 89 | + </actionGroup> |
| 90 | + |
| 91 | + <!-- Save the Page Builder stage --> |
| 92 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsForSecondRow"/> |
| 93 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreenBeforeSave"/> |
| 94 | + |
| 95 | + <!-- Save the CMS Page --> |
| 96 | + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCMSPage"/> |
| 97 | + |
| 98 | + <!-- Validate Add to Cart on the storefront --> |
| 99 | + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToCMSPageStorefront"> |
| 100 | + <argument name="page" value="$$createCMSPage.identifier$$"/> |
| 101 | + </actionGroup> |
| 102 | + <actionGroup ref="StorefrontClickProductAddToCartValidateAsyncActionGroup" stepKey="clickProductAddToCartInProductsCMSPageStorefront"> |
| 103 | + <argument name="product" value="$$createProduct.name$$"/> |
| 104 | + </actionGroup> |
| 105 | + |
| 106 | + <!-- Validate the product was added to the cart just once --> |
| 107 | + <see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantityToBeJustOne"/> |
| 108 | + <actionGroup ref="StorefrontAssertProductQtyInMinicartActionGroup" stepKey="assertProductQtyInMinicartToBeJustOne"> |
| 109 | + <argument name="product" value="$$createProduct$$"/> |
| 110 | + <argument name="qty" value="1"/> |
| 111 | + </actionGroup> |
| 112 | + </test> |
| 113 | +</tests> |
0 commit comments