Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
MQE-1889: [MTF-To-MFTF] Process PR #717
Browse files Browse the repository at this point in the history
- Reverted BIC actiongroup change
- Changed actionGroup to extend existing
- Moved test materials from incorrect modules back into correct module
- added cleanup steps
  • Loading branch information
KevinBKozan committed Nov 13, 2019
1 parent d32285c commit da4f432
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<!--Create new user with role-->
<actionGroup name="AdminCreateUserWithRoleActionGroup">
<arguments>
<argument name="role"/>
<argument name="user" defaultValue="newAdmin"/>
</arguments>
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/>
Expand All @@ -49,32 +50,9 @@
<fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
<scrollToTopOfPage stepKey="scrollToTopOfPage" />
<click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/>
<checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/>
<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>

<!--Create new user with role and active/inactive setting-->
<actionGroup name="AdminCreateUserWithRoleAndIsActiveActionGroup">
<arguments>
<argument name="user" defaultValue="newAdmin"/>
</arguments>
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/>
<waitForPageLoad stepKey="waitForUsersPage" />
<fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="enterUserName" />
<fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstName}}" stepKey="enterFirstName" />
<fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastName}}" stepKey="enterLastName" />
<fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" />
<fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="enterPassword" />
<fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password}}" stepKey="confirmPassword" />
<checkOption selector="{{AdminNewUserFormSection.userIsActive(user.is_active)}}" stepKey="checkIsActive" />
<fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
<scrollToTopOfPage stepKey="scrollToTopOfPage" />
<click stepKey="clickUserRole" selector="{{AdminNewUserFormSection.userRoleTab}}"/>
<checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/>
<click selector="{{AdminNewUserFormSection.save}}" stepKey="clickSaveUser" />
<waitForPageLoad stepKey="waitForSaveTheUser" />
<see userInput="You saved the user." stepKey="seeSuccessMessage" />
</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">
<!--Create new user with role and active setting-->
<actionGroup name="AdminCreateUserWithRoleAndIsActiveActionGroup" extends="AdminCreateUserWithRoleActionGroup">
<checkOption selector="{{AdminNewUserFormSection.userIsActive(user.is_active)}}" stepKey="checkIsActive" after="confirmPassword"/>
</actionGroup>
</actionGroups>
32 changes: 4 additions & 28 deletions app/code/Magento/User/Test/Mftf/Data/UserData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,12 @@
<item>1</item>
</array>
</entity>
<entity name="activeAdmin" type="user">
<data key="username" unique="suffix">AdminUser</data>
<data key="firstname" unique="suffix">FirstName</data>
<data key="lastname" unique="suffix">LastName</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>
<entity name="activeAdmin" type="user" extends="NewAdminUser">
<data key="name" unique="suffix">admin</data>
<data key="is_active">1</data>
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
<data key="role">Administrators</data>
<array key="roles">
<item>1</item>
</array>
</entity>
<entity name="inactiveAdmin" type="user">
<data key="username" unique="suffix">AdminUser</data>
<data key="firstname" unique="suffix">FirstName</data>
<data key="lastname" unique="suffix">LastName</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>
<entity name="inactiveAdmin" type="user" extends="NewAdminUser">
<data key="name" unique="suffix">admin</data>
<data key="is_active">0</data>
<data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data>
<data key="role">Administrators</data>
<array key="roles">
<item>1</item>
</array>
</entity>
</entities>
4 changes: 4 additions & 0 deletions app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
<data key="resourceAccess">Custom</data>
<data key="resources">['Magento_Sales::sales','Magento_Sales::sales_operation','Magento_Sales::actions','Magento_Sales::sales_order','Magento_Sales::create','Magento_Sales::actions_view','Magento_Sales::email','Magento_Sales::reorder','Magento_Sales::actions_edit','Magento_Sales::cancel','Magento_Sales::review_payment','Magento_Sales::capture','Magento_Sales::invoice','Magento_Sales::creditmemo','Magento_Sales::hold','Magento_Sales::unhold','Magento_Sales::ship','Magento_Sales::comment','Magento_Sales::emails','Magento_Backend::system','Magento_Backend::system_other_settings','Magento_AdminNotification::adminnotification','Magento_AdminNotification::show_list']</data>
</entity>

<entity name="genericAdminRole" type="role">
<data key="name">Administrators</data>
</entity>
</entities>
17 changes: 17 additions & 0 deletions app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml
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="AdminDeleteUserSection">
<element name="role" parameterized="true" selector="//td[contains(text(), '{{roleName}}')]" 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"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<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="userIsActive" type="select" selector="#page_tabs_main_section_content select[id='user_is_active'] > option[value='{{var}}']" parameterized="true"/>
<element name="userIsActive" type="select" selector="#page_tabs_main_section_content select[id='user_is_active'] > option[value='{{isActive}}']" parameterized="true"/>
<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"/>
Expand Down
13 changes: 13 additions & 0 deletions app/code/Magento/User/Test/Mftf/Section/AdminStoreSection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?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="AdminStoreSection">
<element name="createdRoleInUserPage" type="text" selector="//tr//td[contains(text(), '{{roleName}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
<actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser">
<argument name="user" value="activeAdmin"/>
</actionGroup>
</after>

<actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser">
<argument name="role" value="genericAdminRole"/>
<argument name="user" value="activeAdmin"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logoutMasterAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
<actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser">
<argument name="user" value="inactiveAdmin"/>
</actionGroup>
</after>

<actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser">
<argument name="role" value="genericAdminRole"/>
<argument name="user" value="inactiveAdmin"/>
</actionGroup>
<amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToAdminUsersGrid"/>
Expand Down

0 comments on commit da4f432

Please sign in to comment.