|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <title value="Apply discount tier price and custom price values for simple product"/> |
| 14 | + <description value="Apply discount tier price and custom price values for simple product"/> |
| 15 | + <severity value="MAJOR"/> |
| 16 | + <group value="Catalog"/> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <!-- Create category --> |
| 20 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 21 | + |
| 22 | + <!-- Create product --> |
| 23 | + <createData entity="ApiSimpleProduct" stepKey="createProduct"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + <field key="price">100.00</field> |
| 26 | + </createData> |
| 27 | + |
| 28 | + <!-- Add tier price to product --> |
| 29 | + <createData entity="tierProductPriceDiscount" stepKey="addTierPrice"> |
| 30 | + <requiredEntity createDataKey="createProduct"/> |
| 31 | + </createData> |
| 32 | + |
| 33 | + <!-- Add special price to product --> |
| 34 | + <createData entity="specialProductPrice2" stepKey="addSpecialToSimpleProduct"> |
| 35 | + <requiredEntity createDataKey="createProduct"/> |
| 36 | + <field key="price">65.00</field> |
| 37 | + </createData> |
| 38 | + </before> |
| 39 | + <after> |
| 40 | + <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> |
| 41 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 42 | + </after> |
| 43 | + <!-- Open product page --> |
| 44 | + <amOnPage url="{{StorefrontProductPage.url($createProduct.sku$)}}" stepKey="openProductPage"/> |
| 45 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 46 | + |
| 47 | + <!-- Assert product name on product page --> |
| 48 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="productNameText"/> |
| 49 | + <assertEquals stepKey="assertProductNameOnProductPage"> |
| 50 | + <expectedResult type="string">$createProduct.name$</expectedResult> |
| 51 | + <actualResult type="variable">productNameText</actualResult> |
| 52 | + </assertEquals> |
| 53 | + |
| 54 | + <!-- Assert product tier price on product page --> |
| 55 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.tierPriceText}}" stepKey="tierPriceText"/> |
| 56 | + <assertEquals stepKey="assertTierPriceTextOnProductPage"> |
| 57 | + <expectedResult type="string">Buy {{tierProductPriceDiscount.quantity}} for $64.00 each and save 2%</expectedResult> |
| 58 | + <actualResult type="variable">tierPriceText</actualResult> |
| 59 | + </assertEquals> |
| 60 | + |
| 61 | + <!-- Assert final product price on product page --> |
| 62 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="productPriceText"/> |
| 63 | + <assertEquals stepKey="assertProductPriceOnProductPage"> |
| 64 | + <expectedResult type="string">$65.00</expectedResult> |
| 65 | + <actualResult type="variable">productPriceText</actualResult> |
| 66 | + </assertEquals> |
| 67 | + </test> |
| 68 | +</tests> |
0 commit comments