|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminPageBuilderProductsCarouselDisplayProductCountForRestrictedAdminTest" extends="AdminPageBuilderProductsGridValidateAppearanceTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PageBuilder"/> |
| 13 | + <stories value="Products"/> |
| 14 | + <title value="Restricted admin with access to CMS Page Edits and Widgets should be able to add product widget without errors"/> |
| 15 | + <description value="Restricted admin with access to CMS Page Edits and Widgets should be able to add product widget on CMS Page using Page Builder without errors"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <useCaseId value="MC-42779"/> |
| 18 | + <testCaseId value="MC-43007"/> |
| 19 | + <group value="pagebuilder"/> |
| 20 | + <group value="pagebuilder-products"/> |
| 21 | + <group value="pagebuilder-productsCarousel"/> |
| 22 | + </annotations> |
| 23 | + |
| 24 | + <before> |
| 25 | + <!-- Create a restricted role with access only to CMS and Widgets --> |
| 26 | + <createData entity="rolePageBuilderProductWidgetEdit" after="createCMSPage" stepKey="role2"/> |
| 27 | + |
| 28 | + <!-- Create an restricted admin user assigned to role --> |
| 29 | + <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" after="loginAsAdmin" stepKey="adminCreateUser"> |
| 30 | + <argument name="user" value="NewAdminUser"/> |
| 31 | + <argument name="role" value="rolePageBuilderProductWidgetEdit"/> |
| 32 | + </actionGroup> |
| 33 | + |
| 34 | + <!-- Log out main Admin user --> |
| 35 | + <actionGroup ref="AdminLogoutActionGroup" after="adminCreateUser" stepKey="logout"/> |
| 36 | + |
| 37 | + <!-- Log in restricted Admin user --> |
| 38 | + <actionGroup ref="AdminLoginActionGroup" after="logout" stepKey="loginAsRestrictedAdmin"> |
| 39 | + <argument name="username" value="{{NewAdminUser.username}}"/> |
| 40 | + <argument name="password" value="{{NewAdminUser.password}}"/> |
| 41 | + </actionGroup> |
| 42 | + </before> |
| 43 | + |
| 44 | + <after> |
| 45 | + <!-- Log in main Admin user after restricted Admin was logged out --> |
| 46 | + <actionGroup ref="AdminLoginActionGroup" after="logout" stepKey="loginAsAdmin"/> |
| 47 | + |
| 48 | + <!-- Delete restricted Admin user --> |
| 49 | + <actionGroup ref="AdminDeleteCustomUserActionGroup" after="loginAsAdmin" stepKey="deleteUser"> |
| 50 | + <argument name="user" value="NewAdminUser"/> |
| 51 | + </actionGroup> |
| 52 | + |
| 53 | + <!-- Delete restricted role --> |
| 54 | + <actionGroup ref="AdminDeleteRoleByRoleNameActionGroup" after="deleteUser" stepKey="deleteRole2"> |
| 55 | + <argument name="role" value="rolePageBuilderProductWidgetEdit"/> |
| 56 | + </actionGroup> |
| 57 | + </after> |
| 58 | + |
| 59 | + <!-- Confirm there is no error message on screen --> |
| 60 | + <dontSeeElement selector="{{EditPanelForm.panelSectionGenericError}}" after="openEditAfterDrop" stepKey="validateNoErrorMessageVisible"/> |
| 61 | + |
| 62 | + <!-- Validate product total count for product selection conditions shows correct value --> |
| 63 | + <actionGroup ref="validateProductTotals" after="selectCategory" stepKey="assertProductCountOnPanel"> |
| 64 | + <argument name="productsTotals" value="of 6 total"/> |
| 65 | + </actionGroup> |
| 66 | + </test> |
| 67 | +</tests> |
0 commit comments