Skip to content

Commit

Permalink
MAGETWO-8709:[GITHUB] Child product image should be shown in Wishist …
Browse files Browse the repository at this point in the history
…if options are selected for configurable product #8168

-added functional test to cover bug fix
  • Loading branch information
dpatil-magento committed Jul 9, 2018
1 parent 5413d1a commit 7c48e9c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@
<data key="filename">magento-logo</data>
<data key="file_extension">png</data>
</entity>
<entity name="TestImageNew" type="image">
<data key="title" unique="suffix">magento-again</data>
<data key="price">1.00</data>
<data key="file_type">Upload File</data>
<data key="shareable">Yes</data>
<data key="file">magento-again.jpg</data>
<data key="filename">magento-again</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="ProductWithUnicode" type="product">
<data key="sku" unique="suffix">&#38657;&#20135;&#21697;</data>
<data key="type_id">simple</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
<element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/>
<element name="productGridCheckboxOnRow" type="checkbox" selector="//*[@id='container']//tr[{{row}}]/td[1]//input" parameterized="true"/>
<element name="productGridNameProduct" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
<element name="selectRowBasedOnName" type="input" selector="//td/div[text()='{{var1}}']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<element name="ProductImageByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/>
<element name="ProductInfoByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//div[@class='product-item-info']" parameterized="true"/>
<element name="ProductAddToCartByName" type="button" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//button[contains(@class, 'action tocart primary')]" parameterized="true"/>
<element name="ProductImageByImageName" type="text" selector="//main//li//a//img[contains(@src, '{{var1}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<element name="ProductPriceByName" type="text" selector="//main//ol[@id='wishlist-sidebar']//a[@class='product-item-link']/span[text()='{{var1}}']//ancestor::ol//span[@class='price']" parameterized="true"/>
<element name="ProductImageByName" type="text" selector="//main//ol[@id='wishlist-sidebar']//a[@class='product-item-link']/span[text()='{{var1}}']//ancestor::ol//img[@class='product-image-photo']" parameterized="true"/>
<element name="ProductAddToCartByName" type="button" selector="//main//ol[@id='wishlist-sidebar']//a[@class='product-item-link']/span[text()='{{var1}}']//ancestor::ol//button[contains(@class, 'action tocart primary')]" parameterized="true"/>
<element name="ProductImageByImageName" type="text" selector="//main//ol[@id='wishlist-sidebar']//a//img[contains(@src, '{{var1}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
<test name="ConfigurableProductChildImageShouldBeShownOnWishListTest">
<annotations>
<features value="Wishlist"/>
<stories value="MAGETWO-8709"/>
<group value="wishlist12"/>
<title value="When user add Configurable child product to WIshlist then child product image should be shown in Wishlist"/>
<description value="When user add Configurable child product to WIshlist then child product image should be shown in Wishlist"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-93097"/>
</annotations>
<before>
<magentoCLI command="config:set checkout/cart/configurable_product_image 0" stepKey="setProductImageSettingUnderCofigurationSalesCheckout"/>
<createData entity="ApiCategory" stepKey="createCategory"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>

<actionGroup ref="createConfigurableProduct" stepKey="createProduct">
<argument name="product" value="_defaultProduct"/>
<argument name="category" value="$$createCategory$$"/>
</actionGroup>
<createData entity="Simple_US_Customer" stepKey="customer"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
</after>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
<click selector="{{AdminProductGridSection.selectRowBasedOnName(_defaultProduct.name)}}" stepKey="selectProductToAddImage"/>
<waitForPageLoad stepKey="waitForProductEditPageLoad"/>
<actionGroup ref="addProductImage" stepKey="addImageForParentProduct">
<argument name="image" value="MagentoLogo"/>
</actionGroup>
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/>
<waitForPageLoad stepKey="waitForProductIndexPageLoad1"/>
<click selector="{{AdminProductGridSection.selectRowBasedOnName(colorProductAttribute1.name)}}" stepKey="selectProductToAddImage1"/>
<waitForPageLoad stepKey="waitForProductEditPageLoad1"/>
<actionGroup ref="addProductImage" stepKey="addImageForChildProduct">
<argument name="image" value="TestImageNew"/>
</actionGroup>
<actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/>

<!--Sign in as customer -->
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/>
<fillField userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/>
<fillField userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
<waitForElementVisible selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="waitForButton"/>
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
<see userInput="$$customer.firstname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeFirstName"/>
<see userInput="$$customer.lastname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeLastName"/>
<see userInput="$$customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeEmail"/>
<waitForPageLoad stepKey="waitForLogin"/>
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/>
<waitForPageLoad stepKey="wait3"/>
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/>
<selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/>
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/>
<click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addFirstProductToWishlist"/>
<waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/>
<waitForPageLoad stepKey="waitForPageToLoad2"/>
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByImageName(TestImageNew.filename)}}" stepKey="AssertWishlistProductImage" />
<seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByImageName(TestImageNew.filename)}}" stepKey="AssertWishlistSidebarProductImage" />
</test>
</tests>

0 comments on commit 7c48e9c

Please sign in to comment.