Skip to content

Commit

Permalink
Merge branch '2.3-develop' of https://github.com/magento/magento2ce i…
Browse files Browse the repository at this point in the history
…nto MC-6273
  • Loading branch information
vgoncharenko committed Mar 21, 2019
2 parents 704a472 + 8f45cf8 commit b5e4c92
Show file tree
Hide file tree
Showing 24 changed files with 502 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertProductImagesOnProductPageActionGroup">
<arguments>
<argument name="productImage" type="string" defaultValue="Magento_Catalog/images/product/placeholder/image.jpg" />
</arguments>
<waitForElementNotVisible selector="{{StorefrontProductMediaSection.gallerySpinner}}" stepKey="waitGallerySpinnerDisappear" />
<seeElement selector="{{StorefrontProductMediaSection.gallery}}" stepKey="seeProductGallery" />
<seeElement selector="{{StorefrontProductMediaSection.productImage(productImage)}}" stepKey="seeProductImage" />
<click selector="{{StorefrontProductMediaSection.productImage(productImage)}}" stepKey="openFullscreenImage" />
<waitForPageLoad stepKey="waitForGalleryLoaded" />
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(productImage)}}" stepKey="seeFullscreenProductImage" />
<click selector="{{StorefrontProductMediaSection.closeFullscreenImage}}" stepKey="closeFullScreenImage" />
<waitForPageLoad stepKey="waitForGalleryDisappear" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertProductNameOnProductPageActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductName" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertProductPriceOnProductPageActionGroup">
<arguments>
<argument name="productPrice" type="string"/>
</arguments>
<see selector="{{StorefrontProductInfoMainSection.price}}" userInput="{{productPrice}}" stepKey="seeProductPrice" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertProductSkuOnProductPageActionGroup">
<arguments>
<argument name="productSku" type="string"/>
</arguments>
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSku" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontOpenProductPageActionGroup">
<arguments>
<argument name="productUrl" type="string"/>
</arguments>
<amOnPage url="{{StorefrontProductPage.url(productUrl)}}" stepKey="openProductPage"/>
<waitForPageLoad stepKey="waitForProductPageLoaded"/>
</actionGroup>
</actionGroups>
5 changes: 5 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
</entity>
<entity name="ProductWithTextFieldAndAreaOptions" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
<requiredEntity type="product_option">ProductOptionArea</requiredEntity>
</entity>
<entity name="ApiVirtualProductWithDescription" type="product">
<data key="sku" unique="suffix">api-virtual-product</data>
<data key="type_id">virtual</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<element name="productName" type="text" selector=".base"/>
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
<element name="productPriceLabel" type="text" selector=".price-label"/>
<element name="price" type="text" selector=".product-info-main [data-price-type='finalPrice']"/>
<element name="productPrice" type="text" selector=".price-final_price"/>
<element name="qty" type="input" selector="#qty"/>
<element name="specialPrice" type="text" selector=".special-price"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontProductMediaSection">
<element name="gallerySpinner" type="block" selector="#maincontent .fotorama__spinner--show" />
<element name="gallery" type="block" selector="[data-gallery-role='gallery']" />
<element name="productImage" type="text" selector="//*[@data-gallery-role='gallery' and not(contains(@class, 'fullscreen'))]//img[contains(@src, '{{filename}}') and not(contains(@class, 'full'))]" parameterized="true" />
<element name="productImageFullscreen" type="text" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//img[contains(@src, '{{filename}}') and contains(@class, 'full')]" parameterized="true" />
<element name="closeFullscreenImage" type="button" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//*[@data-gallery-role='fotorama__fullscreen-icon']" />
<element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/>
<element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitFormReload"/>
<click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/>
<click stepKey="clickOnDownload" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/>
<click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/>
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForExportDataDeleted" />
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/>
</actionGroup>
</actionGroups>
</actionGroups>
13 changes: 13 additions & 0 deletions app/code/Magento/Checkout/Test/Mftf/Data/QuoteData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,17 @@
<data key="shippingMethod">Flat Rate - Fixed</data>
<data key="currency">$</data>
</entity>
<entity name="quoteQty3Price123" type="Quote">
<data key="price">123.00</data>
<data key="qty">3</data>
<data key="subtotal">369.00</data>
<data key="currency">$</data>
</entity>
<entity name="quoteQty11Subtotal1320" type="Quote">
<data key="price">100.00</data>
<data key="customOptionsPrice">20</data>
<data key="qty">11</data>
<data key="subtotal">1,320.00</data>
<data key="currency">$</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?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="StorefrontUpdateShoppingCartSimpleProductQtyTest">
<annotations>
<features value="Checkout"/>
<title value="Check updating shopping cart while updating items qty"/>
<description value="Check updating shopping cart while updating items qty"/>
<testCaseId value="MC-14731" />
<group value="shoppingCart"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>

<!-- Add the newly created product to the shopping cart -->
<actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage">
<argument name="product" value="$$createProduct$$"/>
</actionGroup>
</before>
<after>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>

<!-- Go to the shopping cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/>
<waitForPageLoad stepKey="waitForCheckoutPageLoad1"/>

<!-- Change the product QTY -->
<fillField selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" userInput="{{quoteQty3Price123.qty}}" stepKey="changeCartQty"/>
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="openShoppingCart"/>
<waitForPageLoad stepKey="waitForCheckoutPageLoad2"/>

<!-- The price and QTY values should be updated for the product -->
<grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabProductQtyInCart"/>
<see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{CheckoutCartProductSection.productSubtotalByName($$createProduct.name$$)}}" stepKey="assertProductPrice"/>
<assertEquals stepKey="assertProductQtyInCart">
<actualResult type="variable">grabProductQtyInCart</actualResult>
<expectedResult type="string">{{quoteQty3Price123.qty}}</expectedResult>
</assertEquals>

<!-- Subtotal should be updated -->
<see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertCartSubtotal"/>

<!-- Minicart product price and subtotal should be updated -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/>
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/>
<assertEquals stepKey="assertProductQtyInMinicart">
<actualResult type="variable">grabProductQtyInMinicart</actualResult>
<expectedResult type="string">{{quoteQty3Price123.qty}}</expectedResult>
</assertEquals>
<see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{StorefrontMinicartSection.subtotal}}" stepKey="assertMinicartSubtotal"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?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="StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest">
<annotations>
<features value="Checkout"/>
<title value="Check updating shopping cart while updating qty of items with custom options"/>
<description value="Check updating shopping cart while updating qty of items with custom options"/>
<testCaseId value="MC-14732" />
<group value="shoppingCart"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="ApiSimpleProductWithCustomPrice" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>

<!-- Add two custom options to the product: field and textarea -->
<updateData createDataKey="createProduct" entity="ProductWithTextFieldAndAreaOptions" stepKey="updateProductWithOption"/>

<!-- Go to the product page, fill the custom options values and add the product to the shopping cart -->
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnProductPage"/>
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
<fillField userInput="OptionField" selector="{{StorefrontProductInfoMainSection.productOptionFieldInput(ProductOptionField.title)}}" stepKey="fillProductOptionInputField"/>
<fillField userInput="OptionArea" selector="{{StorefrontProductInfoMainSection.productOptionAreaInput(ProductOptionArea.title)}}" stepKey="fillProductOptionInputArea"/>
<actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
<argument name="productName" value="$createProduct.name$"/>
</actionGroup>
</before>
<after>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>

<!-- Go to the shopping cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/>
<waitForPageLoad stepKey="waitForCheckoutPageLoad"/>

<!-- Change the product QTY -->
<fillField selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" userInput="{{quoteQty11Subtotal1320.qty}}" stepKey="changeCartQty"/>
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="updateShoppingCart"/>
<waitForPageLoad stepKey="waitShoppingCartUpdated"/>

<!-- The price and QTY values should be updated for the product -->
<grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabProductQtyInCart"/>
<see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{CheckoutCartProductSection.productSubtotalByName($$createProduct.name$$)}}" stepKey="assertProductPrice"/>
<assertEquals stepKey="assertProductQtyInCart">
<expectedResult type="string">{{quoteQty11Subtotal1320.qty}}</expectedResult>
<actualResult type="variable">grabProductQtyInCart</actualResult>
</assertEquals>
<see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/>

<!-- Minicart product price and subtotal should be updated -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/>
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/>
<assertEquals stepKey="assertProductQtyInMinicart">
<expectedResult type="string">{{quoteQty11Subtotal1320.qty}}</expectedResult>
<actualResult type="variable">grabProductQtyInMinicart</actualResult>
</assertEquals>
<see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{StorefrontMinicartSection.subtotal}}" stepKey="assertMinicartSubtotal"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertCustomerAccountPageTitleActionGroup">
<arguments>
<argument name="pageTitle" type="string" />
</arguments>
<see selector="{{StorefrontCustomerAccountMainSection.pageTitle}}" userInput="{{pageTitle}}" stepKey="assertPageTitle" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<fillField userInput="{{Customer.email}}" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/>
<fillField userInput="{{Customer.password}}" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
<waitForPageLoad stepKey="waitForCustomerLoggedIn" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="NavigateThroughCustomerTabsActionGroup">
<arguments>
<argument name="navigationItemName" type="string" />
</arguments>
<click selector="{{StorefrontCustomerSidebarSection.sidebarTab(navigationItemName)}}" stepKey="clickOnDesiredNavItem" />
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="OpenMyAccountPageActionGroup">
<click selector="{{LoggedInCustomerHeaderLinksSection.customerDropdownMenu}}" stepKey="openCustomerDropdownMenu"/>
<click selector="{{LoggedInCustomerHeaderLinksSection.myAccount}}" stepKey="clickOnMyAccount"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit b5e4c92

Please sign in to comment.