diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml new file mode 100644 index 0000000000000..05bbc49dd3484 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -0,0 +1,91 @@ + + + + + + + + <description value="Test log in to Shopping Cart and Delete Bundle Product From Mini Shopping Cart Test"/> + <testCaseId value="MC-14682"/> + <severity value="CRITICAL"/> + <group value="Shopping Cart"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> + <createData entity="SimpleSubCategory" stepKey="createSubCategory"/> + <!--Create simple product--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">10.00</field> + </createData> + <!--Create Bundle product--> + <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> + <requiredEntity createDataKey="createSubCategory"/> + </createData> + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">True</field> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + </before> + <after> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$createBundleProduct$$"/> + </actionGroup> + + <!-- Click on customize And Add To Cart Button --> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddtoCartButton"/> + + <!-- Select Product Quantity and add to the cart --> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> + <argument name="quantity" value="1"/> + </actionGroup> + <scrollToTopOfPage stepKey="scrollToTop"/> + <waitForPageLoad stepKey="waitForMiniCartPanelToAppear"/> + + <!-- Assert Product in Mini Cart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct3MiniCart"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="productPrice" value="$10.00"/> + <argument name="cartSubtotal" value="$10.00" /> + <argument name="qty" value="1"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> + + <!--Remove an item from the cart using minicart--> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> + <reloadPage stepKey="reloadPage"/> + + <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> + <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createBundleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml new file mode 100644 index 0000000000000..f6357bcf4caa2 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml @@ -0,0 +1,100 @@ +<?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="StorefrontDeleteConfigurableProductFromMiniShoppingCartTest"> + <annotations> + <stories value="DeleteConfigurableProduct"/> + <title value="Storefront Delete Configurable Product From Mini Shopping Cart Test"/> + <description value="Test log in to Shopping Cart and Delete Configurable Product From Mini Shopping Cart Test"/> + <testCaseId value="MC-14681"/> + <severity value="CRITICAL"/> + <group value="Shopping Cart"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <!-- Create Default Category --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + + <!-- Create an attribute with three options to be used in the first child product --> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Add the attribute just created to default attribute set --> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Get the first option of the attribute created --> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Create Configurable product --> + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create a simple product and give it the attribute with the first option --> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <field key="price">10.00</field> + </createData> + + <!-- Create the configurable product --> + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + + <!-- Add the first simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </before> + <after> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Add Configurable Product to the cart --> + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> + <argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="productOption" value="$$getConfigAttributeOption1.label$$"/> + <argument name="qty" value="1"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> + + <!--Remove an item from the cart using minicart--> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> + <reloadPage stepKey="reloadPage"/> + + <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> + <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml new file mode 100644 index 0000000000000..461139b6d4b3f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml @@ -0,0 +1,73 @@ +<?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="StorefrontDeleteDownloadableProductFromMiniShoppingCartTest"> + <annotations> + <stories value="DeleteConfigurableProduct"/> + <title value="Storefront Delete Downloadable Product From Mini Shopping Cart Test"/> + <description value="Test log in to Shopping Cart and Delete Downloadable Product From Mini Shopping Cart Test"/> + <testCaseId value="MC-14683"/> + <severity value="CRITICAL"/> + <group value="Shopping Cart"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> + <createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/> + <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> + <requiredEntity createDataKey="createDownloadableProduct"/> + </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </before> + <after> + <deleteData createDataKey="createDownloadableProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Open Downloadable Product page --> + <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="OpenStoreFrontProductPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Add Downloadable product to the cart --> + <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToTheCart"> + <argument name="productName" value="$$createDownloadableProduct.name$$" /> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + + <!-- Assert product details in Mini Cart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertMiniCart"> + <argument name="productName" value="$$createDownloadableProduct.name$$"/> + <argument name="productPrice" value="$123.00"/> + <argument name="cartSubtotal" value="123.00" /> + <argument name="qty" value="1"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <argument name="productName" value="$$createDownloadableProduct.name$$"/> + </actionGroup> + + <!--Remove an item from the cart using minicart--> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <argument name="productName" value="$$createDownloadableProduct.name$$"/> + </actionGroup> + <reloadPage stepKey="reloadPage"/> + + <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> + <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createDownloadableProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml new file mode 100644 index 0000000000000..cca5268564b12 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml @@ -0,0 +1,285 @@ +<?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="StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest"> + <annotations> + <stories value="DeleteProductsWithCartItemsDisplayDefaultLimitation"/> + <title value="Storefront Delete Products With Cart Items Display Default Limitation From Mini Shopping Cart Test"/> + <description value="Test log in to Shopping Cart and Delete Products With Cart Items Display Default Limitation From Mini Shopping Cart Test"/> + <testCaseId value="MC-14687"/> + <severity value="CRITICAL"/> + <group value="Shopping Cart"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <!--Create 10 simple products--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">10.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">20.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct3"> + <field key="price">30.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct4"> + <field key="price">40.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct5"> + <field key="price">50.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct6"> + <field key="price">60.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct7"> + <field key="price">70.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct8"> + <field key="price">80.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct9"> + <field key="price">90.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct10"> + <field key="price">100.00</field> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="simpleProduct3" stepKey="deleteProduct3"/> + <deleteData createDataKey="simpleProduct4" stepKey="deleteProduct4"/> + <deleteData createDataKey="simpleProduct5" stepKey="deleteProduct5"/> + <deleteData createDataKey="simpleProduct6" stepKey="deleteProduct6"/> + <deleteData createDataKey="simpleProduct7" stepKey="deleteProduct7"/> + <deleteData createDataKey="simpleProduct8" stepKey="deleteProduct8"/> + <deleteData createDataKey="simpleProduct9" stepKey="deleteProduct9"/> + <deleteData createDataKey="simpleProduct10" stepKey="deleteProduct10"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product1 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct1$$"/> + </actionGroup> + <!--Add Product1 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <argument name="productName" value="$$simpleProduct1.name$$"/> + </actionGroup> + + <!--Open Product2 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct2$$"/> + </actionGroup> + <!--Add Product2 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <argument name="productName" value="$$simpleProduct2.name$$"/> + </actionGroup> + + <!--Open Product3 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct3$$"/> + </actionGroup> + <!--Add Product3 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <argument name="productName" value="$$simpleProduct3.name$$"/> + </actionGroup> + + <!--Open Product4 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct4$$"/> + </actionGroup> + <!--Add Product4 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <argument name="productName" value="$$simpleProduct4.name$$"/> + </actionGroup> + + <!--Open Product5 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct5$$"/> + </actionGroup> + <!--Add Product5 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <argument name="productName" value="$$simpleProduct5.name$$"/> + </actionGroup> + + <!--Open Product6 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct6$$"/> + </actionGroup> + <!--Add Product6 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <argument name="productName" value="$$simpleProduct6.name$$"/> + </actionGroup> + + <!--Open Product7 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct7$$"/> + </actionGroup> + <!--Add Product7 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <argument name="productName" value="$$simpleProduct7.name$$"/> + </actionGroup> + + <!--Open Product8 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct8$$"/> + </actionGroup> + <!--Add Product8 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <argument name="productName" value="$$simpleProduct8.name$$"/> + </actionGroup> + + <!--Open Product9 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct9$$"/> + </actionGroup> + <!--Add Product9 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <argument name="productName" value="$$simpleProduct9.name$$"/> + </actionGroup> + + <!--Open Product10 page in StoreFront--> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <argument name="product" value="$$simpleProduct10$$"/> + </actionGroup> + <!--Add Product10 to the cart--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <argument name="productName" value="$$simpleProduct10.name$$"/> + </actionGroup> + + <!--Open Mini Cart--> + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/> + + <!--Assert Product Count in Mini Cart and verify AssertVisibleItemsQtyMessageInMiniShoppingCart--> + <actionGroup ref="StorefrontAssertMiniCartItemCountActionGroup" stepKey="assertProductCountAndTextInMiniCart"> + <argument name="productCount" value="10"/> + <argument name="productCountText" value="10 Items in Cart"/> + </actionGroup> + + <!--Assert Product1 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct11MiniCart"> + <argument name="productName" value="$$simpleProduct1.name$$"/> + <argument name="productPrice" value="$10.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product2 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct2MiniCart"> + <argument name="productName" value="$$simpleProduct2.name$$"/> + <argument name="productPrice" value="$20.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product3 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct3MiniCart"> + <argument name="productName" value="$$simpleProduct3.name$$"/> + <argument name="productPrice" value="$30.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product4 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct4MiniCart"> + <argument name="productName" value="$$simpleProduct4.name$$"/> + <argument name="productPrice" value="$40.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product5 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct5MiniCart"> + <argument name="productName" value="$$simpleProduct5.name$$"/> + <argument name="productPrice" value="$50.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product6 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct6MiniCart"> + <argument name="productName" value="$$simpleProduct6.name$$"/> + <argument name="productPrice" value="$60.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product7 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct7MiniCart"> + <argument name="productName" value="$$simpleProduct7.name$$"/> + <argument name="productPrice" value="$70.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product8 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct8MiniCart"> + <argument name="productName" value="$$simpleProduct8.name$$"/> + <argument name="productPrice" value="$80.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product9 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct9MiniCart"> + <argument name="productName" value="$$simpleProduct9.name$$"/> + <argument name="productPrice" value="$90.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + <!--Assert Product10 in Mini Cart--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct10MiniCart"> + <argument name="productName" value="$$simpleProduct10.name$$"/> + <argument name="productPrice" value="$100.00"/> + <argument name="cartSubtotal" value="$550.00" /> + <argument name="qty" value="1"/> + </actionGroup> + + <!--Remove products from minicart--> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct1FromMiniCart"> + <argument name="productName" value="$$simpleProduct10.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct2FromMiniCart"> + <argument name="productName" value="$$simpleProduct9.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct3FromMiniCart"> + <argument name="productName" value="$$simpleProduct8.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct4FromMiniCart"> + <argument name="productName" value="$$simpleProduct7.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct5FromMiniCart"> + <argument name="productName" value="$$simpleProduct6.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct6FromMiniCart"> + <argument name="productName" value="$$simpleProduct5.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct7FromMiniCart"> + <argument name="productName" value="$$simpleProduct4.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct8FromMiniCart"> + <argument name="productName" value="$$simpleProduct3.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct9FromMiniCart"> + <argument name="productName" value="$$simpleProduct2.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct10FromMiniCart"> + <argument name="productName" value="$$simpleProduct1.name$$"/> + </actionGroup> + <reloadPage stepKey="reloadPage"/> + + <!--Check the minicart is empty and verify EmptyCartMessage and AssertProductAbsentInMiniShoppingCart--> + <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct1.name$$)}}" stepKey="verifyAssertProduct1AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct2.name$$)}}" stepKey="verifyAssertProduct2AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct3.name$$)}}" stepKey="verifyAssertProduct3AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct4.name$$)}}" stepKey="verifyAssertProduct4AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct5.name$$)}}" stepKey="verifyAssertProduct5AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct6.name$$)}}" stepKey="verifyAssertProduct6AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct7.name$$)}}" stepKey="verifyAssertProduct7AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct8.name$$)}}" stepKey="verifyAssertProduct8AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct9.name$$)}}" stepKey="verifyAssertProduct9AbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct10.name$$)}}" stepKey="verifyAssertProduct10AbsentInMiniShoppingCart"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml new file mode 100644 index 0000000000000..b8092ccdcdce7 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -0,0 +1,88 @@ +<?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="StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest"> + <annotations> + <stories value="DeleteSimpleAndVirtualProduct"/> + <title value="Storefront Delete Simple And Virtual Product From Mini Shopping Cart Test"/> + <description value="Test log in to Shopping Cart and Delete Simple And Virtual Product From Mini Shopping Cart Test"/> + <testCaseId value="MC-14685"/> + <severity value="CRITICAL"/> + <group value="Shopping Cart"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <!--Create simple product--> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + <!--Create virtual product--> + <createData entity="VirtualProduct" stepKey="virtualProduct"> + <field key="price">20.00</field> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="virtualProduct" stepKey="deleteVirtualproduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Add Simple Product to the cart --> + <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductToCart"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + <!-- Add virtual Product to the cart --> + <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.name$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <argument name="productName" value="$$virtualProduct.name$$"/> + </actionGroup> + + <!-- Assert Simple and Virtual products in mini cart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProductInMiniCart"> + <argument name="productName" value="$$simpleProduct.name$$"/> + <argument name="productPrice" value="$10.00"/> + <argument name="cartSubtotal" value="$30.00" /> + <argument name="qty" value="1"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertVirtualProductInMiniCart"> + <argument name="productName" value="$$virtualProduct.name$$"/> + <argument name="productPrice" value="$20.00"/> + <argument name="cartSubtotal" value="$30.00" /> + <argument name="qty" value="1"/> + </actionGroup> + + <!-- Select mini Cart and verify Simple and Virtual products names in cart--> + <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeSimpleProductInMiniCart"> + <argument name="productName" value="$$simpleProduct.name$$"/> + </actionGroup> + <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeVirtualProductInMiniCart"> + <argument name="productName" value="$$virtualProduct.name$$"/> + </actionGroup> + + <!--Remove Simple and Virtual products from mini cart--> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <argument name="productName" value="$$simpleProduct.name$$"/> + </actionGroup> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeVirtualProductFromMiniCart"> + <argument name="productName" value="$$virtualProduct.name$$"/> + </actionGroup> + <reloadPage stepKey="reloadPage"/> + + <!--Check the minicart is empty and verify EmptyCartMessage and AssertProductAbsentInMiniShoppingCart--> + <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertSimpleProductAbsentInMiniShoppingCart"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$virtualProduct.name$$)}}" stepKey="verifyAssertVirtualProductAbsentInMiniShoppingCart"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml new file mode 100644 index 0000000000000..05198060f5de4 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml @@ -0,0 +1,63 @@ +<?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="StorefrontDeleteSimpleProductFromMiniShoppingCartTest"> + <annotations> + <stories value="DeleteSimpleProduct"/> + <title value="Storefront Delete Simple Product From Mini Shopping Cart Test"/> + <description value="Test log in to Shopping Cart and Delete Simple Product From Mini Shopping Cart Test"/> + <testCaseId value="MC-14686"/> + <severity value="CRITICAL"/> + <group value="Shopping Cart"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <!--Create simple product--> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Add Simple Product to the cart --> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!-- Assert Product in Mini Cart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct3MiniCart"> + <argument name="productName" value="$$simpleProduct.name$$"/> + <argument name="productPrice" value="$10.00"/> + <argument name="cartSubtotal" value="$10.00" /> + <argument name="qty" value="1"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <argument name="productName" value="$$simpleProduct.name$$"/> + </actionGroup> + + <!--Remove an item from the cart using minicart--> + <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <argument name="productName" value="$$simpleProduct.name$$"/> + </actionGroup> + <reloadPage stepKey="reloadPage"/> + + <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> + <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> + </test> +</tests> \ No newline at end of file