AdminBundleProductActionGroup.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
  10. <!--Fill main fields in create product form-->
  11. <actionGroup name="fillMainBundleProductForm">
  12. <arguments>
  13. <argument name="product" defaultValue="BundleProduct"/>
  14. </arguments>
  15. <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/>
  16. <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/>
  17. <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/>
  18. </actionGroup>
  19. <!--Check that required fields are actually required-->
  20. <actionGroup name="checkRequiredFieldsInBundleProductForm">
  21. <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/>
  22. <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/>
  23. <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
  24. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/>
  25. <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/>
  26. <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/>
  27. </actionGroup>
  28. <!--Filter product grid and see expected product-->
  29. <actionGroup name="viewBundleProductInAdminGrid">
  30. <arguments>
  31. <argument name="product" defaultValue="BundleProduct"/>
  32. <argument name="thumbnail" defaultValue="ProductPlaceholderImage"/>
  33. </arguments>
  34. <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
  35. <waitForPageLoad stepKey="waitForPageLoadInitial"/>
  36. <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
  37. <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
  38. <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/>
  39. <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
  40. <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/>
  41. <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
  42. <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/>
  43. <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
  44. </actionGroup>
  45. </actionGroups>