|
| 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="AdminConfigurableProductLongSkuTest"> |
| 12 | + <annotations> |
| 13 | + <features value="ConfigurableProduct"/> |
| 14 | + <stories value="Create configurable product"/> |
| 15 | + <title value="Admin is able to create an product with a long sku below that is below the character limit"/> |
| 16 | + <description value="Try to create a product with sku slightly less than char limit. Get client side SKU length error for child products. Correct SKUs and save product succeeds."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-5685"/> |
| 19 | + <group value="ConfigurableProduct"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <!--Create product attribute with options--> |
| 24 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 25 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 26 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 27 | + </createData> |
| 28 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 29 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 30 | + </createData> |
| 31 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 32 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 33 | + </createData> |
| 34 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 35 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 36 | + </getData> |
| 37 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + </getData> |
| 40 | + <!--Create Category--> |
| 41 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 42 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
| 43 | + </before> |
| 44 | + |
| 45 | + <after> |
| 46 | + <!--Clean up products--> |
| 47 | + <actionGroup ref="deleteProductByName" stepKey="cleanUpProducts"> |
| 48 | + <argument name="sku" value="{{ProductWithLongNameSku.sku}}"/> |
| 49 | + <argument name="name" value="{{ProductWithLongNameSku.name}}"/> |
| 50 | + </actionGroup> |
| 51 | + <!--Clean up attribute--> |
| 52 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 53 | + <!--Clean up category--> |
| 54 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 55 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <!--Create a configurable product with long name and sku--> |
| 59 | + <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'configurable')}}" stepKey="goToProductCreatePage"/> |
| 60 | + <waitForPageLoad stepKey="waitForProductCreatePage"/> |
| 61 | + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{ProductWithLongNameSku.name}}" stepKey="fillProductName"/> |
| 62 | + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{ProductWithLongNameSku.sku}}" stepKey="fillProductSku"/> |
| 63 | + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{ProductWithLongNameSku.price}}" stepKey="fillProductPrice"/> |
| 64 | + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="selectCategory"/> |
| 65 | + <!--Setup configurations--> |
| 66 | + <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurations"> |
| 67 | + <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <!--See SKU length errors in Current Variations grid--> |
| 71 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductFail"/> |
| 72 | + <seeInCurrentUrl url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'configurable')}}" stepKey="seeRemainOnCreateProductPage"/> |
| 73 | + <see selector="{{AdminProductFormConfigurationsSection.variationsSkuInputErrorByRow('1')}}" userInput="Please enter less or equal than 64 symbols." stepKey="seeSkuTooLongError1"/> |
| 74 | + <see selector="{{AdminProductFormConfigurationsSection.variationsSkuInputErrorByRow('2')}}" userInput="Please enter less or equal than 64 symbols." stepKey="seeSkuTooLongError2"/> |
| 75 | + <!--Fix SKU lengths--> |
| 76 | + <fillField selector="{{AdminProductFormConfigurationsSection.variationsSkuInputByRow('1')}}" userInput="LongSku-$$getConfigAttributeOption1.label$$" stepKey="fixConfigurationSku1"/> |
| 77 | + <fillField selector="{{AdminProductFormConfigurationsSection.variationsSkuInputByRow('2')}}" userInput="LongSku-$$getConfigAttributeOption2.label$$" stepKey="fixConfigurationSku2"/> |
| 78 | + <!--Save product successfully--> |
| 79 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductSuccess"/> |
| 80 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> |
| 81 | + |
| 82 | + <!--Assert configurations on the product edit pag--> |
| 83 | + <seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="2" stepKey="seeNumberOfRows"/> |
| 84 | + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{ProductWithLongNameSku.name}}-$$getConfigAttributeOption1.label$$" stepKey="seeChildProductName1"/> |
| 85 | + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{ProductWithLongNameSku.name}}-$$getConfigAttributeOption2.label$$" stepKey="seeChildProductName2"/> |
| 86 | + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="LongSku-$$getConfigAttributeOption1.label$$" stepKey="seeChildProductSku1"/> |
| 87 | + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="LongSku-$$getConfigAttributeOption2.label$$" stepKey="seeChildProductSku2"/> |
| 88 | + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{ProductWithLongNameSku.price}}" stepKey="seeConfigurationsPrice"/> |
| 89 | + |
| 90 | + <!--Assert storefront category list page--> |
| 91 | + <amOnPage url="/" stepKey="amOnStorefront"/> |
| 92 | + <waitForPageLoad stepKey="waitForStorefrontLoad"/> |
| 93 | + <click userInput="$$createCategory.name$$" stepKey="clickOnCategoryName"/> |
| 94 | + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> |
| 95 | + <see userInput="{{ProductWithLongNameSku.name}}" stepKey="assertProductPresent"/> |
| 96 | + <see userInput="{{ProductWithLongNameSku.price}}" stepKey="assertProductPricePresent"/> |
| 97 | + |
| 98 | + <!--Assert storefront product details page--> |
| 99 | + <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(ProductWithLongNameSku.name)}}" stepKey="clickOnProductName"/> |
| 100 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 101 | + <seeInTitle userInput="{{ProductWithLongNameSku.name}}" stepKey="assertProductNameTitle"/> |
| 102 | + <see userInput="{{ProductWithLongNameSku.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> |
| 103 | + <see userInput="{{ProductWithLongNameSku.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> |
| 104 | + <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_frontend_label$$" stepKey="seeColorAttributeName1"/> |
| 105 | + <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeInDropDown1"/> |
| 106 | + <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="seeInDropDown2"/> |
| 107 | + </test> |
| 108 | +</tests> |
0 commit comments