|
| 1 | +<!-- |
| 2 | +/** |
| 3 | + * Copyright 2024 Adobe |
| 4 | + * All Rights Reserved. |
| 5 | + */ |
| 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="AdminAddTwoPlusWidgetsInOneContainerTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Widget"/> |
| 13 | + <stories value="content widgets"/> |
| 14 | + <title value="Add multiple widgets in one container"/> |
| 15 | + <description value="Test for adding multiple widgets in a single container and verifying the functionality on the storefront"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4400"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- 1. Create multiple products and assign to a category. --> |
| 21 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="ApiSimpleProduct" stepKey="createFirstSimpleProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + <field key="price">9</field> |
| 25 | + </createData> |
| 26 | + <createData entity="ApiSimpleProduct" stepKey="createSecondSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + <field key="price">1</field> |
| 29 | + </createData> |
| 30 | + <createData entity="ApiSimpleProduct" stepKey="createThirdSimpleProduct"> |
| 31 | + <requiredEntity createDataKey="createCategory"/> |
| 32 | + <field key="price">10</field> |
| 33 | + </createData> |
| 34 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 35 | + <actionGroup ref="AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup" stepKey="createProductListWidget"> |
| 36 | + <argument name="widget" value="CatalogProductsListWidget"/> |
| 37 | + <argument name="title" value="Some Title"/> |
| 38 | + <argument name="displayPageControl" value="1"/> |
| 39 | + <argument name="numberOfProductsToDisplay" value="10"/> |
| 40 | + <argument name="condition" value="SKU"/> |
| 41 | + <argument name="conditionsOperator" value="is one of"/> |
| 42 | + <argument name="conditionParameter" value="$createFirstSimpleProduct.sku$,$createSecondSimpleProduct.sku$"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveWidgetAndContinue"/> |
| 45 | + <actionGroup ref="AdminCreateCMSPageLinkWidgetActionGroup" stepKey="createCMSPageWidget"> |
| 46 | + <argument name="widget" value="CmsPageLinkWidget"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveCMSWidget"/> |
| 49 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 50 | + <argument name="indices" value=""/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 53 | + <argument name="tags" value=""/> |
| 54 | + </actionGroup> |
| 55 | + </before> |
| 56 | + <after> |
| 57 | + <!--Delete widget catalog product list--> |
| 58 | + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCatalogProductList"> |
| 59 | + <argument name="widget" value="CatalogProductsListWidget"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCMSPageLink"> |
| 62 | + <argument name="widget" value="CmsPageLinkWidget"/> |
| 63 | + </actionGroup> |
| 64 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 65 | + <!--Delete first simple product--> |
| 66 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 67 | + <!--Delete second simple product--> |
| 68 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 69 | + <!--Delete third simple product--> |
| 70 | + <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> |
| 71 | + <!--Logout from Admin--> |
| 72 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 73 | + </after> |
| 74 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 75 | + <waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createFirstSimpleProduct.name$$)}}" stepKey="assertFirstSimpleProduct"/> |
| 76 | + <waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSecondSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProduct"/> |
| 77 | + <waitForElementNotVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createThirdSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProductIsNotAvaiable"/> |
| 78 | + <waitForElement selector="{{StorefrontCategoryMainSection.enableCookies}}" stepKey="assertCookiesLinkIsAvailable"/> |
| 79 | + </test> |
| 80 | +</tests> |
0 commit comments