Skip to content

Commit

Permalink
add MFTF test
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Echo committed Sep 10, 2020
1 parent a93dbd8 commit d07e0a9
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontConfigurableProductMSRPCovertTest">
<annotations>
<features value="ConfigurableProduct"/>
<stories value="View configurable product options, verify convert MSRP currency on storefront."/>
<title value="Verify convert MSRP currency of configurable product options"/>
<description value="Check convert MSRP currency of configurable product options."/>
<testCaseId value="MC-37575"/>
<severity value="MAJOR"/>
<group value="ConfigurableProduct"/>
</annotations>

<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<createData entity="SimpleSubCategory" stepKey="createCategory"/>

<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>

<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>

<createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
<createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>

<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct1"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct2"/>
</createData>

<createData entity="MsrpEnableMAP" stepKey="enableMAP"/>
<magentoCLI command="config:set currency/options/allow EUR,USD" stepKey="setCurrencyAllow"/>
</before>
<after>

<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
<createData entity="MsrpDisableMAP" stepKey="disableMAP"/>
<magentoCLI command="config:set currency/options/allow USD" stepKey="setCurrencyAllow"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>

<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstChildProductEditPage">
<argument name="productId" value="$$createConfigChildProduct1.id$$"/>
</actionGroup>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingFirst">
<argument name="advancedPrice" value="100"/>
</actionGroup>

<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondChildProductEditPage">
<argument name="productId" value="$$createConfigChildProduct2.id$$"/>
</actionGroup>
<waitForPageLoad stepKey="waitForProductPageLoad1"/>
<actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingSecond">
<argument name="advancedPrice" value="100"/>
</actionGroup>

<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>

<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProduct">
<argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/>
</actionGroup>

<actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchEURCurrency">
<argument name="currency" value="EUR"/>
</actionGroup>

<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectFirstOption"/>
<waitForElement selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="waitForLoad"/>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="grabProductMapPrice"/>
<assertNotEquals stepKey="assertProductMapPrice">
<actualResult type="const">($grabProductMapPrice)</actualResult>
<expectedResult type="string">€100.00</expectedResult>
</assertNotEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSetAdvancedPricingActionGroup">
<annotations>
<description>Set advanced pricing and Save product on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="advancedPrice" type="string"/>
</arguments>

<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp"/>
<fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="{{advancedPrice}}" stepKey="setMsrpForFirstChildProduct"/>
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
</actionGroup>
</actionGroups>

0 comments on commit d07e0a9

Please sign in to comment.