|
| 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="AdminConfigurableProductWithTierPriceWithTaxTest"> |
| 11 | + <annotations> |
| 12 | + <features value="ConfigurableProduct"/> |
| 13 | + <stories value="Create configurable product"/> |
| 14 | + <title value="Create configurable product with tier price and check excluding tax item price"/> |
| 15 | + <description value="Create configurable product with tier price and check excluding tax item price"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <group value="ConfigurableProduct"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="productAttributeWithTwoOptionsNotVisible" stepKey="createConfigProductAttribute"/> |
| 21 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOptionOne"> |
| 22 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 23 | + </createData> |
| 24 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOptionTwo"> |
| 25 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 26 | + </createData> |
| 27 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 28 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 29 | + </createData> |
| 30 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOptionOne"> |
| 31 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 32 | + </getData> |
| 33 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOptionTwo"> |
| 34 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 35 | + </getData> |
| 36 | + |
| 37 | + <createData entity="ApiSimpleOne" stepKey="createFirstSimpleProduct"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + <requiredEntity createDataKey="getConfigAttributeOptionOne"/> |
| 40 | + </createData> |
| 41 | + <createData entity="ApiSimpleTwo" stepKey="createSecondSimpleProduct"> |
| 42 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 43 | + <requiredEntity createDataKey="getConfigAttributeOptionTwo"/> |
| 44 | + </createData> |
| 45 | + |
| 46 | + <createData entity="tierProductPrice" stepKey="addTierPrice"> |
| 47 | + <requiredEntity createDataKey="createFirstSimpleProduct" /> |
| 48 | + </createData> |
| 49 | + |
| 50 | + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> |
| 51 | + <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> |
| 52 | + |
| 53 | + <magentoCLI command="config:set tax/display/type 3" stepKey="enableShowIncludingExcludingTax"/> |
| 54 | + |
| 55 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 56 | + </before> |
| 57 | + <after> |
| 58 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogOut"/> |
| 59 | + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> |
| 60 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 63 | + |
| 64 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 65 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 66 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 67 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 68 | + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> |
| 69 | + |
| 70 | + <magentoCLI command="config:set tax/display/type 0" stepKey="disableShowIncludingExcludingTax"/> |
| 71 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 72 | + </after> |
| 73 | + |
| 74 | + <!-- Create configurable product --> |
| 75 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductGridPage"/> |
| 76 | + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> |
| 77 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 78 | + </actionGroup> |
| 79 | + |
| 80 | + <!-- Fill configurable product values --> |
| 81 | + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> |
| 82 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <!-- Create product configurations and add attribute and select all options --> |
| 86 | + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode"> |
| 87 | + <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> |
| 88 | + </actionGroup> |
| 89 | + |
| 90 | + <!-- Add associated products to configurations grid --> |
| 91 | + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> |
| 92 | + <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> |
| 93 | + <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> |
| 94 | + </actionGroup> |
| 95 | + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> |
| 96 | + <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> |
| 97 | + <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> |
| 98 | + </actionGroup> |
| 99 | + |
| 100 | + <!-- Save configurable product --> |
| 101 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> |
| 102 | + |
| 103 | + <!--Login customer on storefront--> |
| 104 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> |
| 105 | + <argument name="Customer" value="$$createCustomer$$" /> |
| 106 | + </actionGroup> |
| 107 | + |
| 108 | + <!-- Assert product tier price on product page --> |
| 109 | + <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> |
| 110 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 111 | + <selectOption userInput="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$" |
| 112 | + selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" |
| 113 | + stepKey="selectOption"/> |
| 114 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.tierPriceText}}" stepKey="tierPriceText"/> |
| 115 | + <assertStringContainsString stepKey="assertTierPriceTextOnProductPage"> |
| 116 | + <expectedResult type="string">Buy {{tierProductPrice.quantity}} for $97.43 each and save 27%</expectedResult> |
| 117 | + <actualResult type="variable">tierPriceText</actualResult> |
| 118 | + </assertStringContainsString> |
| 119 | + |
| 120 | + <!-- Assert tier price excluding price --> |
| 121 | + <actionGroup ref="StorefrontAssertExcludingTierPriceActionGroup" stepKey="assertTierPriceExcludingPrice"> |
| 122 | + <argument name="excludingPrice" value="${{tierProductPrice.price}}" /> |
| 123 | + </actionGroup> |
| 124 | + </test> |
| 125 | +</tests> |
0 commit comments