<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="AdminNavigateToCreatedUserRoleActionGroup">
        <arguments>
            <argument name="userRoleName" type="string"/>
        </arguments>
        <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/>
        <waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
        <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/>
        <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/>
        <fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{userRoleName}}" stepKey="fillRoleNameSearch"/>
        <click selector="{{AdminEditUserSection.searchButton}}" stepKey="clickSearchButtonUserRole"/>
        <waitForPageLoad time="10" stepKey="wait"/>
        <click selector="{{AdminEditUserSection.searchResultFirstRow}}" stepKey="clickFoundRoleName"/>
        <waitForPageLoad time="10" stepKey="waitForRolePage"/>
        <fillField selector="{{AdminEditRoleInfoSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterPassword"/>
        <click selector="{{AdminEditRoleInfoSection.roleResourcesTab}}" stepKey="clickRoleResourcesTab" />
    </actionGroup>
</actionGroups>
