| Current Path : /home/rtorresani/www/vendor/magento/module-bundle/Test/Mftf/Test/ |
| Current File : //home/rtorresani/www/vendor/magento/module-bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml |
<?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="StorefrontAdminEditDataTest">
<annotations>
<features value="Bundle"/>
<stories value="Bundle products list on Storefront"/>
<title value="Customer should be able to see chosen options for Bundle Product in Shopping Cart when Option Title is edited in Admin"/>
<description value="Customer should be able to see chosen options for Bundle Product in Shopping Cart when Option Title is edited in Admin"/>
<severity value="MAJOR"/>
<testCaseId value="MC-291"/>
<group value="Bundle"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
<!-- Create a bundle product -->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<!-- Add two bundle items -->
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
<scrollTo stepKey="scrollToBundleItems" selector="{{AdminProductFormBundleSection.bundledItems}}"/>
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
<actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">
<argument name="product" value="$$simpleProduct2$$"/>
</actionGroup>
<actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/>
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
<actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1">
<argument name="optionIndex" value="0"/>
<argument name="productIndex" value="0"/>
<argument name="qty" value="{{BundleProduct.defaultQuantity}}"/>
</actionGroup>
<actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2">
<argument name="optionIndex" value="0"/>
<argument name="productIndex" value="1"/>
<argument name="qty" value="{{BundleProduct.defaultQuantity}}"/>
</actionGroup>
<click stepKey="saveProductBundle" selector="{{AdminProductFormActionSection.saveButton}}"/>
<see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
<!-- Go to the storefront bundled product page -->
<amOnPage url="/{{BundleProduct.urlKey}}.html" stepKey="visitStoreFrontBundle"/>
<waitForPageLoad stepKey="waitForStorefront"/>
<click stepKey="customizeAndAddToCart" selector="{{StorefrontBundledSection.addToCart}}"/>
<waitForPageLoad stepKey="waitCustomizableOptionsPopUp"/>
<!-- add one product to the shopping cart -->
<click stepKey="selectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
<waitForPageLoad stepKey="waitForPriceUpdate"/>
<see stepKey="seeSinglePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
<click stepKey="addFirstItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
<waitForPageLoad stepKey="waitForElementAdded"/>
<!-- Go to the shopping cart page and grab the value of the option title -->
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart"/>
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>
<!-- Find the product that we just created using the product grid -->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<waitForPageLoad stepKey="waitForProductFilterLoad"/>
<actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="clickOnProductPage"/>
<!-- Change the product option title -->
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="BundleOption2" stepKey="fillOptionTitle2"/>
<click stepKey="saveProductAttribute2" selector="{{AdminProductFormActionSection.saveButton}}"/>
<see stepKey="assertSuccess2" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
<!-- Go to the shopping cart page and make sure the title has changed -->
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart1"/>
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/>
<assertNotEquals stepKey="assertNotEquals">
<actualResult type="string">{$grabTotalAfter}</actualResult>
<expectedResult type="string">{$grabTotalBefore}</expectedResult>
</assertNotEquals>
<!-- Delete the bundled product -->
<actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/>
</test>
</tests>