Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFTF: Extract Action Groups to separate files - magento/module-braintree #25784

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
<actionGroup name="AdminCreateNewRoleActionGroup">
<annotations>
<description>Creates a User Role using the provided Data.</description>
</annotations>
<arguments>
<argument name="role" type="string" defaultValue=""/>
<argument name="resource" type="string" defaultValue="All"/>
<argument name="scope" type="string" defaultValue="Custom"/>
<argument name="websites" type="string" defaultValue="Main Website"/>
</arguments>

<click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/>
<fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/>
<fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/>
<waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/>
<click stepKey="checkSales" selector="//a[text()='Sales']"/>
<click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/>
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
<see userInput="You saved the role." stepKey="seeSuccessMessage"/>
</actionGroup>
</actionGroups>
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminDeleteRoleActionGroup">
<annotations>
<description>Deletes a User Role that contains the text 'Role'. PLEASE NOTE: The Action Group values are Hardcoded.</description>
</annotations>
<arguments>
<argument name="role" defaultValue=""/>
</arguments>

<click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/>
<fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
<click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/>
<waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/>
<click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/>
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
<see stepKey="seeSuccessMessage" userInput="You deleted the role."/>
</actionGroup>
</actionGroups>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ConfigureBraintree">
<actionGroup name="ConfigureBraintreeActionGroup">
<annotations>
<description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description>
</annotations>
Expand Down Expand Up @@ -49,13 +49,4 @@
<click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/>
<waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/>
</actionGroup>

<actionGroup name="DisableBrainTree">
<annotations>
<description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description>
</annotations>

<magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/>
<magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="DisableBraintreeActionGroup">
<annotations>
<description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description>
</annotations>

<magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/>
<magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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="GoToAllUsersActionGroup">
<annotations>
<description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description>
</annotations>

<click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/>
<waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
<click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/>
<waitForPageLoad stepKey="waitForUserRolesPageToOpen"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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="GoToUserRolesActionGroup">
<annotations>
<description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description>
</annotations>

<click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/>
<waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
<click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/>
<waitForPageLoad stepKey="waitForUserRolesPageToOpen"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<issueId value="MQE-1576"/>
</skip>
</annotations>


<before>
<!--Login As Admin-->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
Expand All @@ -39,17 +37,20 @@


<!--Configure Braintree-->
<actionGroup ref="ConfigureBraintree" stepKey="configureBraintree"/>
<actionGroup ref="ConfigureBraintreeActionGroup" stepKey="configureBraintree"/>

<!--Create New Role-->
<actionGroup ref="GoToUserRoles" stepKey="GoToUserRoles"/>
<actionGroup ref="GoToUserRolesActionGroup" stepKey="GoToUserRoles"/>
<waitForPageLoad stepKey="waitForAllRoles" time="15"/>
<actionGroup ref="AdminCreateNewRole" stepKey="AdminCreateNewRole"/>
<actionGroup ref="AdminCreateNewRoleActionGroup" stepKey="AdminCreateNewRole"/>

<!--Create new admin user-->
<actionGroup ref="GoToAllUsers" stepKey="GoToAllUsers"/>
<actionGroup ref="GoToAllUsersActionGroup" stepKey="GoToAllUsers"/>
<waitForPageLoad stepKey="waitForUsers" time="15"/>
<actionGroup ref="AdminCreateUserAction" stepKey="AdminCreateNewUser"/>
<actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser">
<argument name="role" value="role"/>
<argument name="User" value="NewAdmin"/>
</actionGroup>

<!--SignOut-->
<actionGroup ref="logout" stepKey="signOutFromAdmin"/>
Expand Down Expand Up @@ -88,7 +89,7 @@

<after>
<!-- Disable BrainTree -->
<actionGroup ref="DisableBrainTree" stepKey="disableBrainTree"/>
<actionGroup ref="DisableBraintreeActionGroup" stepKey="disableBrainTree"/>

<!--SignOut-->
<actionGroup ref="SignOut" stepKey="signOutFromNewUser"/>
Expand All @@ -101,11 +102,11 @@
<deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/>

<!--Delete User -->
<actionGroup ref="GoToAllUsers" stepKey="GoBackToAllUsers"/>
<actionGroup ref="GoToAllUsersActionGroup" stepKey="GoBackToAllUsers"/>
<actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="AdminDeleteUserActionGroup"/>

<!--Delete Role-->
<actionGroup ref="GoToUserRoles" stepKey="GoBackToUserRoles"/>
<actionGroup ref="GoToUserRolesActionGroup" stepKey="GoBackToUserRoles"/>
<actionGroup ref="AdminDeleteRoleActionGroup" stepKey="AdminDeleteRoleActionGroup"/>
</after>
</test>
Expand Down