|
| 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="AdminCreateAndEditSimpleProductSettingsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Create/Edit simple product in Admin"/> |
| 15 | + <title value="Admin should be able to set/edit other product information when creating/editing a simple product"/> |
| 16 | + <description value="Admin should be able to set/edit product information when creating/editing a simple product"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-3241"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Login as admin --> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + |
| 25 | + <!-- Create related products --> |
| 26 | + <createData entity="SimpleProduct2" stepKey="createFirstRelatedProduct"/> |
| 27 | + <createData entity="SimpleProduct2" stepKey="createSecondRelatedProduct"/> |
| 28 | + <createData entity="SimpleProduct2" stepKey="createThirdRelatedProduct"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!-- Delete related products --> |
| 32 | + <deleteData createDataKey="createFirstRelatedProduct" stepKey="deleteFirstRelatedProduct"/> |
| 33 | + <deleteData createDataKey="createSecondRelatedProduct" stepKey="deleteSecondRelatedProduct"/> |
| 34 | + <deleteData createDataKey="createThirdRelatedProduct" stepKey="deleteThirdRelatedProduct"/> |
| 35 | + |
| 36 | + <!-- Log out --> |
| 37 | + <actionGroup ref="logout" stepKey="logout"/> |
| 38 | + </after> |
| 39 | + |
| 40 | + <!-- Create new simple product --> |
| 41 | + <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createSimpleProduct"/> |
| 42 | + |
| 43 | + <!-- Fill all main fields --> |
| 44 | + <actionGroup ref="fillMainProductForm" stepKey="fillAllNecessaryFields"/> |
| 45 | + |
| 46 | + <!-- Add two related products --> |
| 47 | + <actionGroup ref="addRelatedProductBySku" stepKey="addFirstRelatedProduct"> |
| 48 | + <argument name="sku" value="$$createFirstRelatedProduct.sku$$"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="addRelatedProductBySku" stepKey="addSecondRelatedProduct"> |
| 51 | + <argument name="sku" value="$$createSecondRelatedProduct.sku$$"/> |
| 52 | + </actionGroup> |
| 53 | + |
| 54 | + <!-- Set Design settings for the product --> |
| 55 | + <actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings"/> |
| 56 | + |
| 57 | + <!-- Set Gift Options settings for the product --> |
| 58 | + <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="enableGiftMessageSettings"> |
| 59 | + <argument name="status" value="1"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <!-- Save product form --> |
| 63 | + <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> |
| 64 | + |
| 65 | + <!-- Open product page --> |
| 66 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> |
| 67 | + <argument name="productUrl" value="{{_defaultProduct.name}}"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <!-- Assert related products at the storefront --> |
| 71 | + <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createFirstRelatedProduct.name$$)}}" stepKey="seeFirstRelatedProductInStorefront"/> |
| 72 | + <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createSecondRelatedProduct.name$$)}}" stepKey="seeSecondRelatedProductInStorefront"/> |
| 73 | + |
| 74 | + <!-- Assert product design settings "left bar is present at product page with 2 columns" --> |
| 75 | + <seeElement selector="{{StorefrontProductPageDesignSection.layoutTwoColumnsLeft}}" stepKey="seeDesignChanges"/> |
| 76 | + |
| 77 | + <!-- Assert Gift Option product settings is present --> |
| 78 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 79 | + <argument name="product" value="_defaultProduct"/> |
| 80 | + <argument name="productCount" value="1"/> |
| 81 | + </actionGroup> |
| 82 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> |
| 83 | + <actionGroup ref="StorefrontAssertGiftMessageFieldsActionGroup" stepKey="assertGiftMessageFieldsArePresent"/> |
| 84 | + |
| 85 | + <!-- Open created product --> |
| 86 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> |
| 87 | + <argument name="product" value="_defaultProduct"/> |
| 88 | + </actionGroup> |
| 89 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> |
| 90 | + <argument name="product" value="_defaultProduct"/> |
| 91 | + </actionGroup> |
| 92 | + |
| 93 | + <!-- Edit product Search Engine Optimization settings --> |
| 94 | + <actionGroup ref="AdminChangeProductSEOSettingsActionGroup" stepKey="editProductSEOSettings"> |
| 95 | + <argument name="productName" value="SimpleProduct.name"/> |
| 96 | + </actionGroup> |
| 97 | + |
| 98 | + <!-- Edit related products --> |
| 99 | + <actionGroup ref="addRelatedProductBySku" stepKey="addThirdRelatedProduct"> |
| 100 | + <argument name="sku" value="$$createThirdRelatedProduct.sku$$"/> |
| 101 | + </actionGroup> |
| 102 | + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeRelatedProduct($$createFirstRelatedProduct.sku$$)}}" stepKey="removeFirstRelatedProduct"/> |
| 103 | + |
| 104 | + <!-- Edit Design settings for the product --> |
| 105 | + <actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="editProductDesignSettings"> |
| 106 | + <argument name="designSettings" value="simpleLumaDesign"/> |
| 107 | + </actionGroup> |
| 108 | + |
| 109 | + <!-- Edit Gift Option product settings --> |
| 110 | + <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> |
| 111 | + |
| 112 | + <!-- Save product form --> |
| 113 | + <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> |
| 114 | + |
| 115 | + <!-- Verify Url Key after changing --> |
| 116 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 117 | + <argument name="productUrl" value="{{SimpleProduct.name}}"/> |
| 118 | + </actionGroup> |
| 119 | + |
| 120 | + <!-- Assert related products at the storefront --> |
| 121 | + <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createSecondRelatedProduct.name$$)}}" stepKey="seeSecondRelatedProduct"/> |
| 122 | + <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createThirdRelatedProduct.name$$)}}" stepKey="seeThirdRelatedProduct"/> |
| 123 | + |
| 124 | + <!-- Assert product design settings "Layout empty" --> |
| 125 | + <seeElement selector="{{StorefrontProductPageDesignSection.layoutEmpty}}" stepKey="seeNewDesignChanges"/> |
| 126 | + |
| 127 | + <!-- Assert Gift Option product settings --> |
| 128 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> |
| 129 | + <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> |
| 130 | + |
| 131 | + <!-- Delete created simple product --> |
| 132 | + <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> |
| 133 | + <argument name="product" value="_defaultProduct"/> |
| 134 | + </actionGroup> |
| 135 | + </test> |
| 136 | +</tests> |
0 commit comments