AdminDeleteUserActionGroup.xml 2.66 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<?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="AdminDeleteUserActionGroup">
        <arguments>
            <argument name="user"/>
        </arguments>
        <amOnPage stepKey="amOnAdminUsersPage" url="{{AdminUsersPage.url}}"/>
        <waitForPageLoad stepKey="waitForAdminUserPageLoad"/>
        <click stepKey="openTheUser" selector="{{AdminDeleteUserSection.role(user.name)}}"/>
        <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
        <scrollToTopOfPage stepKey="scrollToTop"/>
        <click stepKey="clickToDeleteRole" selector="{{AdminDeleteUserSection.delete}}"/>
        <waitForElementVisible stepKey="wait" selector="{{AdminDeleteRoleSection.confirm}}" time="30"/>
        <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
        <see stepKey="seeDeleteMessageForUser" userInput="You deleted the user."/>
    </actionGroup>
    <actionGroup name="AdminDeleteCustomUserActionGroup">
        <arguments>
            <argument name="user"/>
        </arguments>
        <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUserGrid" />
        <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName" />
        <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch" />
        <waitForPageLoad stepKey="waitForGridToLoad"/>
        <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser" />
        <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/>
        <waitForPageLoad stepKey="waitForUserEditPageLoad"/>
        <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword" />
        <click selector="{{AdminMainActionsSection.delete}}" stepKey="deleteUser"/>
        <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/>
        <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
        <waitForPageLoad stepKey="waitForSave" />
        <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the user." stepKey="seeUserDeleteMessage"/>
    </actionGroup>
</actionGroups>