|
| 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="AdminCheckValidatorConfigurableProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="ConfigurableProduct"/> |
| 14 | + <title value="Check that validator works correctly when creating Configurations for Configurable Products"/> |
| 15 | + <description value="Verify validator works correctly for Configurable Products"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MAGETWO-95995"/> |
| 18 | + <useCaseId value="MAGETWO-95834"/> |
| 19 | + <group value="ConfigurableProduct"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <!--Login as admin--> |
| 24 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 25 | + <!--Create Category--> |
| 26 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 27 | + <!--Create Configurable product--> |
| 28 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 29 | + <requiredEntity createDataKey="createCategory"/> |
| 30 | + </createData> |
| 31 | + </before> |
| 32 | + |
| 33 | + <after> |
| 34 | + <!--Delete created data--> |
| 35 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 36 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 37 | + <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> |
| 38 | + <argument name="sku" value="{{ApiConfigurableProduct.name}}-thisIsShortName"/> |
| 39 | + </actionGroup> |
| 40 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" |
| 41 | + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> |
| 42 | + <!-- Remove attribute --> |
| 43 | + <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> |
| 44 | + <argument name="ProductAttribute" value="productDropDownAttribute"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="logout" stepKey="logout"/> |
| 47 | + </after> |
| 48 | + |
| 49 | + <!-- Find the product that we just created using the product grid --> |
| 50 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> |
| 51 | + <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> |
| 52 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" |
| 53 | + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> |
| 54 | + <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> |
| 55 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 56 | + </actionGroup> |
| 57 | + <waitForPageLoad stepKey="waitForProductFilterLoad"/> |
| 58 | + <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/> |
| 59 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 60 | + |
| 61 | + <!-- Create configurations based off the Text Swatch we created earlier --> |
| 62 | + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> |
| 63 | + |
| 64 | + <!--Create new attribute--> |
| 65 | + <waitForElementVisible stepKey="waitForNewAttributePageOpened" selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}"/> |
| 66 | + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute" after="waitForNewAttributePageOpened"/> |
| 67 | + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="enterAttributePanelIFrame" after="clickCreateNewAttribute"/> |
| 68 | + <waitForElementVisible selector="{{AdminNewAttributePanel.defaultLabel}}" time="30" stepKey="waitForIframeLoad" after="enterAttributePanelIFrame"/> |
| 69 | + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel" after="waitForIframeLoad"/> |
| 70 | + <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="{{colorProductAttribute.input_type}}" stepKey="selectAttributeInputType" after="fillDefaultLabel"/> |
| 71 | + <!--Add option to attribute--> |
| 72 | + <click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickAddOption1" after="selectAttributeInputType"/> |
| 73 | + <waitForElementVisible selector="{{AdminNewAttributePanel.isDefault('1')}}" time="30" stepKey="waitForOptionRow1" after="clickAddOption1"/> |
| 74 | + <fillField selector="{{AdminNewAttributePanel.optionAdminValue('0')}}" userInput="ThisIsLongNameNameLengthMoreThanSixtyFourThisIsLongNameNameLength" stepKey="fillAdminLabel1" after="waitForOptionRow1"/> |
| 75 | + <fillField selector="{{AdminNewAttributePanel.optionDefaultStoreValue('0')}}" userInput="{{colorProductAttribute1.name}}" stepKey="fillDefaultLabel1" after="fillAdminLabel1"/> |
| 76 | + |
| 77 | + <!--Save attribute--> |
| 78 | + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> |
| 79 | + <waitForPageLoad stepKey="waitForSaveAttribute"/> |
| 80 | + <switchToIFrame stepKey="switchOutOfIFrame"/> |
| 81 | + |
| 82 | + <!--Find attribute in grid and select--> |
| 83 | + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> |
| 84 | + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> |
| 85 | + <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillFilterAttributeCodeField"/> |
| 86 | + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> |
| 87 | + <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> |
| 88 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> |
| 89 | + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(productDropDownAttribute.attribute_code)}}" stepKey="waitForNextPageOpened"/> |
| 90 | + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(productDropDownAttribute.attribute_code)}}" stepKey="clickSelectAll"/> |
| 91 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/> |
| 92 | + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="waitForNextPageOpened2"/> |
| 93 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSkus"/> |
| 94 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="10" stepKey="enterAttributePrice"/> |
| 95 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> |
| 96 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> |
| 97 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/> |
| 98 | + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextPageOpened3"/> |
| 99 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> |
| 100 | + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveButtonVisible"/> |
| 101 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> |
| 102 | + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitForPopUpVisible"/> |
| 103 | + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> |
| 104 | + <dontSeeElement selector="{{AdminMessagesSection.success}}" stepKey="dontSeeSaveProductMessage"/> |
| 105 | + |
| 106 | + <!--Close modal window--> |
| 107 | + <click selector="{{AdminChooseAffectedAttributeSetPopup.closePopUp}}" stepKey="clickOnClosePopup"/> |
| 108 | + <waitForElementNotVisible selector="{{AdminChooseAffectedAttributeSetPopup.closePopUp}}" stepKey="waitForDialogClosed"/> |
| 109 | + |
| 110 | + <!--See that validation message is shown under the fields--> |
| 111 | + <scrollTo selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" stepKey="scrollTConfigurationTab"/> |
| 112 | + <see userInput="Please enter less or equal than 64 symbols." selector="{{AdminProductFormConfigurationsSection.confProductSkuMessage('0')}}" stepKey="SeeValidationMessage"/> |
| 113 | + |
| 114 | + <!--Edit "SKU" with valid quantity--> |
| 115 | + <fillField stepKey="fillValidValue" selector="{{AdminProductFormConfigurationsSection.confProductSku('0')}}" userInput="{{ApiConfigurableProduct.name}}-thisIsShortName"/> |
| 116 | + |
| 117 | + <!--Click on "Save"--> |
| 118 | + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> |
| 119 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> |
| 120 | + |
| 121 | + <!--Click on "Confirm". Product is saved, success message appears --> |
| 122 | + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> |
| 123 | + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> |
| 124 | + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> |
| 125 | + </test> |
| 126 | +</tests> |
0 commit comments