|
| 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="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminDisablingSwatchTooltipsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Swatches"/> |
| 14 | + <title value="Admin disabling swatch tooltips test."/> |
| 15 | + <description value="Verify possibility to disable/enable swatch tooltips."/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <group value="Swatches"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Create category --> |
| 21 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 22 | + |
| 23 | + <!-- Log in --> |
| 24 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 25 | + </before> |
| 26 | + <after> |
| 27 | + <!-- Clean up our modifications to the existing color attribute --> |
| 28 | + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> |
| 29 | + <waitForPageLoad stepKey="waitForProductAttributes"/> |
| 30 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="color" |
| 31 | + stepKey="fillFilter"/> |
| 32 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearch"/> |
| 33 | + <click selector="{{AdminProductAttributeGridSection.AttributeCode('color')}}" stepKey="clickRowToEdit"/> |
| 34 | + <click selector="{{AdminManageSwatchSection.nthDelete('1')}}" stepKey="deleteSwatch1"/> |
| 35 | + <waitForPageLoad stepKey="waitToClickSave"/> |
| 36 | + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEdit"/> |
| 37 | + |
| 38 | + <!-- Log out --> |
| 39 | + <actionGroup ref="logout" stepKey="logOut"/> |
| 40 | + |
| 41 | + <!-- Delete category --> |
| 42 | + <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> |
| 43 | + |
| 44 | + <!-- Enable swatch tooltips --> |
| 45 | + <magentoCLI command="config:set catalog/frontend/show_swatch_tooltip 1" stepKey="disableTooltips"/> |
| 46 | + <magentoCLI command="cache:flush" stepKey="flushCacheAfterEnabling"/> |
| 47 | + </after> |
| 48 | + |
| 49 | + <!-- Go to the edit page for the "color" attribute --> |
| 50 | + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> |
| 51 | + <waitForPageLoad stepKey="waitForProductAttributes"/> |
| 52 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="color" |
| 53 | + stepKey="fillFilter"/> |
| 54 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearch"/> |
| 55 | + <click selector="{{AdminProductAttributeGridSection.AttributeCode('color')}}" stepKey="clickRowToEdit"/> |
| 56 | + |
| 57 | + <!-- Change to visual swatches --> |
| 58 | + <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="swatch_visual" |
| 59 | + stepKey="selectVisualSwatch"/> |
| 60 | + |
| 61 | + <!-- Set swatch using the color picker --> |
| 62 | + <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> |
| 63 | + <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> |
| 64 | + <argument name="index" value="0"/> |
| 65 | + </actionGroup> |
| 66 | + <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> |
| 67 | + <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> |
| 68 | + <argument name="nthColorPicker" value="1"/> |
| 69 | + <argument name="hexColor" value="e74c3c"/> |
| 70 | + </actionGroup> |
| 71 | + <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillAdmin1"/> |
| 72 | + <waitForPageLoad stepKey="waitToClickSave"/> |
| 73 | + |
| 74 | + <!-- Save --> |
| 75 | + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEdit1"/> |
| 76 | + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> |
| 77 | + |
| 78 | + <!-- Assert that the Save was successful after round trip to server --> |
| 79 | + <actionGroup ref="assertSwatchColor" stepKey="assertSwatchAdmin"> |
| 80 | + <argument name="nthSwatch" value="1"/> |
| 81 | + <argument name="expectedStyle" value="background: rgb(231, 77, 60);"/> |
| 82 | + </actionGroup> |
| 83 | + |
| 84 | + <!-- Create a configurable product to verify the storefront with --> |
| 85 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> |
| 86 | + <waitForPageLoad stepKey="waitForProductGridPage"/> |
| 87 | + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> |
| 88 | + <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" |
| 89 | + stepKey="clickOnAddConfigurableProduct"/> |
| 90 | + <fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" |
| 91 | + stepKey="fillName"/> |
| 92 | + <fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" |
| 93 | + stepKey="fillSKU"/> |
| 94 | + <fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" |
| 95 | + stepKey="fillPrice"/> |
| 96 | + <fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" |
| 97 | + stepKey="fillQuantity"/> |
| 98 | + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" |
| 99 | + parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> |
| 100 | + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> |
| 101 | + <fillField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" |
| 102 | + stepKey="fillUrlKey"/> |
| 103 | + |
| 104 | + <!-- Create configurations based on the Swatch we created earlier --> |
| 105 | + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" |
| 106 | + stepKey="clickCreateConfigurations"/> |
| 107 | + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> |
| 108 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="color" |
| 109 | + stepKey="fillFilterAttributeCodeField"/> |
| 110 | + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> |
| 111 | + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> |
| 112 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> |
| 113 | + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> |
| 114 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> |
| 115 | + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" |
| 116 | + stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> |
| 117 | + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="Color" |
| 118 | + stepKey="selectAttributes"/> |
| 119 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="10" |
| 120 | + stepKey="fillAttributePrice1"/> |
| 121 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" |
| 122 | + stepKey="clickOnApplySingleQuantityToEachSku"/> |
| 123 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" |
| 124 | + stepKey="enterAttributeQuantity"/> |
| 125 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> |
| 126 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> |
| 127 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> |
| 128 | + <conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" |
| 129 | + dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" |
| 130 | + stepKey="clickOnConfirmInPopup"/> |
| 131 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> |
| 132 | + <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitle"/> |
| 133 | + |
| 134 | + <!-- Go to the product page and see swatch options --> |
| 135 | + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnProductPage"/> |
| 136 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 137 | + |
| 138 | + <!-- Verify that the storefront shows the swatches too --> |
| 139 | + <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatchStorefront"> |
| 140 | + <argument name="nthSwatch" value="1"/> |
| 141 | + <argument name="expectedRgb" value="rgb(231, 77, 60)"/> |
| 142 | + </actionGroup> |
| 143 | + |
| 144 | + <!-- Verify swatch tooltips are visible--> |
| 145 | + <moveMouseOver selector="{{StorefrontProductInfoMainSection.nthSwatchOption('1')}}" stepKey="hoverEnabledSwatch"/> |
| 146 | + <wait time="1" stepKey="waitForTooltip1"/> |
| 147 | + <seeElement selector="{{StorefrontProductInfoMainSection.swatchOptionTooltip}}" stepKey="swatchTooltipVisible"/> |
| 148 | + |
| 149 | + <!-- Disable swatch tooltips --> |
| 150 | + <magentoCLI command="config:set catalog/frontend/show_swatch_tooltip 0" stepKey="disableTooltips"/> |
| 151 | + <magentoCLI command="cache:flush" stepKey="flushCacheAfterDisabling"/> |
| 152 | + |
| 153 | + <!-- Verify swatch tooltips are not visible --> |
| 154 | + <reloadPage stepKey="refreshPage"/> |
| 155 | + <waitForPageLoad stepKey="waitForPageReload"/> |
| 156 | + <moveMouseOver selector="{{StorefrontProductInfoMainSection.nthSwatchOption('1')}}" stepKey="hoverDisabledSwatch"/> |
| 157 | + <wait time="1" stepKey="waitForTooltip2"/> |
| 158 | + <dontSeeElement selector="{{StorefrontProductInfoMainSection.swatchOptionTooltip}}" stepKey="swatchTooltipNotVisible"/> |
| 159 | + </test> |
| 160 | +</tests> |
0 commit comments