Skip to content

Commit f275a21

Browse files
committed
MAGETWO-91440: Unassigned Attribute Values Render as N/A in Product Comparison block
- adding tests
1 parent c651af9 commit f275a21

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="StorefrontProductsCompareWithEmptyAttributeTest">
12+
<annotations>
13+
<title value="Product attribute is not visible on product compare page if it is empty"/>
14+
<description value="Product attribute should not be visible on the product compare page if it is empty for all products that are being compared, not even displayed as N/A"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="MAGETWO-91960"/>
17+
<group value="productCompare"/>
18+
</annotations>
19+
<before>
20+
<createData entity="productAttributeWithDropdownTwoOptions" stepKey="createProductAttribute"/>
21+
<createData entity="ApiCategory" stepKey="createCategory"/>
22+
<createData entity="ApiSimpleProduct" stepKey="createSimpleProduct1">
23+
<requiredEntity createDataKey="createCategory"/>
24+
</createData>
25+
<createData entity="ApiSimpleProduct" stepKey="createSimpleProduct2">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
31+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/>
32+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
33+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
34+
</after>
35+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
36+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
37+
<click selector="{{AdminProductAttributeSetGridSection.AttributeSetName('Default')}}" stepKey="chooseDefaultAttributeSet"/>
38+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
39+
<dragAndDrop selector1="{{UnassignedAttributes.ProductAttributeName('testattribute')}}" selector2="{{Group.FolderName('Product Details')}}" stepKey="moveProductAttributeToGroup"/>
40+
<click selector="{{AttributeSetSection.Save}}" stepKey="saveAttributeSet"/>
41+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" />
42+
<seeElement selector=".message-success" stepKey="assertSuccess"/>
43+
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCache"/>
44+
<amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront1"/>
45+
<!-- View Simple Product 1 -->
46+
<comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="goProductPageOnStorefront1"/>
47+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/>
48+
<waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" after="browseClickCategorySimpleProduct1View"/>
49+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct1ToCompare">
50+
<argument name="productVar" value="$$createSimpleProduct1$$"/>
51+
</actionGroup>
52+
<amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront2"/>
53+
<!-- View Simple Product 2 -->
54+
<comment userInput="View simple product 2" stepKey="commentViewSimpleProduct2" after="goProductPageOnStorefront2"/>
55+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View" after="commentViewSimpleProduct2"/>
56+
<waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2Viewloaded" after="browseClickCategorySimpleProduct2View"/>
57+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct2ToCompare">
58+
<argument name="productVar" value="$$createSimpleProduct2$$"/>
59+
</actionGroup>
60+
<amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront3"/>
61+
<!-- Check products in comparison sidebar -->
62+
<!-- Check simple product 1 in comparison sidebar -->
63+
<comment userInput="Check simple product 1 in comparison sidebar" stepKey="commentCheckSimpleProduct1InComparisonSidebar" after="goProductPageOnStorefront3"/>
64+
<actionGroup ref="StorefrontCheckCompareSidebarProductActionGroup" stepKey="compareSimpleProduct1InSidebar" after="commentCheckSimpleProduct1InComparisonSidebar">
65+
<argument name="productVar" value="$$createSimpleProduct1$$"/>
66+
</actionGroup>
67+
<!-- Check simple product2 in comparison sidebar -->
68+
<actionGroup ref="StorefrontCheckCompareSidebarProductActionGroup" stepKey="compareSimpleProduct2InSidebar" after="compareSimpleProduct1InSidebar">
69+
<argument name="productVar" value="$$createSimpleProduct2$$"/>
70+
</actionGroup>
71+
<!-- Check products on comparison page -->
72+
<!-- Check simple product 1 on comparison page -->
73+
<comment userInput="Check simple product 1 on comparison page" stepKey="commentCheckSimpleProduct1OnComparisonPage"/>
74+
<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="compareOpenComparePage" after="commentCheckSimpleProduct1OnComparisonPage"/>
75+
<actionGroup ref="StorefrontCheckCompareSimpleProductActionGroup" stepKey="compareAssertSimpleProduct1InComparison" after="compareOpenComparePage">
76+
<argument name="productVar" value="$$createSimpleProduct1$$"/>
77+
</actionGroup>
78+
<seeElement selector="//table[@id='product-comparison']/tbody/tr/th/*[contains(text(),'SKU')]" stepKey="seeCompareAttribute1"/>
79+
<dontSeeElement selector="//table[@id='product-comparison']/tbody/tr/th/*[contains(text(),'testattribute')]" stepKey="seeCompareAttribute2"/>
80+
</test>
81+
</tests>

0 commit comments

Comments
 (0)