Skip to content

Commit c5e4aa5

Browse files
committed
MFTF test.
1 parent d516e27 commit c5e4aa5

File tree

3 files changed

+162
-0
lines changed

3 files changed

+162
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StrorefrontUpdateCartItemEditParametersProductActionGroup">
12+
<arguments>
13+
<argument name="rowNumber" type="string" defaultValue="1"/>
14+
</arguments>
15+
<click selector="{{CheckoutCartProductSection.nthEditButton(rowNumber)}}" stepKey="clickEditConfigurableProductButton"/>
16+
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
<!-- Add Configurable Product with Swatch attribute to the cart -->
12+
<actionGroup name="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup">
13+
<annotations>
14+
<description>Select Product product option. Fills in the provided Product Quantity. Clicks on Add To Cart. Validates that the Success Message is present.</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="product"/>
18+
<argument name="productOption" type="string"/>
19+
<argument name="productQty" type="string" />
20+
</arguments>
21+
22+
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
23+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(productOption)}}" stepKey="clickSwatchOption"/>
24+
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="{{productQty}}" stepKey="fillProduct1Quantity"/>
25+
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="clickOnAddToCartButton"/>
26+
<waitForPageLoad stepKey="waitForProductToAddInCart"/>
27+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
28+
<seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeSuccessSaveMessage"/>
29+
30+
</actionGroup>
31+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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="StorefrontConfigurableProductSwatchUpdateCartItemTierPriceTest">
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 when Cart Item edited."/>
15+
<description value="Configurable product with swatch attribute should show the tier price on product page when added Cart Item."/>
16+
<severity value="CRITICAL"/>
17+
<group value="Swatches"/>
18+
</annotations>
19+
<before>
20+
<createData entity="ApiCategory" stepKey="createCategory"/>
21+
<createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct">
22+
<requiredEntity createDataKey="createCategory"/>
23+
</createData>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/>
28+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
29+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute">
30+
<argument name="ProductAttribute" value="ProductColorAttribute"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
33+
</after>
34+
35+
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute">
36+
<argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/>
37+
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
38+
<argument name="option1" value="Black"/>
39+
<argument name="option2" value="White"/>
40+
<argument name="option3" value="Blue"/>
41+
</actionGroup>
42+
43+
<amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/>
44+
45+
<actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createProductConfigurations">
46+
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
47+
</actionGroup>
48+
<actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/>
49+
50+
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct">
51+
<argument name="productSku" value="$$createConfigurableProduct.sku$$-White"/>
52+
</actionGroup>
53+
<actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceToSimpleProduct">
54+
<argument name="group" value="ALL GROUPS"/>
55+
<argument name="quantity" value="5"/>
56+
<argument name="price" value="Discount"/>
57+
<argument name="amount" value="50"/>
58+
</actionGroup>
59+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/>
60+
61+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConfigurableProductPage">
62+
<argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/>
63+
</actionGroup>
64+
<waitForPageLoad stepKey="waitForConfigurableProductPage"/>
65+
66+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption">
67+
<argument name="optionName" value="White"/>
68+
</actionGroup>
69+
70+
<actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText">
71+
<argument name="tierProductPriceDiscountQuantity" value="5"/>
72+
<argument name="productPriceWithAppliedTierPriceDiscount" value="61.50"/>
73+
<argument name="productSavedPricePercent" value="50"/>
74+
</actionGroup>
75+
76+
<actionGroup ref="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup" stepKey="addConfigurableProductToTheCart">
77+
<argument name="productQty" value="1"/>
78+
<argument name="product" value="ApiConfigurableProduct"/>
79+
<argument name="productOption" value="Blue"/>
80+
</actionGroup>
81+
82+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
83+
84+
<actionGroup ref="StorefrontUpdateCartItemEditParametersProductActionGroup" stepKey="updateCartItem">
85+
<argument name="rowNumber" value="1"/>
86+
</actionGroup>
87+
88+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption2">
89+
<argument name="optionName" value="White"/>
90+
</actionGroup>
91+
92+
<actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText2">
93+
<argument name="tierProductPriceDiscountQuantity" value="5"/>
94+
<argument name="productPriceWithAppliedTierPriceDiscount" value="61.50"/>
95+
<argument name="productSavedPricePercent" value="50"/>
96+
</actionGroup>
97+
98+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption3">
99+
<argument name="optionName" value="Blue"/>
100+
</actionGroup>
101+
102+
<dontSee selector="{{StorefrontProductInfoMainSection.tierPriceText}}" stepKey="dontSeeTierPriceForOption"/>
103+
104+
<actionGroup ref="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup" stepKey="addUpdatedConfigurableProductToTheCart">
105+
<argument name="productQty" value="10"/>
106+
<argument name="product" value="ApiConfigurableProduct"/>
107+
<argument name="productOption" value="White"/>
108+
</actionGroup>
109+
110+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage2"/>
111+
112+
</test>
113+
</tests>

0 commit comments

Comments
 (0)