Skip to content

Commit 9947885

Browse files
authored
Merge pull request #168 from magento-pangolin/MC-9220
MC-9220 Backport for MC-11681
2 parents 6d7cb64 + 052a1a3 commit 9947885

10 files changed

+182
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickSearchInGridActionGroup">
12+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
13+
<waitForPageLoad stepKey="waitForSearchResult"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillInputFilterFieldActionGroup">
12+
<arguments>
13+
<argument name="filterInputName" type="string"/>
14+
<argument name="filterValue" type="string"/>
15+
</arguments>
16+
<fillField selector="{{AdminDataGridFilterSection.inputFieldByNameAttrInGrid(filterInputName)}}" userInput="{{filterValue}}" stepKey="fillFilterInputField" />
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminDataGridFilterSection">
12+
<element name="inputFieldByNameAttrInGrid" type="input" selector="//*[@data-role='filter-form']//input[@name='{{inputNameAttr}}']" parameterized="true"/>
13+
</section>
14+
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AdminClickSaveButtonOnUserFormActionGroup">
11+
<click selector="{{AdminNewUserFormSection.save}}" stepKey="saveNewUser"/>
12+
<waitForPageLoad stepKey="waitForSaveResultLoad"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="AdminFillNewUserFormRequiredFieldsActionGroup">
11+
<arguments>
12+
<argument name="user" type="entity"/>
13+
</arguments>
14+
<fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="fillUser"/>
15+
<fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstname}}" stepKey="fillFirstName"/>
16+
<fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastname}}" stepKey="fillLastName"/>
17+
<fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.email}}" stepKey="fillEmail"/>
18+
<fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="fillPassword"/>
19+
<fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password_confirmation}}" stepKey="fillPasswordConfirmation"/>
20+
<fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{user.current_password}}" stepKey="fillCurrentUserPassword"/>
21+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
22+
<click selector="{{AdminNewUserFormSection.userRoleTab}}" stepKey="openUserRoleTab"/>
23+
<waitForPageLoad stepKey="waitForUserRoleTabOpened" />
24+
<click selector="{{AdminNewUserFormSection.resetFilter}}" stepKey="resetGridFilter" />
25+
<waitForPageLoad stepKey="waitForFiltersReset" />
26+
<fillField userInput="{{user.role}}" selector="{{AdminNewUserFormSection.roleFilterField}}" stepKey="fillRoleFilterField" />
27+
<click selector="{{AdminNewUserFormSection.search}}" stepKey="clickSearchButton" />
28+
<waitForPageLoad stepKey="waitForFiltersApplied" />
29+
<checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/>
30+
</actionGroup>
31+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AdminOpenNewUserPageActionGroup">
11+
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="amOnNewAdminUserPage"/>
12+
<waitForPageLoad stepKey="waitForNewAdminUserPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AssertAdminUserSaveMessageActionGroup">
11+
<arguments>
12+
<argument name="message" type="string" defaultValue="You saved the user." />
13+
<argument name="messageType" type="string" defaultValue="success" />
14+
</arguments>
15+
<waitForElementVisible selector="{{AdminUserFormMessagesSection.messageByType(messageType)}}" stepKey="waitForMessage" />
16+
<see userInput="{{message}}" selector="{{AdminUserFormMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" />
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/User/Test/Mftf/Data/UserData.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,21 @@
4141
<item>1</item>
4242
</array>
4343
</entity>
44+
<entity name="NewAdminUser" type="user">
45+
<data key="username" unique="suffix">admin</data>
46+
<data key="firstname">John</data>
47+
<data key="lastname">Doe</data>
48+
<data key="email" unique="prefix">[email protected]</data>
49+
<data key="password">123123q</data>
50+
<data key="password_confirmation">123123q</data>
51+
<data key="interface_local">en_US</data>
52+
<data key="interface_local_label">English (United States)</data>
53+
<data key="is_active">true</data>
54+
<data key="is_active_label">Active</data>
55+
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
56+
<data key="role">Administrators</data>
57+
<array key="roles">
58+
<item>1</item>
59+
</array>
60+
</entity>
4461
</entities>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminNewUserFormSection">
12+
<element name="save" type="button" selector=".page-main-actions #save"/>
13+
<element name="username" type="input" selector="#page_tabs_main_section_content input[name='username']"/>
14+
<element name="firstname" type="input" selector="#page_tabs_main_section_content input[name='firstname']"/>
15+
<element name="lastname" type="input" selector="#page_tabs_main_section_content input[name='lastname']"/>
16+
<element name="email" type="input" selector="#page_tabs_main_section_content input[name='email']"/>
17+
<element name="password" type="input" selector="#page_tabs_main_section_content input[name='password']"/>
18+
<element name="passwordConfirmation" type="input" selector="#page_tabs_main_section_content input[name='password_confirmation']"/>
19+
<element name="interfaceLocale" type="select" selector="#page_tabs_main_section_content select[name='interface_locale']"/>
20+
<element name="currentPassword" type="input" selector="#page_tabs_main_section_content input[name='current_password']"/>
21+
<element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/>
22+
<element name="search" type="button" selector="#page_tabs_roles_section_content #permissionsUserRolesGrid [data-action='grid-filter-apply']" />
23+
<element name="resetFilter" type="button" selector="#page_tabs_roles_section_content #permissionsUserRolesGrid [data-action='grid-filter-reset']" />
24+
<element name="roleFilterField" type="input" selector="#page_tabs_roles_section_content #permissionsUserRolesGrid input[name='role_name']" />
25+
<element name="roleRadiobutton" type="radio" selector="//table[@id='permissionsUserRolesGrid_table']//tr[./td[contains(@class, 'col-role_name') and contains(., '{{roleName}}')]]//input[@name='roles[]']" parameterized="true"/>
26+
</section>
27+
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminUserFormMessagesSection">
12+
<element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true" />
13+
</section>
14+
</sections>

0 commit comments

Comments
 (0)