Skip to content

Commit

Permalink
Merge branch '2.4-develop' into remove_magento_customer_recurring_data
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka authored Dec 10, 2019
2 parents 2b8599a + 2f06719 commit 5b829a8
Show file tree
Hide file tree
Showing 11 changed files with 605 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
<element name="removeProductByName" type="text" 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="moveToWishlistByProductName" type="button" selector="//a[contains(text(), '{{productName}}')]/ancestor::tbody/tr//a[contains(@class, 'towishlist')]" parameterized="true"/>
<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"/>
<element name="nthBundleOptionName" type="text" selector=".product-item-details .item-options:nth-of-type({{numOption}}) dt" parameterized="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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="AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest">
<annotations>
<features value="UrlRewrite" />
<stories value="Delete custom URL rewrite"/>
<title value="Delete category URL rewrite, hyphen as request path"/>
<description value="Delete category URL rewrite, hyphen as request path"/>
<testCaseId value="MC-5348" />
<group value="urlRewrite"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
<createData entity="_defaultCategory" stepKey="category"/>
</before>
<after>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Create the Category Url Rewrite-->
<actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite">
<argument name="category" value="$$category.name$$"/>
<argument name="customUrlRewriteValue" value="For Category"/>
<argument name="storeValue" value="Default Store View"/>
<argument name="requestPath" value="-"/>
<argument name="redirectTypeValue" value="No"/>
<argument name="description" value="End To End Test"/>
</actionGroup>

<!--Delete the Category Url Rewrite-->
<actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite">
<argument name="requestPath" value="-"/>
</actionGroup>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
<argument name="message" value="You deleted the URL rewrite."/>
</actionGroup>

<!--Verify AssertPageByUrlRewriteIsNotFound-->
<actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend">
<argument name="requestPath" value="-"/>
</actionGroup>

</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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="AdminDeleteCategoryUrlRewriteWithRequestPathTest">
<annotations>
<features value="UrlRewrite" />
<stories value="Delete custom URL rewrite"/>
<title value="Delete category URL rewrite, with request path"/>
<description value="Delete category URL rewrite, with request path"/>
<testCaseId value="MC-5349" />
<group value="urlRewrite"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
<createData entity="_defaultCategory" stepKey="category"/>
</before>
<after>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Create the Category Url Rewrite-->
<actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime">
<argument name="category" value="$$category.name$$"/>
<argument name="customUrlRewriteValue" value="For Category"/>
<argument name="storeValue" value="Default Store View"/>
<argument name="requestPath" value="newrequestpath.html"/>
<argument name="redirectTypeValue" value="No"/>
<argument name="description" value="End To End Test"/>
</actionGroup>

<!--Delete the Category Url Rewrite-->
<actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewriteSecondTime">
<argument name="requestPath" value="newrequestpath.html"/>
</actionGroup>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime">
<argument name="message" value="You deleted the URL rewrite."/>
</actionGroup>

<!--Verify AssertPageByUrlRewriteIsNotFound-->
<actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontendSecondTime">
<argument name="requestPath" value="newrequestpath.html"/>
</actionGroup>

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,47 @@
<dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/>
<see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/>
</actionGroup>

<actionGroup name="AssertMoveProductToWishListSuccessMessage">
<annotations>
<description>Moves a product from the cart to the wishlist.</description>
</annotations>
<arguments>
<argument name="productName" type="string"/>
</arguments>
<click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/>
<waitForPageLoad stepKey="waitForMove"/>
<see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/>
</actionGroup>

<actionGroup name="AssertProductIsPresentInWishList">
<annotations>
<description>Go to storefront customer wishlist page and assert product name and price is present.</description>
</annotations>
<arguments>
<argument name="productName" type="string"/>
<argument name="productPrice" type="string"/>
</arguments>
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishList"/>
<waitForPageLoad stepKey="waitForWishList"/>
<waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productName)}}" time="30" stepKey="assertProductName"/>
<see userInput="{{productPrice}}" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
</actionGroup>

<actionGroup name="AssertProductDetailsInWishlist">
<annotations>
<description>Assert product name and price in wishlist on hover.</description>
</annotations>
<arguments>
<argument name="productName" type="string"/>
<argument name="label" type="string"/>
<argument name="labelValue" type="string"/>
</arguments>
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="moveMouseOverProductInfo"/>
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productName)}}" stepKey="seeAddToCart"/>
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productName)}}" stepKey="seeImage"/>
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName(productName)}}" stepKey="moveMouseOverProductDetails"/>
<see userInput="{{label}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName(productName)}}" stepKey="seeLabel"/>
<see userInput="{{labelValue}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName(productName)}}" stepKey="seeLabelValue"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
<element name="pager" type="block" selector=".toolbar .pager"/>
<element name="wishlistEmpty" type="block" selector=".form-wishlist-items .message.info.empty"/>
<element name="removeProduct" type="button" selector=".products-grid a.btn-remove" timeout="30"/>
<element name="productSeeDetailsByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]" parameterized="true"/>
<element name="productSeeDetailsLabelByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dt[@class='label']" parameterized="true"/>
<element name="productSeeDetailsValueByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dd[@class='values']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?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="StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest">
<annotations>
<stories value="Wishlist"/>
<title value="Move Configurable Product from Shopping Cart to Wishlist"/>
<description value="Move Configurable Product from Shopping Cart to Wishlist"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14211"/>
<group value="wishlist"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create Data -->
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
<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>
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3">
<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>

<!-- Get the second option of the attribute created -->
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>

<!-- Get the third option of the attribute created -->
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
<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 a simple product and give it the attribute with the second option -->
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
<field key="price">20.00</field>
</createData>

<!--Create a simple product and give it the attribute with the Third option -->
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption3"/>
<field key="price">30.00</field>
</createData>

<!-- Create the configurable product -->
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
<requiredEntity createDataKey="getConfigAttributeOption3"/>
</createData>

<!-- Add the first simple product to the configurable product -->
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct1"/>
</createData>

<!-- Add the second simple product to the configurable product -->
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct2"/>
</createData>

<!-- Add the third simple product to the configurable product -->
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct3"/>
</createData>

<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
</before>
<after>
<!-- Delete data -->
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/>
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/>
<deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- 1. Login as a customer -->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
<argument name="Customer" value="$$createCustomer$$"/>
</actionGroup>

<!-- Open Product page -->
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
<argument name="category" value="$$createCategory$$"/>
<argument name="product" value="$$createConfigProduct$$"/>
</actionGroup>
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption1"/>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/>

<!-- Add product to the cart and Assert add product to cart success message-->
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage">
<argument name="productName" value="$$createConfigProduct.name$$"/>
</actionGroup>

<!-- Select Mini Cart and select 'View And Edit Cart' -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/>

<!-- Assert move product to wishlist success message -->
<actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist">
<argument name="productName" value="$$createConfigProduct.name$$"/>
</actionGroup>

<!-- Assert product is present in wishlist -->
<actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent">
<argument name="productName" value="$$createConfigProduct.name$$"/>
<argument name="productPrice" value="$20.00"/>
</actionGroup>

<!-- Assert product details in Wishlist -->
<actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails">
<argument name="productName" value="$$createConfigProduct.name$$"/>
<argument name="label" value="$$createConfigProductAttribute.default_value$$"/>
<argument name="labelValue" value="$$getConfigAttributeOption2.label$$"/>
</actionGroup>

<actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/>
</test>
</tests>
Loading

0 comments on commit 5b829a8

Please sign in to comment.