Skip to content

Commit f18aaf6

Browse files
mftf coverage
1 parent 406b1f4 commit f18aaf6

File tree

3 files changed

+151
-0
lines changed

3 files changed

+151
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertExcludingTierPriceActionGroup">
12+
<annotations>
13+
<description>Assert product item tier price excluding price.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="excludingPrice" type="string"/>
17+
</arguments>
18+
19+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.tierPriceExcludingPrice}}" stepKey="tierPriceExcluding"/>
20+
<assertEquals stepKey="assertTierPriceTextOnProductPage">
21+
<expectedResult type="string">{{excludingPrice}}</expectedResult>
22+
<actualResult type="variable">tierPriceExcluding</actualResult>
23+
</assertEquals>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<element name="stockIndication" type="block" selector=".stock" />
2424
<element name="attributeSelectByAttributeID" type="select" selector="//div[@class='fieldset']//div[//span[text()='{{attribute_code}}']]//select" parameterized="true"/>
2525
<element name="attributeOptionByAttributeID" type="select" selector="//div[@class='fieldset']//div[//span[text()='{{attribute_code}}']]//option[text()='{{optionName}}']" parameterized="true"/>
26+
<element name="tierPriceExcludingPrice" type="text" selector=".item [data-label='Excl. Tax']"/>
2627
</section>
2728
</sections>
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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

Comments
 (0)