CatalogPriceRuleActionGroup.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. <!-- action group to create a new catalog price rule giving a catalogRule entity -->
  11. <actionGroup name="newCatalogPriceRuleByUI">
  12. <arguments>
  13. <argument name="catalogRule" defaultValue="_defaultCatalogRule"/>
  14. </arguments>
  15. <!-- Go to the admin Catalog rule grid and add a new one -->
  16. <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
  17. <waitForPageLoad stepKey="waitForPriceRulePage"/>
  18. <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
  19. <!-- Fill the form according the attributes of the entity -->
  20. <fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
  21. <fillField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/>
  22. <selectOption stepKey="selectSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}"/>
  23. <click stepKey="clickFromCalender" selector="{{AdminNewCatalogPriceRule.fromDateButton}}"/>
  24. <click stepKey="clickFromToday" selector="{{AdminNewCatalogPriceRule.todayDate}}"/>
  25. <click stepKey="clickToCalender" selector="{{AdminNewCatalogPriceRule.toDateButton}}"/>
  26. <click stepKey="clickToToday" selector="{{AdminNewCatalogPriceRule.todayDate}}"/>
  27. <click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/>
  28. <selectOption stepKey="discountType" selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}"/>
  29. <fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/>
  30. <selectOption stepKey="discardSubsequentRules" selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="Yes"/>
  31. <!-- Scroll to top and either save or save and apply after the action group -->
  32. <scrollToTopOfPage stepKey="scrollToTop"/>
  33. <waitForPageLoad stepKey="waitForApplied"/>
  34. </actionGroup>
  35. <actionGroup name="createCatalogPriceRule">
  36. <arguments>
  37. <argument name="catalogRule" defaultValue="_defaultCatalogRule"/>
  38. </arguments>
  39. <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
  40. <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName" />
  41. <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" />
  42. <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" />
  43. <click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/>
  44. <fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/>
  45. <scrollToTopOfPage stepKey="scrollToTop"/>
  46. <waitForPageLoad stepKey="waitForApplied"/>
  47. </actionGroup>
  48. <actionGroup name="CreateCatalogPriceRuleConditionWithAttribute">
  49. <arguments>
  50. <argument name="attributeName" type="string"/>
  51. <argument name="targetValue" type="string"/>
  52. <argument name="targetSelectValue" type="string"/>
  53. </arguments>
  54. <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="openConditionsTab"/>
  55. <waitForPageLoad stepKey="waitForConditionTabOpened"/>
  56. <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/>
  57. <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{attributeName}}" stepKey="selectTypeCondition"/>
  58. <waitForElement selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', targetValue)}}" stepKey="waitForIsTarget"/>
  59. <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', 'is')}}" stepKey="clickOnIs"/>
  60. <selectOption selector="{{AdminNewCatalogPriceRuleConditions.targetSelect('1')}}" userInput="{{targetSelectValue}}" stepKey="selectTargetCondition"/>
  61. <click selector="{{AdminNewCatalogPriceRule.fromDateButton}}" stepKey="clickFromCalender"/>
  62. <click selector="{{AdminNewCatalogPriceRule.todayDate}}" stepKey="clickFromToday"/>
  63. </actionGroup>
  64. <!-- Apply all of the saved catalog price rules -->
  65. <actionGroup name="applyCatalogPriceRules">
  66. <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
  67. <waitForPageLoad stepKey="waitForPriceRulePage"/>
  68. <click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/>
  69. <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/>
  70. </actionGroup>
  71. <!--Add Catalog Rule Condition With product SKU-->
  72. <actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="newCatalogPriceRuleByUI">
  73. <arguments>
  74. <argument name="productSku"/>
  75. </arguments>
  76. <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
  77. <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/>
  78. <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/>
  79. <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/>
  80. <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/>
  81. <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/>
  82. <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/>
  83. <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/>
  84. </actionGroup>
  85. <!--Add Catalog Rule Condition With Category-->
  86. <actionGroup name="newCatalogPriceRuleByUIWithConditionIsCategory" extends="newCatalogPriceRuleByUI">
  87. <arguments>
  88. <argument name="categoryId"/>
  89. </arguments>
  90. <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
  91. <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/>
  92. <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/>
  93. <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|category_ids" after="addNewCondition" stepKey="selectTypeCondition"/>
  94. <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/>
  95. <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/>
  96. <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{categoryId}}" after="clickEllipsis" stepKey="fillCategoryId"/>
  97. <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillCategoryId" stepKey="clickApply"/>
  98. </actionGroup>
  99. <actionGroup name="selectGeneralCustomerGroupActionGroup">
  100. <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="General" stepKey="selectCustomerGroup"/>
  101. </actionGroup>
  102. <actionGroup name="selectNotLoggedInCustomerGroupActionGroup">
  103. <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/>
  104. </actionGroup>
  105. </actionGroups>