-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from magento-pangolin/MC-6621
MC-6621 Backport for MC-6447
- Loading branch information
Showing
11 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
app/code/Magento/Customer/Test/Mftf/Section/AdminCreateUserSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminCreateUserSection"> | ||
<element name="system" type="input" selector="#menu-magento-backend-system"/> | ||
<element name="allUsers" type="input" selector="//span[contains(text(), 'All Users')]"/> | ||
<element name="create" type="input" selector="#add"/> | ||
<element name="usernameTextField" type="input" selector="#user_username"/> | ||
<element name="firstNameTextField" type="input" selector="#user_firstname"/> | ||
<element name="lastNameTextField" type="input" selector="#user_lastname"/> | ||
<element name="emailTextField" type="input" selector="#user_email"/> | ||
<element name="passwordTextField" type="input" selector="#user_password"/> | ||
<element name="pwConfirmationTextField" type="input" selector="#user_confirmation"/> | ||
<element name="currentPasswordField" type="input" selector="#user_current_password"/> | ||
<element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/> | ||
<element name="saveButton" type="button" selector="#save"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?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="AdminAddNewUserRoleActionGroup"> | ||
<arguments> | ||
<argument name="role" type="entity"/> | ||
</arguments> | ||
|
||
<!-- Navigate to Roles Page --> | ||
<amOnPage url="{{AdminRolesPage.url}}" stepKey="amOnRolesPage"/> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
|
||
<!-- Click Button "Add New Role" --> | ||
<click selector="{{AdminMainActionsSection.add}}" stepKey="addNewUseRole"/> | ||
<waitForPageLoad stepKey="waitForCreateNewUserRolePageLoad"/> | ||
|
||
<!-- Fill forms "Role info" --> | ||
<fillField userInput="{{role.name}}" selector="{{AdminCreateRoleSection.name}}" stepKey="fillNameUserRole"/> | ||
<fillField userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" selector="{{AdminCreateRoleSection.password}}" stepKey="fillPass"/> | ||
|
||
<!-- Open tab "Role Resources" --> | ||
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickOnTab"/> | ||
<waitForPageLoad stepKey="waitForTabLoaded"/> | ||
|
||
<!-- Select Role Scopes --> | ||
<selectOption userInput="{{role.roleScopes}}" selector="{{AdminCreateRoleSection.roleScopeNew}}" stepKey="selectRoleResources"/> | ||
|
||
<!-- Select Resource Access --> | ||
<selectOption userInput="{{role.resourceAccess}}" selector="{{AdminCreateRoleSection.roleResourceNew}}" stepKey="selectResourceAccess"/> | ||
<click selector="{{AdminCreateRoleSection.save}}" stepKey="saveUserRole"/> | ||
<waitForPageLoad stepKey="waitForSaving"/> | ||
<see userInput="You saved the role." selector="{{AdminMessagesSection.successMessage}}" stepKey="seeMessage"/> | ||
</actionGroup> | ||
|
||
<actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> | ||
<arguments> | ||
<argument name="customWebsiteName" type="string"/> | ||
</arguments> | ||
<checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> | ||
</actionGroup> | ||
</actionGroups> |
32 changes: 32 additions & 0 deletions
32
app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?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"> | ||
<!--Create new user with role--> | ||
<actionGroup name="AdminCreateUserWithRoleActionGroup"> | ||
<arguments> | ||
<argument name="role"/> | ||
<argument name="user" defaultValue="newAdmin"/> | ||
</arguments> | ||
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> | ||
<waitForPageLoad stepKey="waitForUsersPage" /> | ||
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName" /> | ||
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName" /> | ||
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName" /> | ||
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" /> | ||
<fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword" /> | ||
<fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword" /> | ||
<fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" /> | ||
<scrollToTopOfPage stepKey="scrollToTopOfPage" /> | ||
<click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> | ||
<click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> | ||
<click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser" /> | ||
<waitForPageLoad stepKey="waitForSaveTheUser" /> | ||
<see userInput="You saved the user." stepKey="seeSuccessMessage" /> | ||
</actionGroup> | ||
</actionGroups> |
24 changes: 24 additions & 0 deletions
24
app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?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="AdminDeleteCreatedUserActionGroup"> | ||
<arguments> | ||
<argument name="user"/> | ||
</arguments> | ||
<amOnPage stepKey="amOnAdminUsersPage" url="{{AdminUsersPage.url}}"/> | ||
<click stepKey="openTheUser" selector="{{AdminDeleteUserSection.role(user.username)}}"/> | ||
<waitForPageLoad stepKey="waitForSingleUserPageToLoad" /> | ||
<fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> | ||
<scrollToTopOfPage stepKey="scrollToTop"/> | ||
<click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/> | ||
<waitForPageLoad stepKey="waitForConfirmationPopup"/> | ||
<click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> | ||
<see stepKey="seeDeleteMessageForUser" userInput="You deleted the user."/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/code/Magento/User/Test/Mftf/Section/AdminCreateRoleSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminCreateRoleSection"> | ||
<element name="create" type="button" selector="#add"/> | ||
<element name="name" type="button" selector="#role_name"/> | ||
<element name="password" type="input" selector="#current_password"/> | ||
<element name="roleResources" type="button" selector="#role_info_tabs_account"/> | ||
<element name="roleResourceNew" type="button" selector="#all"/> | ||
<element name="roleScopeNew" type="button" selector="#gws_is_all"/> | ||
<element name="selectWebsite" type="checkbox" selector="//label[contains(text(), '{{websiteName}}')]/preceding-sibling::input" parameterized="true"/> | ||
<element name="save" type="button" selector="button.save-role"/> | ||
<element name="roleNameFilterTextField" type="input" selector="#permissionsUserRolesGrid_filter_role_name"/> | ||
<element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> | ||
<element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> | ||
</section> | ||
</sections> |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/User/Test/Mftf/Section/AdminDeleteRoleSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminDeleteRoleSection"> | ||
<element name="theRole" selector="//td[contains(text(), 'Role')]" type="button"/> | ||
<element name="current_pass" type="button" selector="#current_password"/> | ||
<element name="delete" selector="//button/span[contains(text(), 'Delete Role')]" type="button"/> | ||
<element name="confirm" selector=".action-primary.action-accept" type="button"/> | ||
</section> | ||
</sections> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminDeleteUserSection"> | ||
<element name="theUser" selector="//td[contains(text(), 'John')]" type="button"/> | ||
<element name="password" selector="#user_current_password" type="input"/> | ||
<element name="delete" selector="//button/span[contains(text(), 'Delete User')]" type="button"/> | ||
<element name="confirm" selector=".action-primary.action-accept" type="button"/> | ||
<element name="role" parameterized="true" selector="//td[contains(text(), '{{args}}')]" type="button"/> | ||
</section> | ||
</sections> |