Skip to content

Commit d07e0a9

Browse files
committed
add MFTF test
1 parent a93dbd8 commit d07e0a9

File tree

2 files changed

+151
-0
lines changed

2 files changed

+151
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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="StorefrontConfigurableProductMSRPCovertTest">
11+
<annotations>
12+
<features value="ConfigurableProduct"/>
13+
<stories value="View configurable product options, verify convert MSRP currency on storefront."/>
14+
<title value="Verify convert MSRP currency of configurable product options"/>
15+
<description value="Check convert MSRP currency of configurable product options."/>
16+
<testCaseId value="MC-37575"/>
17+
<severity value="MAJOR"/>
18+
<group value="ConfigurableProduct"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
26+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
31+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
32+
<requiredEntity createDataKey="createConfigProductAttribute"/>
33+
</createData>
34+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</createData>
40+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
41+
<requiredEntity createDataKey="createConfigProductAttribute"/>
42+
</getData>
43+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
44+
<requiredEntity createDataKey="createConfigProductAttribute"/>
45+
</getData>
46+
47+
<createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1">
48+
<requiredEntity createDataKey="createConfigProductAttribute"/>
49+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
50+
</createData>
51+
<createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2">
52+
<requiredEntity createDataKey="createConfigProductAttribute"/>
53+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
54+
</createData>
55+
56+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
57+
<requiredEntity createDataKey="createConfigProduct"/>
58+
<requiredEntity createDataKey="createConfigProductAttribute"/>
59+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
60+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
61+
</createData>
62+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
63+
<requiredEntity createDataKey="createConfigProduct"/>
64+
<requiredEntity createDataKey="createConfigChildProduct1"/>
65+
</createData>
66+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
67+
<requiredEntity createDataKey="createConfigProduct"/>
68+
<requiredEntity createDataKey="createConfigChildProduct2"/>
69+
</createData>
70+
71+
<createData entity="MsrpEnableMAP" stepKey="enableMAP"/>
72+
<magentoCLI command="config:set currency/options/allow EUR,USD" stepKey="setCurrencyAllow"/>
73+
</before>
74+
<after>
75+
76+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
77+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
78+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
79+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
80+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
81+
<createData entity="MsrpDisableMAP" stepKey="disableMAP"/>
82+
<magentoCLI command="config:set currency/options/allow USD" stepKey="setCurrencyAllow"/>
83+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
84+
</after>
85+
86+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstChildProductEditPage">
87+
<argument name="productId" value="$$createConfigChildProduct1.id$$"/>
88+
</actionGroup>
89+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
90+
<actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingFirst">
91+
<argument name="advancedPrice" value="100"/>
92+
</actionGroup>
93+
94+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondChildProductEditPage">
95+
<argument name="productId" value="$$createConfigChildProduct2.id$$"/>
96+
</actionGroup>
97+
<waitForPageLoad stepKey="waitForProductPageLoad1"/>
98+
<actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingSecond">
99+
<argument name="advancedPrice" value="100"/>
100+
</actionGroup>
101+
102+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
103+
<argument name="tags" value=""/>
104+
</actionGroup>
105+
106+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProduct">
107+
<argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/>
108+
</actionGroup>
109+
110+
<actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchEURCurrency">
111+
<argument name="currency" value="EUR"/>
112+
</actionGroup>
113+
114+
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectFirstOption"/>
115+
<waitForElement selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="waitForLoad"/>
116+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="grabProductMapPrice"/>
117+
<assertNotEquals stepKey="assertProductMapPrice">
118+
<actualResult type="const">($grabProductMapPrice)</actualResult>
119+
<expectedResult type="string">€100.00</expectedResult>
120+
</assertNotEquals>
121+
</test>
122+
</tests>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="AdminSetAdvancedPricingActionGroup">
12+
<annotations>
13+
<description>Set advanced pricing and Save product on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="advancedPrice" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
20+
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp"/>
21+
<fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="{{advancedPrice}}" stepKey="setMsrpForFirstChildProduct"/>
22+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
23+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
24+
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/>
25+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
26+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/>
27+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
28+
</actionGroup>
29+
</actionGroups>

0 commit comments

Comments
 (0)