|
| 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="StorefrontConfigurableProductSwatchTierPriceTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Swatches"/> |
| 13 | + <stories value="Configurable product with swatch attribute"/> |
| 14 | + <title value="Swatch option should show the tier price on product page"/> |
| 15 | + <description value="Configurable product with swatch attribute should show the tier price on product page"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-34033"/> |
| 18 | + <useCaseId value="MC-33147"/> |
| 19 | + <group value="Swatches"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create configurable product --> |
| 23 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 24 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> |
| 25 | + <requiredEntity createDataKey="createCategory"/> |
| 26 | + </createData> |
| 27 | + <!-- Login as Admin --> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!-- Delete configurable product --> |
| 32 | + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + <!-- Delete color attribute --> |
| 35 | + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> |
| 36 | + <argument name="ProductAttribute" value="ProductColorAttribute"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Logout --> |
| 39 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 40 | + </after> |
| 41 | + |
| 42 | + <!-- Create text swatch attribute with 3 options: Black, White and Blue --> |
| 43 | + <actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute"> |
| 44 | + <argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/> |
| 45 | + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
| 46 | + <argument name="option1" value="Black"/> |
| 47 | + <argument name="option2" value="White"/> |
| 48 | + <argument name="option3" value="Blue"/> |
| 49 | + </actionGroup> |
| 50 | + <!-- Open configurable product edit page --> |
| 51 | + <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/> |
| 52 | + <!-- Generate configurations for configurable product --> |
| 53 | + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createProductConfigurations"> |
| 54 | + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> |
| 57 | + <!-- Set Tier Price to one of configuration product --> |
| 58 | + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> |
| 59 | + <argument name="productSku" value="$$createConfigurableProduct.sku$$-White"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceToSimpleProduct"> |
| 62 | + <argument name="group" value="ALL GROUPS"/> |
| 63 | + <argument name="quantity" value="5"/> |
| 64 | + <argument name="price" value="Discount"/> |
| 65 | + <argument name="amount" value="50"/> |
| 66 | + </actionGroup> |
| 67 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> |
| 68 | + <!-- Go to storefront product page --> |
| 69 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConfigurableProductPage"> |
| 70 | + <argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/> |
| 71 | + </actionGroup> |
| 72 | + <waitForPageLoad stepKey="waitForConfigurableProductPage"/> |
| 73 | + <!-- Select White configuration --> |
| 74 | + <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption"> |
| 75 | + <argument name="optionName" value="White"/> |
| 76 | + </actionGroup> |
| 77 | + <!-- Assert tier price on selected configuration --> |
| 78 | + <actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText"> |
| 79 | + <argument name="tierProductPriceDiscountQuantity" value="5"/> |
| 80 | + <argument name="productPriceWithAppliedTierPriceDiscount" value="61.50"/> |
| 81 | + <argument name="productSavedPricePercent" value="50"/> |
| 82 | + </actionGroup> |
| 83 | + </test> |
| 84 | +</tests> |
0 commit comments