AdminCreateUserActionGroup.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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="AdminCreateUserActionGroup">
  11. <arguments>
  12. <argument name="role"/>
  13. <argument name="User" defaultValue="newAdmin"/>
  14. </arguments>
  15. <amOnPage url="{{AdminUsersPage.url}}" stepKey="amOnAdminUsersPage"/>
  16. <waitForPageLoad stepKey="waitForAdminUserPageLoad"/>
  17. <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/>
  18. <fillField selector="{{AdminEditUserSection.usernameTextField}}" userInput="{{newAdmin.username}}" stepKey="enterUserName" />
  19. <fillField selector="{{AdminEditUserSection.firstNameTextField}}" userInput="{{newAdmin.firstName}}" stepKey="enterFirstName" />
  20. <fillField selector="{{AdminEditUserSection.lastNameTextField}}" userInput="{{newAdmin.lastName}}" stepKey="enterLastName" />
  21. <fillField selector="{{AdminEditUserSection.emailTextField}}" userInput="{{newAdmin.username}}@magento.com" stepKey="enterEmail" />
  22. <fillField selector="{{AdminEditUserSection.passwordTextField}}" userInput="{{newAdmin.password}}" stepKey="enterPassword" />
  23. <fillField selector="{{AdminEditUserSection.pwConfirmationTextField}}" userInput="{{newAdmin.password}}" stepKey="confirmPassword" />
  24. <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
  25. <scrollToTopOfPage stepKey="scrollToTopOfPage" />
  26. <click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="clickUserRole" />
  27. <fillField selector="{{AdminEditUserSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole" />
  28. <click selector="{{AdminEditUserSection.searchButton}}" stepKey="clickSearch" />
  29. <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
  30. <click selector="{{AdminEditUserSection.searchResultFirstRow}}" stepKey="selectRole" />
  31. <click selector="{{AdminEditUserSection.saveButton}}" stepKey="clickSaveUser" />
  32. <waitForPageLoad stepKey="waitForPageLoad2" />
  33. <see userInput="You saved the user." stepKey="seeSuccessMessage" />
  34. </actionGroup>
  35. <!--Create new user with role-->
  36. <actionGroup name="AdminCreateUserWithRoleActionGroup">
  37. <arguments>
  38. <argument name="role"/>
  39. <argument name="user" defaultValue="newAdmin"/>
  40. </arguments>
  41. <amOnPage url="{{AdminEditUserPage.url}}" stepKey="navigateToNewUser"/>
  42. <waitForPageLoad stepKey="waitForUsersPage" />
  43. <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName" />
  44. <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName" />
  45. <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName" />
  46. <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" />
  47. <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword" />
  48. <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword" />
  49. <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
  50. <scrollToTopOfPage stepKey="scrollToTopOfPage" />
  51. <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/>
  52. <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/>
  53. <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser" />
  54. <waitForPageLoad stepKey="waitForSaveTheUser" />
  55. <see userInput="You saved the user." stepKey="seeSuccessMessage" />
  56. </actionGroup>
  57. </actionGroups>