Skip to content

Commit 02e778d

Browse files
RithicaRithica
authored andcommitted
AC-5727 Simple products are displayed after search
1 parent e6e2dc3 commit 02e778d

File tree

6 files changed

+257
-0
lines changed

6 files changed

+257
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@
8383
<element name="newAddedAttributeValue" type="text" selector="//option[contains(@data-title,'{{attributeValue}}')]" parameterized="true"/>
8484
<element name="country_Of_Manufacture" type="select" selector="//td[contains(text(), 'country_of_manufacture')]"/>
8585
<element name="textArea" type="text" selector="//textarea[@name='product[test_custom_attribute]']" timeout="30"/>
86+
<element name="attributeRequiredInput" type="input" selector="//input[contains(@name, 'product[{{attributeCode}}]')]" parameterized="true"/>
87+
<element name="saveCategory" type="button" selector="//button[@data-action='close-advanced-select']" timeout="30"/>
8688
</section>
8789
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@
2727
<element name="expandPriceLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Price']"/>
2828
<element name="seeLayeredNavigationFirstPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice}}']/..//span[@class='price' and text()='${{maxPrice}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
2929
<element name="seeLayeredNavigationSecondPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice2}}']/../..//a[text()='{{maxPrice2}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
30+
<element name="seeLayeredNavigationCategoryTextSwatch" type="text" selector="//div[@class='filter-options-title' and contains(text(),'TextSwatch')]"/>
31+
<element name="seeLayeredNavigationCategoryVisualSwatch" type="text" selector="//div[@class='filter-options-title' and contains(text(),'attribute')]"/>
32+
<element name="seeTextSwatchOption" type="text" selector="//div[@class='swatch-option text ' and contains(text(),'textSwatchOption1')]"/>
33+
<element name="seeVisualSwatchOption" type="text" selector="//div[@class='swatch-option image ']/..//div[@data-option-label='visualSwatchOption2']"/>
3034
</section>
3135
</sections>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AddTextSwatchToProductWithTwoOptionsActionGroup">
12+
<annotations>
13+
<description>Add text swatch property attribute.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/>
17+
<argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/>
18+
<argument name="option1" defaultValue="textSwatchOption1" type="string"/>
19+
<argument name="option2" defaultValue="textSwatchOption2" type="string"/>
20+
<argument name="usedInProductListing" defaultValue="No" type="string"/>
21+
</arguments>
22+
<!--Begin creating text swatch attribute-->
23+
<amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/>
24+
<waitForPageLoad stepKey="waitForNewProductAttributePage"/>
25+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
26+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/>
27+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/>
28+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1"/>
29+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1Description"/>
30+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/>
31+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2"/>
32+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2Description"/>
33+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/>
34+
<selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/>
35+
<fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/>
36+
<scrollToTopOfPage stepKey="scrollToTabs"/>
37+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
38+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/>
39+
<!-- Set Use In Layered Navigation -->
40+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
41+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontProperties"/>
42+
<selectOption selector="{{AttributePropertiesSection.useInLayeredNavigation}}" userInput="1" stepKey="selectUseInLayeredNavigation"/>
43+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/>
44+
<click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/>
45+
</actionGroup>
46+
</actionGroups>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AddVisualSwatchActionGroup">
12+
<annotations>
13+
<description>Add visual image swatch property attribute.</description>
14+
</annotations>
15+
16+
<!-- Begin creating a new product attribute of type "Image Swatch" -->
17+
<amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/>
18+
<waitForPageLoad stepKey="waitForAttributePageLoad"/>
19+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillDefaultLabel"/>
20+
<!-- Select visual swatch -->
21+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="swatch_visual" stepKey="selectInputType"/>
22+
<!-- This hack is because the same <input type="file"> is re-purposed used for all uploads. -->
23+
<executeJS function="HTMLInputElement.prototype.click = function() { if(this.type !== 'file') HTMLElement.prototype.click.call(this); };" stepKey="disableClick"/>
24+
<!-- Set swatch image #1 -->
25+
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/>
26+
<executeJS function="jQuery('#swatch_window_option_option_0').click()" stepKey="clickSwatch1"/>
27+
<click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/>
28+
<attachFile selector="input[name='datafile']" userInput="adobe-thumb.jpg" stepKey="attachFile1"/>
29+
<waitForElementNotVisible selector="{{AdminManageSwatchSection.swatchWindowUnavailable('0')}}" stepKey="waitForImageUploaded1"/>
30+
<fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="visualSwatchOption1" stepKey="fillAdmin1"/>
31+
<fillField selector="{{AdminManageSwatchSection.visualSwatchDefaultStoreViewBox('0')}}" userInput="visualSwatchOption1" stepKey="fillSwatchDefaultStoreViewBox1"/>
32+
<!-- Set swatch image #2 -->
33+
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/>
34+
<executeJS function="jQuery('#swatch_window_option_option_1').click()" stepKey="clickSwatch2"/>
35+
<click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/>
36+
<attachFile selector="input[name='datafile']" userInput="adobe-small.jpg" stepKey="attachFile2"/>
37+
<waitForElementNotVisible selector="{{AdminManageSwatchSection.swatchWindowUnavailable('1')}}" stepKey="waitForImageUploaded2"/>
38+
<fillField selector="{{AdminManageSwatchSection.adminInputByIndex('1')}}" userInput="visualSwatchOption2" stepKey="fillAdmin2"/>
39+
<fillField selector="{{AdminManageSwatchSection.visualSwatchDefaultStoreViewBox('1')}}" userInput="visualSwatchOption2" stepKey="fillSwatchDefaultStoreViewBox2"/>
40+
<click selector="{{AdminManageSwatchSection.swatchWindow('1')}}" stepKey="clicksWatchWindow2"/>
41+
<!-- Set scope -->
42+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/>
43+
<selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/>
44+
<scrollToTopOfPage stepKey="scrollToTabs"/>
45+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
46+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/>
47+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="Yes" stepKey="useInProductListing"/>
48+
<!-- Set Use In Layered Navigation -->
49+
<scrollToTopOfPage stepKey="scrollToTop2"/>
50+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontProperties"/>
51+
<selectOption selector="{{AttributePropertiesSection.useInLayeredNavigation}}" userInput="1" stepKey="selectUseInLayeredNavigation"/>
52+
<!-- Save the new product attribute -->
53+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAndEdit"/>
54+
<wait stepKey="waitToLoad" time="3"/>
55+
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/>
56+
</actionGroup>
57+
</actionGroups>

app/code/Magento/Swatches/Test/Mftf/Section/AdminManageSwatchSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@
3131
<element name="nthDelete" type="button" selector="#swatch-visual-options-panel table tbody tr:nth-of-type({{var}}) button.delete-option" parameterized="true"/>
3232
<element name="deleteBtn" type="button" selector="#manage-options-panel:nth-of-type({{var}}) button.delete-option" parameterized="true"/>
3333
<element name="manageSwatchSection" type="block" selector='//legend/span[contains(text(),"Manage Swatch (Values of Your Attribute)")]'/>
34+
<element name="visualSwatchDefaultStoreViewBox" type="input" selector="input[name='optionvisual[value][option_{{index}}][1]']" parameterized="true"/>
35+
3436
</section>
3537
</sections>

0 commit comments

Comments
 (0)