Skip to content

Commit

Permalink
Merge pull request magento#94 from magento-pangolin/MC-4388
Browse files Browse the repository at this point in the history
  • Loading branch information
tomreece authored Apr 17, 2019
2 parents eafce9d + 6c5b00d commit 7461cf2
Show file tree
Hide file tree
Showing 3 changed files with 181 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontCustomerCompareProductSection">
<element name="title" type="text" selector="#block-compare-heading"/>
<element name="emptyMessage" type="text" selector=".block-compare .empty"/>

<element name="productListMainArea" type="block" selector="#compare-items"/>
<element name="productCount" type="text" selector=".block-compare .counter"/>

<element name="productByName" type="button" selector="//*[contains(@class, 'product-items')]//a[contains(@class, 'product-item-link')][contains(text(), '{{productName}}')]" parameterized="true"/>
<element name="removeProductByName" type="button" selector="//li[contains(@class, 'product-item')]//*[contains(text(), '{{productName}}')]/../../a" parameterized="true"/>

<element name="compare" type="button" selector=".actions-toolbar .compare" timeout="30"/>
<element name="clearAll" type="button" selector="#compare-clear-all" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?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="StorefrontClearAllCompareProductsTest">
<annotations>
<stories value="Compare Products"/>
<title value="Clear all products from the 'Compare Products' list"/>
<description value="You should be able to remove all Products in the 'Compare Products' list."/>
<testCaseId value="MC-14208"/>
<severity value="CRITICAL"/>
<group value="catalog"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<!-- Create Simple Customer -->
<createData entity="Simple_US_Customer_CA" stepKey="createSimpleCustomer1"/>

<!-- Create Simple Category -->
<createData entity="SimpleSubCategory" stepKey="createSimpleCategory1"/>

<!-- Create Simple Products -->
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
<requiredEntity createDataKey="createSimpleCategory1"/>
</createData>
<createData entity="SimpleProduct" stepKey="createSimpleProduct2">
<requiredEntity createDataKey="createSimpleCategory1"/>
</createData>

<!-- Create Configurable Product -->
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct1">
<requiredEntity createDataKey="createSimpleCategory1"/>
</createData>

<!-- Create Virtual Product -->
<createData entity="VirtualProduct" stepKey="createVirtualProduct1">
<requiredEntity createDataKey="createSimpleCategory1"/>
</createData>

<!-- Create Bundled Product -->
<createData entity="ApiBundleProduct" stepKey="createBundleProduct1">
<requiredEntity createDataKey="createSimpleCategory1"/>
</createData>
<createData entity="DropDownBundleOption" stepKey="createBundleOption1">
<requiredEntity createDataKey="createBundleProduct1"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
<requiredEntity createDataKey="createBundleProduct1"/>
<requiredEntity createDataKey="createBundleOption1"/>
<requiredEntity createDataKey="createSimpleProduct1"/>
<field key="qty">10</field>
</createData>

<!-- Create Grouped Product -->
<createData entity="ApiGroupedProduct2" stepKey="createGroupedProduct1">
<requiredEntity createDataKey="createSimpleCategory1"/>
</createData>
<createData entity="OneSimpleProductLink" stepKey="addFirstProduct1">
<requiredEntity createDataKey="createGroupedProduct1"/>
<requiredEntity createDataKey="createSimpleProduct1"/>
</createData>
<updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProduct1" stepKey="addSecondProduct1">
<requiredEntity createDataKey="createGroupedProduct1"/>
<requiredEntity createDataKey="createSimpleProduct2"/>
</updateData>

<!-- Create Downloadable Product -->
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct1"/>
<createData entity="ApiDownloadableLink" stepKey="addDownloadableLink1">
<requiredEntity createDataKey="createDownloadableProduct1"/>
</createData>

<!-- Login -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
</before>
<after>
<!-- Logout -->
<actionGroup ref="logout" stepKey="logoutOfAdmin1"/>

<!-- Delete Created Entities -->
<deleteData createDataKey="createSimpleCustomer1" stepKey="deleteSimpleCustomer1"/>
<deleteData createDataKey="createSimpleCategory1" stepKey="deleteSimpleCategory1"/>
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
<deleteData createDataKey="createConfigProduct1" stepKey="deleteConfigProduct1"/>
<deleteData createDataKey="createVirtualProduct1" stepKey="deleteVirtualProduct1"/>
<deleteData createDataKey="createBundleProduct1" stepKey="deleteBundleProduct1"/>
<deleteData createDataKey="createGroupedProduct1" stepKey="deleteGroupedProduct1"/>
<deleteData createDataKey="createDownloadableProduct1" stepKey="deleteDownloadableProduct1"/>
</after>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer1">
<argument name="Customer" value="$$createSimpleCustomer1$$" />
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage1">
<argument name="productUrl" value="$$createSimpleProduct1.custom_attributes[url_key]$$"/>
</actionGroup>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton1"/>
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare1">
<argument name="productVar" value="$$createSimpleProduct1$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage2">
<argument name="productUrl" value="$$createConfigProduct1.custom_attributes[url_key]$$"/>
</actionGroup>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton2"/>
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare2">
<argument name="productVar" value="$$createConfigProduct1$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage3">
<argument name="productUrl" value="$$createVirtualProduct1.custom_attributes[url_key]$$"/>
</actionGroup>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton3"/>
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare3">
<argument name="productVar" value="$$createVirtualProduct1$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage4">
<argument name="productUrl" value="$$createBundleProduct1.custom_attributes[url_key]$$"/>
</actionGroup>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton4"/>
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare4">
<argument name="productVar" value="$$createBundleProduct1$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage5">
<argument name="productUrl" value="$$createGroupedProduct1.custom_attributes[url_key]$$"/>
</actionGroup>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton5"/>
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare5">
<argument name="productVar" value="$$createGroupedProduct1$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage6">
<argument name="productUrl" value="$$createDownloadableProduct1.custom_attributes[url_key]$$"/>
</actionGroup>
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton6"/>
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare6">
<argument name="productVar" value="$$createDownloadableProduct1$$"/>
</actionGroup>

<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="amOnMyAccountDashboard1"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>

<actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clearComparedProducts1"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<testCase name="Magento\Catalog\Test\TestCase\Product\ClearAllCompareProductsTest" summary="Clear All Compare Products" ticketId="MAGETWO-25961">
<variation name="ClearAllCompareProductsTestVariation1">
<data name="config/dataset" xsi:type="string">compare_products</data>
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
<data name="products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,downloadableProduct::default,groupedProduct::grouped_product_with_price,configurableProduct::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product</data>
<constraint name="Magento\Catalog\Test\Constraint\AssertProductCompareSuccessRemoveAllProductsMessage" />
<constraint name="Magento\Catalog\Test\Constraint\AssertProductCompareItemsLinkIsAbsent" />
Expand Down

0 comments on commit 7461cf2

Please sign in to comment.