|
| 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="AdminDeleteBundleDynamicPriceProductTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Bundle"/> |
| 13 | + <stories value="Delete products"/> |
| 14 | + <title value="Delete Bundle Dynamic Product"/> |
| 15 | + <description value="Admin should be able to delete a bundle dynamic product"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-26056"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + <group value="bundle"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create category and simple product --> |
| 23 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 24 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> |
| 25 | + |
| 26 | + <!-- Create bundle product --> |
| 27 | + <createData entity="ApiBundleProductPriceViewRange" stepKey="createDynamicBundleProduct"> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + </createData> |
| 30 | + <createData entity="DropDownBundleOption" stepKey="bundleOption"> |
| 31 | + <requiredEntity createDataKey="createDynamicBundleProduct"/> |
| 32 | + </createData> |
| 33 | + <createData entity="ApiBundleLink" stepKey="createNewBundleLink"> |
| 34 | + <requiredEntity createDataKey="createDynamicBundleProduct"/> |
| 35 | + <requiredEntity createDataKey="bundleOption"/> |
| 36 | + <requiredEntity createDataKey="createSimpleProduct"/> |
| 37 | + </createData> |
| 38 | + |
| 39 | + <magentoCron groups="index" stepKey="runCronIndex"/> |
| 40 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 41 | + <argument name="tags" value=""/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 44 | + </before> |
| 45 | + <after> |
| 46 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 47 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 48 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 49 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 50 | + </after> |
| 51 | + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProductFilteredBySkuAndName"> |
| 52 | + <argument name="product" value="$createDynamicBundleProduct$"/> |
| 53 | + </actionGroup> |
| 54 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> |
| 55 | + <!-- Verify product on Product Page --> |
| 56 | + <amOnPage url="{{StorefrontProductPage.url($createDynamicBundleProduct.custom_attributes[url_key]$)}}" stepKey="openBundleProductPage"/> |
| 57 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoopsMessage"/> |
| 58 | + <!-- Search for the product by sku --> |
| 59 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBySku"> |
| 60 | + <argument name="query" value="$createDynamicBundleProduct.sku$"/> |
| 61 | + </actionGroup> |
| 62 | + <!-- Should not see bundle product --> |
| 63 | + <dontSee userInput="$createDynamicBundleProduct.sku$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> |
| 64 | + <comment userInput="redundant action" stepKey="seeCantFindProductMessage"/> |
| 65 | + <amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openCategoryPage"/> |
| 66 | + <!-- Should not see any products in category --> |
| 67 | + <dontSee userInput="$createDynamicBundleProduct.name$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> |
| 68 | + <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> |
| 69 | + </test> |
| 70 | +</tests> |
0 commit comments