|
| 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 | + <click selector="{{AdminManageSwatchSection.visualSwatchDefaultStoreViewBox('0')}}" stepKey="clickOutsideToDisableDropDown"/> |
| 33 | + <!-- Set swatch image #2 --> |
| 34 | + <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> |
| 35 | + <executeJS function="jQuery('#swatch_window_option_option_1').click()" stepKey="clickSwatch2"/> |
| 36 | + <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> |
| 37 | + <attachFile selector="input[name='datafile']" userInput="adobe-small.jpg" stepKey="attachFile2"/> |
| 38 | + <waitForElementNotVisible selector="{{AdminManageSwatchSection.swatchWindowUnavailable('1')}}" stepKey="waitForImageUploaded2"/> |
| 39 | + <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('1')}}" userInput="visualSwatchOption2" stepKey="fillAdmin2"/> |
| 40 | + <fillField selector="{{AdminManageSwatchSection.visualSwatchDefaultStoreViewBox('1')}}" userInput="visualSwatchOption2" stepKey="fillSwatchDefaultStoreViewBox2"/> |
| 41 | + <click selector="{{AdminManageSwatchSection.swatchWindow('1')}}" stepKey="clicksWatchWindow2"/> |
| 42 | + <!-- Set scope --> |
| 43 | + <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> |
| 44 | + <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/> |
| 45 | + <scrollToTopOfPage stepKey="scrollToTabs"/> |
| 46 | + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> |
| 47 | + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/> |
| 48 | + <selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="Yes" stepKey="useInProductListing"/> |
| 49 | + <!-- Set Use In Layered Navigation --> |
| 50 | + <scrollToTopOfPage stepKey="scrollToTop2"/> |
| 51 | + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontProperties"/> |
| 52 | + <selectOption selector="{{AttributePropertiesSection.useInLayeredNavigation}}" userInput="1" stepKey="selectUseInLayeredNavigation"/> |
| 53 | + <!-- Save the new product attribute --> |
| 54 | + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAndEdit"/> |
| 55 | + <wait stepKey="waitToLoad" time="3"/> |
| 56 | + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> |
| 57 | + </actionGroup> |
| 58 | +</actionGroups> |
0 commit comments