AdminRoleActionGroup.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <actionGroup name="GoToUserRoles">
  11. <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/>
  12. <waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
  13. <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/>
  14. <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/>
  15. </actionGroup>
  16. <!--Create new role-->
  17. <actionGroup name="AdminCreateNewRole">
  18. <arguments>
  19. <argument name="role" type="string" defaultValue=""/>
  20. <argument name="resource" type="string" defaultValue="All"/>
  21. <argument name="scope" type="string" defaultValue="Custom"/>
  22. <argument name="websites" type="string" defaultValue="Main Website"/>
  23. </arguments>
  24. <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/>
  25. <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/>
  26. <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
  27. <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/>
  28. <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/>
  29. <click stepKey="checkSales" selector="//a[text()='Sales']"/>
  30. <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/>
  31. <waitForPageLoad stepKey="waitForPageLoad" time="10"/>
  32. <see userInput="You saved the role." stepKey="seeSuccessMessage" />
  33. </actionGroup>
  34. <!--Delete role-->
  35. <actionGroup name="AdminDeleteRoleActionGroup">
  36. <arguments>
  37. <argument name="role" defaultValue=""/>
  38. </arguments>
  39. <click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/>
  40. <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
  41. <click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/>
  42. <waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/>
  43. <click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/>
  44. <waitForPageLoad stepKey="waitForPageLoad" time="10"/>
  45. <see stepKey="seeSuccessMessage" userInput="You deleted the role."/>
  46. </actionGroup>
  47. </actionGroups>