-
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 #6265 from magento-tsg/MC-34292
[Arrows] MC-34292: AdminCreateUserRoleWithReportsActionGroup needs to be refactored to be based in CE
- Loading branch information
Showing
8 changed files
with
183 additions
and
5 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/code/Magento/User/Test/Mftf/ActionGroup/AdminChooseUserRoleResourceActionGroup.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,23 @@ | ||
<?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="AdminChooseUserRoleResourceActionGroup"> | ||
<annotations> | ||
<description>Check the resource access checkbox. Leave the form open.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="resourceId" type="string" defaultValue="Magento_Backend::dashboard"/> | ||
<argument name="resourceName" type="string" defaultValue="Dashboard"/> | ||
</arguments> | ||
|
||
<waitForElementVisible selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink(resourceId, resourceName)}}" stepKey="waitForResourceCheckboxVisible"/> | ||
<click selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink(resourceId, resourceName)}}" stepKey="checkResource"/> | ||
<seeCheckboxIsChecked selector="{{AdminEditRoleResourcesSection.resourceCheckbox(resourceId)}}" stepKey="seeCheckedResource"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/User/Test/Mftf/ActionGroup/AdminSaveUserRoleActionGroup.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. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSaveUserRoleActionGroup"> | ||
<annotations> | ||
<description>Click to Save Role</description> | ||
</annotations> | ||
<click selector="{{AdminEditRoleInfoSection.saveButton}}" stepKey="clickSaveRoleButton" /> | ||
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the role." stepKey="seeSuccessMessageForSavedRole"/> | ||
</actionGroup> | ||
</actionGroups> |
26 changes: 26 additions & 0 deletions
26
app/code/Magento/User/Test/Mftf/ActionGroup/AdminStartCreateUserRoleActionGroup.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,26 @@ | ||
<?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="AdminStartCreateUserRoleActionGroup"> | ||
<annotations> | ||
<description>Open Admin Edit Role page. Fills role, user password, resource access. Leave the form open.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="roleName" type="string" defaultValue="{{limitedRole.name}}"/> | ||
<argument name="userPassword" type="string" defaultValue="123123q"/> | ||
<argument name="resourceAccess" type="string" defaultValue="Custom"/> | ||
</arguments> | ||
<amOnPage url="{{AdminEditRolePage.url}}" stepKey="openNewAdminRolePage"/> | ||
<waitForElementVisible selector="{{AdminCreateRoleSection.name}}" stepKey="waitForName"/> | ||
<fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{roleName}}" stepKey="setTheRoleName"/> | ||
<fillField selector="{{AdminCreateRoleSection.password}}" userInput="{{userPassword}}" stepKey="setPassword"/> | ||
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> | ||
<selectOption selector="{{AdminEditRoleResourcesSection.resourceAccess}}" userInput="{{resourceAccess}}" stepKey="chooseResourceAccess"/> | ||
</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
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
109 changes: 109 additions & 0 deletions
109
app/code/Magento/User/Test/Mftf/Test/AdminReviewOrderWithReportsPermissionTest.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,109 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminReviewOrderWithReportsPermissionTest"> | ||
<annotations> | ||
<features value="User"/> | ||
<stories value="Admin with restricted permissions"/> | ||
<title value="User should be able to review ordered products with only 'Reports' permission"/> | ||
<description value="User should be able to review ordered products with only 'Reports' permission"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MAGETWO-25812"/> | ||
<group value="user"/> | ||
</annotations> | ||
<before> | ||
<createData entity="ApiCategory" stepKey="createCategory"/> | ||
<createData entity="ApiSimpleProduct" stepKey="createProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> | ||
<argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/> | ||
<argument name="websiteCode" value="{{NewWebSiteData.code}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> | ||
<argument name="website" value="{{NewWebSiteData.name}}"/> | ||
<argument name="storeGroupName" value="{{NewStoreData.name}}"/> | ||
<argument name="storeGroupCode" value="{{NewStoreData.code}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> | ||
<argument name="StoreGroup" value="NewStoreData"/> | ||
<argument name="customStore" value="NewStoreViewData"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminCreateCustomerWithWebsiteAndStoreViewActionGroup" stepKey="createCustomerWithWebsiteAndStoreView"> | ||
<argument name="customerData" value="Simple_US_Customer"/> | ||
<argument name="address" value="US_Address_NY"/> | ||
<argument name="website" value="{{NewWebSiteData.name}}"/> | ||
<argument name="storeView" value="{{NewStoreViewData.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProductOnAdmin"> | ||
<argument name="product" value="$createProduct$"/> | ||
</actionGroup> | ||
<actionGroup ref="CreatedProductConnectToWebsiteActionGroup" stepKey="productConnectToWebsite"> | ||
<argument name="website" value="NewWebSiteData"/> | ||
<argument name="product" value="$createProduct$"/> | ||
</actionGroup> | ||
<actionGroup ref="CreateOrderInStoreChoosingPaymentMethodActionGroup" stepKey="createOrder"> | ||
<argument name="product" value="$createProduct$"/> | ||
<argument name="customer" value="Simple_US_Customer"/> | ||
<argument name="storeView" value="NewStoreViewData"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminStartCreateUserRoleActionGroup" stepKey="startCreateUserRole"> | ||
<argument name="roleName" value="{{limitedRole.name}}"/> | ||
<argument name="userPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> | ||
<argument name="resourceAccess" value="Custom"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminChooseUserRoleResourceActionGroup" stepKey="setResourceAccess"> | ||
<argument name="resourceId" value="Magento_Reports::report"/> | ||
<argument name="resourceName" value="Reports"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminSaveUserRoleActionGroup" stepKey="saveRole"/> | ||
<actionGroup ref="AdminCreateUserWithRoleActionGroup" stepKey="createUser"> | ||
<argument name="role" value="limitedRole"/> | ||
<argument name="user" value="NewAdminUser"/> | ||
</actionGroup> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
|
||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdminUser"/> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
<actionGroup ref="AdminDeleteCreatedUserActionGroup" stepKey="deleteUser"> | ||
<argument name="user" value="NewAdminUser"/> | ||
</actionGroup> | ||
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearAdminUserGridFilters"/> | ||
<amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToUserRoleGrid"/> | ||
<actionGroup ref="AdminDeleteRoleActionGroup" stepKey="deleteRole"> | ||
<argument name="role" value="limitedRole"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> | ||
<argument name="customerEmail" value="Simple_US_Customer.email"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="clearCustomerFilters"/> | ||
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> | ||
<argument name="websiteName" value="{{NewWebSiteData.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="logAsNewUser"> | ||
<argument name="username" value="{{NewAdminUser.username}}"/> | ||
<argument name="password" value="{{NewAdminUser.password}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminReviewOrderActionGroup" stepKey="reviewOrder"> | ||
<argument name="productName" value="$createProduct.name$"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |