Skip to content

Commit

Permalink
Merge pull request magento#106 from magento-pangolin/MC-4462
Browse files Browse the repository at this point in the history
MC-4462
  • Loading branch information
soumyau authored Apr 25, 2019
2 parents 0d03c80 + 4f54a32 commit c5171d6
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.z
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="DeleteProductFromShoppingCartActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<click selector="{{CheckoutCartProductSection.removeProductByName(productName)}}" stepKey="deleteProductFromCheckoutCart"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<element name="ProductPriceByOption" type="text" selector="//*[contains(@class, 'item-options')]/dd[normalize-space(.)='{{var1}}']/ancestor::tr//td[contains(@class, 'price')]//span[@class='price']" parameterized="true"/>
<element name="RemoveItem" type="button"
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
<element name="removeProductByName" selector="//*[contains(text(), '{{productName}}')]/ancestor::tbody//a[@class='action action-delete']" parameterized="true" timeout="30"/>
<element name="productName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']"/>
<element name="nthItemOption" type="block" selector=".item:nth-of-type({{numElement}}) .item-options" parameterized="true"/>
<element name="nthEditButton" type="block" selector=".item:nth-of-type({{numElement}}) .action-edit" parameterized="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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="DeleteBundleDynamicProductFromShoppingCartTest">
<annotations>
<features value="Checkout"/>
<stories value="Delete Products from Shopping Cart"/>
<title value="Delete bundle dynamic product from shopping cart test"/>
<description value="Delete bundle dynamic product from shopping cart"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14689"/>
<group value="checkout"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create category and simple product -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>

<!-- Create bundle product -->
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleDynamicProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="DropDownBundleOption" stepKey="bundleOption">
<requiredEntity createDataKey="createBundleDynamicProduct"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
<requiredEntity createDataKey="createBundleDynamicProduct"/>
<requiredEntity createDataKey="bundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
</before>
<after>
<!-- Delete category -->
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>

<!-- Delete bundle product data -->
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createBundleDynamicProduct" stepKey="deleteBundleProduct"/>
</after>

<!-- Go to bundle product page -->
<amOnPage url="{{StorefrontProductPage.url($$createBundleDynamicProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>

<!-- Add product to the cart -->
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart">
<argument name="productName" value="$$createBundleDynamicProduct.name$$"/>
</actionGroup>

<!-- Remove product from cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
<waitForPageLoad stepKey="waitForCartPageLoad"/>
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
<argument name="productName" value="$$createBundleDynamicProduct.name$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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="DeleteBundleFixedProductFromShoppingCartTest">
<annotations>
<features value="Checkout"/>
<stories value="Delete Products from Shopping Cart"/>
<title value="Delete bundle fixed product from shopping cart test"/>
<description value="Delete bundle fixed product from shopping cart"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14690"/>
<group value="checkout"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create simple product -->
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>

<!-- Create bundle product -->
<createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/>
<createData entity="DropDownBundleOption" stepKey="createBundleOption">
<requiredEntity createDataKey="createFixedBundleProduct"/>
</createData>
<createData entity="ApiBundleLink" stepKey="addLinkOptionToBundleProduct">
<requiredEntity createDataKey="createFixedBundleProduct"/>
<requiredEntity createDataKey="createBundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
</before>
<after>
<!-- Delete bundle product data -->
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createFixedBundleProduct" stepKey="deleteFixedBundleProduct"/>
</after>

<!-- Go to bundle product page -->
<amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>

<!-- Add product to the cart -->
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart">
<argument name="productName" value="$$createFixedBundleProduct.name$$"/>
</actionGroup>

<!-- Remove product from cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
<waitForPageLoad stepKey="waitForCartPageLoad"/>
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
<argument name="productName" value="$$createFixedBundleProduct.name$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?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="DeleteConfigurableProductFromShoppingCartTest">
<annotations>
<features value="Checkout"/>
<stories value="Delete Products from Shopping Cart"/>
<title value="Delete configurable product from shopping cart test"/>
<description value="Delete configurable product from shopping cart"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14692"/>
<group value="checkout"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create category -->
<createData entity="_defaultCategory" stepKey="createCategory"/>

<!-- Create configurable product -->
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption"/>
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct"/>
</createData>
</before>
<after>
<!-- Delete configurable product data -->
<deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/>
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>

<!-- Delete category -->
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</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="$$getConfigAttributeOption.value$$"/>
<argument name="qty" value="1"/>
</actionGroup>

<!-- Remove product from cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
<waitForPageLoad stepKey="waitForCartPageLoad"/>
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
<argument name="productName" value="$$createConfigProduct.name$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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="DeleteDownloadableProductFromShoppingCartTest">
<annotations>
<features value="Checkout"/>
<stories value="Delete Products from Shopping Cart"/>
<title value="Delete downloadable product from shopping cart test"/>
<description value="Delete downloadable product from shopping cart"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14693"/>
<group value="checkout"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create downloadable product -->
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/>
<createData entity="ApiDownloadableLink" stepKey="addDownloadableLink">
<requiredEntity createDataKey="createDownloadableProduct"/>
</createData>
<createData entity="ApiDownloadableLink" stepKey="addDownloadableLink1">
<requiredEntity createDataKey="createDownloadableProduct"/>
</createData>
</before>
<after>
<!-- Delete downloadable product -->
<deleteData createDataKey="createDownloadableProduct" stepKey="deleteDownloadableProduct"/>
</after>

<!-- Add downloadable product to the cart -->
<amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToDownloadableProductPage"/>
<waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/>
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartDownloadableProductFromStorefrontProductPage">
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
</actionGroup>

<!-- Remove product from cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
<waitForPageLoad stepKey="waitForCartPageLoad"/>
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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="DeleteGroupedProductFromShoppingCartTest">
<annotations>
<features value="Checkout"/>
<stories value="Delete Products from Shopping Cart"/>
<title value="Delete grouped product from shopping cart test"/>
<description value="Delete grouped product from shopping cart"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14694"/>
<group value="checkout"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create grouped product with three simple products -->
<createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/>
<createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"/>
<createData entity="SimpleProduct2" stepKey="createThirdSimpleProduct"/>
<createData entity="ApiGroupedProduct" stepKey="createGroupedProduct"/>
<createData entity="OneSimpleProductLink" stepKey="addFirstProductToLink">
<requiredEntity createDataKey="createGroupedProduct"/>
<requiredEntity createDataKey="createFirstSimpleProduct"/>
</createData>
<updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProductToLink" stepKey="addSecondProductTwo">
<requiredEntity createDataKey="createGroupedProduct"/>
<requiredEntity createDataKey="createSecondSimpleProduct"/>
</updateData>
<updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProductToLink" stepKey="addThirdProductThree">
<requiredEntity createDataKey="createGroupedProduct"/>
<requiredEntity createDataKey="createThirdSimpleProduct"/>
</updateData>
</before>
<after>
<!-- Delete grouped product data -->
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstProduct"/>
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondProduct"/>
<deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdProduct"/>
<deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/>
</after>

<!-- Add grouped product to the cart -->
<actionGroup ref="StorefrontAddThreeGroupedProductToTheCartActionGroup" stepKey="addGropedProductsToTheCart">
<argument name="urlKey" value="$$createGroupedProduct.custom_attributes[url_key]$$"/>
<argument name="product1" value="$$createFirstSimpleProduct.name$$"/>
<argument name="product2" value="$$createSecondSimpleProduct.name$$"/>
<argument name="product3" value="$$createThirdSimpleProduct.name$$"/>
<argument name="qty1" value="1"/>
<argument name="qty2" value="1"/>
<argument name="qty3" value="1"/>
</actionGroup>

<!-- Remove products from cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
<waitForPageLoad stepKey="waitForCartPageLoad"/>
<click selector="{{CheckoutCartProductSection.removeProductByName($$createFirstSimpleProduct.name$$)}}" stepKey="deleteFirstProductFromCheckoutCart"/>
<click selector="{{CheckoutCartProductSection.removeProductByName($$createSecondSimpleProduct.name$$)}}" stepKey="deleteSecondProductFromCheckoutCart"/>
<click selector="{{CheckoutCartProductSection.removeProductByName($$createThirdSimpleProduct.name$$)}}" stepKey="deleteThirdProductFromCheckoutCart"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
</test>
</tests>
Loading

0 comments on commit c5171d6

Please sign in to comment.