|
| 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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminConfigureSwatchesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Swatches"/> |
| 14 | + <stories value="Create/configure swatches"/> |
| 15 | + <title value="Admin can configure swatches display in configuration"/> |
| 16 | + <description value="Admin can configure swatches display in configuration"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-3080"/> |
| 19 | + <group value="Swatches"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <click selector="{{AdminManageSwatchSection.nthDelete('1')}}" stepKey="deleteSwatch1"/> |
| 26 | + <click selector="{{AdminManageSwatchSection.nthDelete('2')}}" stepKey="deleteSwatch2"/> |
| 27 | + <click selector="{{AdminManageSwatchSection.nthDelete('3')}}" stepKey="deleteSwatch3"/> |
| 28 | + <waitForPageLoad stepKey="waitToClickSave2"/> |
| 29 | + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEdit2"/> |
| 30 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 31 | + </after> |
| 32 | + |
| 33 | + <!-- Go to the edit page for the "color" attribute --> |
| 34 | + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> |
| 35 | + <waitForPageLoad stepKey="waitForProductAttributes"/> |
| 36 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="color" stepKey="fillFilter"/> |
| 37 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearch"/> |
| 38 | + <click selector="{{AdminProductAttributeGridSection.AttributeCode('color')}}" stepKey="clickRowToEdit"/> |
| 39 | + |
| 40 | + <!-- Change to visual swatches --> |
| 41 | + <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="swatch_visual" stepKey="selectVisualSwatch"/> |
| 42 | + |
| 43 | + <!-- Set swatch #1 using the color picker --> |
| 44 | + <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> |
| 45 | + <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> |
| 46 | + <argument name="index" value="0"/> |
| 47 | + </actionGroup> |
| 48 | + <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> |
| 49 | + <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> |
| 50 | + <argument name="nthColorPicker" value="1"/> |
| 51 | + <argument name="hexColor" value="e74c3c"/> |
| 52 | + </actionGroup> |
| 53 | + <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillAdmin1"/> |
| 54 | + <!-- Set swatch #2 using the color picker --> |
| 55 | + <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> |
| 56 | + <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> |
| 57 | + <argument name="index" value="1"/> |
| 58 | + </actionGroup> |
| 59 | + <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> |
| 60 | + <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> |
| 61 | + <argument name="nthColorPicker" value="2"/> |
| 62 | + <argument name="hexColor" value="2ecc71"/> |
| 63 | + </actionGroup> |
| 64 | + <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('1')}}" userInput="green" stepKey="fillAdmin2"/> |
| 65 | + <!-- Set swatch #3 using the color picker --> |
| 66 | + <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> |
| 67 | + <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> |
| 68 | + <argument name="index" value="2"/> |
| 69 | + </actionGroup> |
| 70 | + <click selector="{{AdminManageSwatchSection.nthChooseColor('3')}}" stepKey="clickChooseColor3"/> |
| 71 | + <actionGroup ref="setColorPickerByHex" stepKey="fillHex3"> |
| 72 | + <argument name="nthColorPicker" value="3"/> |
| 73 | + <argument name="hexColor" value="3498db"/> |
| 74 | + </actionGroup> |
| 75 | + <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('2')}}" userInput="blue" stepKey="fillAdmin3"/> |
| 76 | + <waitForPageLoad stepKey="waitToClickSave"/> |
| 77 | + |
| 78 | + <!-- Save --> |
| 79 | + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEdit1"/> |
| 80 | + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> |
| 81 | + |
| 82 | + <!-- Assert that the Save was successful after round trip to server --> |
| 83 | + <actionGroup ref="assertSwatchColor" stepKey="assertSwatch1"> |
| 84 | + <argument name="nthSwatch" value="1"/> |
| 85 | + <argument name="expectedStyle" value="background: rgb(231, 77, 60);"/> |
| 86 | + </actionGroup> |
| 87 | + <actionGroup ref="assertSwatchColor" stepKey="assertSwatch2"> |
| 88 | + <argument name="nthSwatch" value="2"/> |
| 89 | + <argument name="expectedStyle" value="background: rgb(46, 204, 112);"/> |
| 90 | + </actionGroup> |
| 91 | + <actionGroup ref="assertSwatchColor" stepKey="assertSwatch3"> |
| 92 | + <argument name="nthSwatch" value="3"/> |
| 93 | + <argument name="expectedStyle" value="background: rgb(52, 152, 219);"/> |
| 94 | + </actionGroup> |
| 95 | + </test> |
| 96 | +</tests> |
0 commit comments