| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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="LoginAsAdmin" stepKey="loginAsAdmin"/>
- <createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
- <createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
- </before>
- <after>
- <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
- <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
- <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
- </after>
- <!-- Create a bundle product -->
- <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
- <waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
- <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct">
- <argument name="product" value="BundleProduct"/>
- </actionGroup>
- <actionGroup ref="fillProductNameAndSkuInProductForm" 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"/>
- <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
- <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
- <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
- <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
- <argument name="product" value="$$simpleProduct1$$"/>
- </actionGroup>
- <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
- <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
- <argument name="product" value="$$simpleProduct2$$"/>
- </actionGroup>
- <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
- <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
- <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
- <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
- <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 -->
- <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/>
- <waitForPageLoad stepKey="waitForCartPageLoad"/>
- <grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>
- <!-- Find the product that we just created using the product grid -->
- <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
- <waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
- <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
- <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
- <argument name="product" value="BundleProduct"/>
- </actionGroup>
- <waitForPageLoad stepKey="waitForProductFilterLoad"/>
- <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
- <waitForPageLoad stepKey="waitForProductPageLoad"/>
- <!-- 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 -->
- <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart1"/>
- <waitForPageLoad stepKey="waitForCartPageLoad1"/>
- <grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/>
- <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
- <!-- Delete the bundled product -->
- <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid">
- <argument name="product" value="BundleProduct"/>
- </actionGroup>
- </test>
- </tests>
|