diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleInGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleInGridActionGroup.xml new file mode 100644 index 0000000000000..93ff97e8bbf8c --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleInGridActionGroup.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleNotInGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleNotInGridActionGroup.xml new file mode 100644 index 0000000000000..bb6af04e0e7b6 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleNotInGridActionGroup.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml index 3d0c8b855e53b..f1826d360fb88 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml @@ -14,5 +14,6 @@ + diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateUserRoleEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateUserRoleEntityTest.xml new file mode 100644 index 0000000000000..c50728bfda024 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateUserRoleEntityTest.xml @@ -0,0 +1,78 @@ + + + + + + + + + + <description value="Creating a new role with different data sets"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="logIn"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logOut"/> + </after> + + <!--Create a new role with custom access--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> + <argument name="role" value="roleSales"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You saved the role."/> + </actionGroup> + <actionGroup ref="AssertAdminRoleInGridActionGroup" stepKey="assertRoleInGrid"> + <argument name="roleName" value="{{roleSales.name}}"/> + </actionGroup> + <!--Delete the new role with custom access--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteSaleRole"> + <argument name="roleName" value="{{roleSales.name}}"/> + </actionGroup> + + <!--Create a new role with full access--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePageSecondTime"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleFormSecondTime"> + <argument name="role" value="roleAdministrator"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRoleSecondTime"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> + <argument name="message" value="You saved the role."/> + </actionGroup> + <actionGroup ref="AssertAdminRoleInGridActionGroup" stepKey="assertRoleInGridSecondTime"> + <argument name="roleName" value="{{roleAdministrator.name}}"/> + </actionGroup> + <!--Delete the new role with full access--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteAdministratorRole"> + <argument name="roleName" value="{{roleAdministrator.name}}"/> + </actionGroup> + + <!--Create a new role using incorrect current_password--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePageThirdTime"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleFormThirdTime"> + <argument name="role" value="roleAdministrator"/> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRoleThirdTime"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertErrorMessage"> + <argument name="messageType" value="error"/> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again."/> + </actionGroup> + <actionGroup ref="AssertAdminRoleNotInGridActionGroup" stepKey="assertRoleNotInGrid"> + <argument name="roleName" value="{{roleAdministrator.name}}"/> + </actionGroup> + + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml index 19b7406139584..4ae4c476a959b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\CreateAdminUserRoleEntityTest" summary="Create Admin User Role" ticketId="MAGETWO-23413"> <variation name="CreateAdminUserRoleEntityTestVariation1"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, mftf_migrated:yes</data> <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> <data name="role/data/current_password" xsi:type="string">%current_password%</data> <data name="role/data/resource_access" xsi:type="string">Custom</data> @@ -22,6 +22,7 @@ <data name="role/data/resource_access" xsi:type="string">All</data> <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage" /> <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="CreateAdminUserRoleEntityTestVariation3"> <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> @@ -29,6 +30,7 @@ <data name="role/data/resource_access" xsi:type="string">All</data> <constraint name="Magento\User\Test\Constraint\AssertIncorrectUserPassword" /> <constraint name="Magento\User\Test\Constraint\AssertRoleNotInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config>