Skip to content

Commit

Permalink
Merge pull request #168 from magento-pangolin/MC-9220
Browse files Browse the repository at this point in the history
MC-9220 Backport for MC-11681
  • Loading branch information
RyanZolper authored Jun 21, 2019
2 parents 6d7cb64 + 052a1a3 commit 9947885
Show file tree
Hide file tree
Showing 10 changed files with 182 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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="AdminClickSearchInGridActionGroup">
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
<waitForPageLoad stepKey="waitForSearchResult"/>
</actionGroup>
</actionGroups>
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFillInputFilterFieldActionGroup">
<arguments>
<argument name="filterInputName" type="string"/>
<argument name="filterValue" type="string"/>
</arguments>
<fillField selector="{{AdminDataGridFilterSection.inputFieldByNameAttrInGrid(filterInputName)}}" userInput="{{filterValue}}" stepKey="fillFilterInputField" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminDataGridFilterSection">
<element name="inputFieldByNameAttrInGrid" type="input" selector="//*[@data-role='filter-form']//input[@name='{{inputNameAttr}}']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminClickSaveButtonOnUserFormActionGroup">
<click selector="{{AdminNewUserFormSection.save}}" stepKey="saveNewUser"/>
<waitForPageLoad stepKey="waitForSaveResultLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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="AdminFillNewUserFormRequiredFieldsActionGroup">
<arguments>
<argument name="user" type="entity"/>
</arguments>
<fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="fillUser"/>
<fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstname}}" stepKey="fillFirstName"/>
<fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastname}}" stepKey="fillLastName"/>
<fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.email}}" stepKey="fillEmail"/>
<fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="fillPassword"/>
<fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password_confirmation}}" stepKey="fillPasswordConfirmation"/>
<fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{user.current_password}}" stepKey="fillCurrentUserPassword"/>
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
<click selector="{{AdminNewUserFormSection.userRoleTab}}" stepKey="openUserRoleTab"/>
<waitForPageLoad stepKey="waitForUserRoleTabOpened" />
<click selector="{{AdminNewUserFormSection.resetFilter}}" stepKey="resetGridFilter" />
<waitForPageLoad stepKey="waitForFiltersReset" />
<fillField userInput="{{user.role}}" selector="{{AdminNewUserFormSection.roleFilterField}}" stepKey="fillRoleFilterField" />
<click selector="{{AdminNewUserFormSection.search}}" stepKey="clickSearchButton" />
<waitForPageLoad stepKey="waitForFiltersApplied" />
<checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminOpenNewUserPageActionGroup">
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="amOnNewAdminUserPage"/>
<waitForPageLoad stepKey="waitForNewAdminUserPageLoad"/>
</actionGroup>
</actionGroups>
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.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertAdminUserSaveMessageActionGroup">
<arguments>
<argument name="message" type="string" defaultValue="You saved the user." />
<argument name="messageType" type="string" defaultValue="success" />
</arguments>
<waitForElementVisible selector="{{AdminUserFormMessagesSection.messageByType(messageType)}}" stepKey="waitForMessage" />
<see userInput="{{message}}" selector="{{AdminUserFormMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" />
</actionGroup>
</actionGroups>
17 changes: 17 additions & 0 deletions app/code/Magento/User/Test/Mftf/Data/UserData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,21 @@
<item>1</item>
</array>
</entity>
<entity name="NewAdminUser" type="user">
<data key="username" unique="suffix">admin</data>
<data key="firstname">John</data>
<data key="lastname">Doe</data>
<data key="email" unique="prefix">admin@example.com</data>
<data key="password">123123q</data>
<data key="password_confirmation">123123q</data>
<data key="interface_local">en_US</data>
<data key="interface_local_label">English (United States)</data>
<data key="is_active">true</data>
<data key="is_active_label">Active</data>
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
<data key="role">Administrators</data>
<array key="roles">
<item>1</item>
</array>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="AdminNewUserFormSection">
<element name="save" type="button" selector=".page-main-actions #save"/>
<element name="username" type="input" selector="#page_tabs_main_section_content input[name='username']"/>
<element name="firstname" type="input" selector="#page_tabs_main_section_content input[name='firstname']"/>
<element name="lastname" type="input" selector="#page_tabs_main_section_content input[name='lastname']"/>
<element name="email" type="input" selector="#page_tabs_main_section_content input[name='email']"/>
<element name="password" type="input" selector="#page_tabs_main_section_content input[name='password']"/>
<element name="passwordConfirmation" type="input" selector="#page_tabs_main_section_content input[name='password_confirmation']"/>
<element name="interfaceLocale" type="select" selector="#page_tabs_main_section_content select[name='interface_locale']"/>
<element name="currentPassword" type="input" selector="#page_tabs_main_section_content input[name='current_password']"/>
<element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/>
<element name="search" type="button" selector="#page_tabs_roles_section_content #permissionsUserRolesGrid [data-action='grid-filter-apply']" />
<element name="resetFilter" type="button" selector="#page_tabs_roles_section_content #permissionsUserRolesGrid [data-action='grid-filter-reset']" />
<element name="roleFilterField" type="input" selector="#page_tabs_roles_section_content #permissionsUserRolesGrid input[name='role_name']" />
<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"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminUserFormMessagesSection">
<element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true" />
</section>
</sections>

0 comments on commit 9947885

Please sign in to comment.