AdminConfigurableProductCreateTest.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
  10. <test name="AdminConfigurableProductCreateTest">
  11. <annotations>
  12. <features value="ConfigurableProduct"/>
  13. <stories value="Create, Read, Update, Delete"/>
  14. <title value="admin should be able to create a configurable product with attributes"/>
  15. <description value="admin should be able to create a configurable product with attributes"/>
  16. <severity value="CRITICAL"/>
  17. <testCaseId value="MC-84"/>
  18. <group value="ConfigurableProduct"/>
  19. </annotations>
  20. <before>
  21. <createData entity="ApiCategory" stepKey="createCategory"/>
  22. <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
  23. </before>
  24. <after>
  25. <deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
  26. <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
  27. </after>
  28. <!-- Create a configurable product via the UI -->
  29. <actionGroup ref="createConfigurableProduct" stepKey="createProduct">
  30. <argument name="product" value="_defaultProduct"/>
  31. <argument name="category" value="$$createCategory$$"/>
  32. </actionGroup>
  33. <!-- assert color configurations on the admin create product page -->
  34. <dontSee selector="{{AdminProductFormConfigurationsSection.variationLabel}}" stepKey="seeLabelNotVisible"/>
  35. <seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="3" stepKey="seeNumberOfRows"/>
  36. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeName1InField"/>
  37. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeName2InField"/>
  38. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeName3InField"/>
  39. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeSku1InField"/>
  40. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeSku2InField"/>
  41. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeSku3InField"/>
  42. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute1.price}}" stepKey="seeUniquePrice1InField"/>
  43. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute2.price}}" stepKey="seeUniquePrice2InField"/>
  44. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute3.price}}" stepKey="seeUniquePrice3InField"/>
  45. <see selector="{{AdminProductFormConfigurationsSection.currentVariationsQuantityCells}}" userInput="{{colorProductAttribute.attribute_quantity}}" stepKey="seeQuantityInField"/>
  46. <!-- assert storefront category list page -->
  47. <amOnPage url="/" stepKey="amOnStorefront"/>
  48. <waitForPageLoad stepKey="waitForPageLoad3"/>
  49. <click userInput="$$createCategory.name$$" stepKey="clickOnCategoryName"/>
  50. <waitForPageLoad stepKey="waitForPageLoad4"/>
  51. <see userInput="{{_defaultProduct.name}}" stepKey="assertProductPresent"/>
  52. <see userInput="{{colorProductAttribute1.price}}" stepKey="assertProductPricePresent"/>
  53. <!-- assert storefront product details page -->
  54. <click userInput="{{_defaultProduct.name}}" stepKey="clickOnProductName"/>
  55. <waitForPageLoad stepKey="waitForPageLoad5"/>
  56. <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="assertProductNameTitle"/>
  57. <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
  58. <see userInput="{{colorProductAttribute1.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
  59. <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
  60. <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/>
  61. <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/>
  62. <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/>
  63. <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/>
  64. </test>
  65. <test name="AdminCreateConfigurableProductAfterGettingIncorrectSKUMessageTest">
  66. <annotations>
  67. <features value="ConfigurableProduct"/>
  68. <stories value="Create, Read, Update, Delete"/>
  69. <title value="admin should be able to create a configurable product after incorrect sku"/>
  70. <description value="admin should be able to create a configurable product after incorrect sku"/>
  71. <severity value="MAJOR"/>
  72. <testCaseId value="MAGETWO-96365"/>
  73. <useCaseId value="MAGETWO-94556"/>
  74. <group value="ConfigurableProduct"/>
  75. </annotations>
  76. <before>
  77. <createData entity="ApiCategory" stepKey="createCategory"/>
  78. <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
  79. <requiredEntity createDataKey="createCategory"/>
  80. </createData>
  81. <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
  82. </before>
  83. <after>
  84. <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
  85. <deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
  86. <actionGroup ref="logout" stepKey="logout"/>
  87. </after>
  88. <amOnPage url="{{AdminProductEditPage.url($$createConfigProduct.id$$)}}" stepKey="goToEditPage"/>
  89. <waitForPageLoad stepKey="waitForProductPage"/>
  90. <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/>
  91. <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPane"/>
  92. <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/>
  93. <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="color" stepKey="fillFilterAttributeCodeField"/>
  94. <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/>
  95. <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/>
  96. <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/>
  97. <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/>
  98. <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/>
  99. <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/>
  100. <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/>
  101. <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
  102. <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/>
  103. <waitForPageLoad stepKey="waitForGenerateConfigure"/>
  104. <grabValueFrom selector="{{AdminProductFormConfigurationsSection.firstSKUInConfigurableProductsGrid}}" stepKey="grabTextFromContent"/>
  105. <fillField stepKey="fillMoreThan64Symbols" selector="{{AdminProductFormConfigurationsSection.firstSKUInConfigurableProductsGrid}}" userInput="01234567890123456789012345678901234567890123456789012345678901234"/>
  106. <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct1"/>
  107. <conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.closePopUp}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.closePopUp}}" visible="true" stepKey="clickOnCloseInPopup"/>
  108. <see stepKey="seeErrorMessage" userInput="Please enter less or equal than 64 symbols."/>
  109. <fillField stepKey="fillCorrectSKU" selector="{{AdminProductFormConfigurationsSection.firstSKUInConfigurableProductsGrid}}" userInput="$grabTextFromContent"/>
  110. <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/>
  111. <conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="clickOnConfirmInPopup"/>
  112. <see userInput="You saved the product." stepKey="seeSaveConfirmation"/>
  113. <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/>
  114. <waitForPageLoad stepKey="waitForProductAttributes"/>
  115. <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid1"/>
  116. <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="color" stepKey="fillFilter"/>
  117. <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearch"/>
  118. <click selector="{{AdminProductAttributeGridSection.AttributeCode('color')}}" stepKey="clickRowToEdit"/>
  119. <click selector="{{DropdownAttributeOptionsSection.deleteButton(1)}}" stepKey="deleteOption"/>
  120. <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/>
  121. <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid2"/>
  122. <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku">
  123. <argument name="sku" value="$grabTextFromContent"/>
  124. </actionGroup>
  125. <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
  126. <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/>
  127. <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
  128. </test>
  129. </tests>