- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 03:50 AM - edited 01-11-2024 04:16 AM
Is it possible to create test groups and assign them roles within a test?
I am testing the functionality of a form to be edited by different user categories.
Since the user categories are not strictly defined with the help of user groups, my solution so far is to create dedicated user groups for testing, something in the line of:
- TestGroup.AuthorizedUser
- TestGroup.UnauthorizedUser
- TestGroup.AuthorizedManager
It is a requirement that in the test step Create a user the group is assigned, not the roles.
I would like to create the test groups within the test, and have them disappear at the end. This way I won't clutter the groups table, nor the groups naming (TestGroup.AuthorizedUser is clear within the context of a test, whereas in the groups table I might need to specify something like TestGroupChangeRequest.AuthorizedUser, TestGroupCreateIncident.AuthorizedUser, etc).
I tried with the server steps Record Insert, Record Update, and Record Validation, but I cannot make it work. In particular, I am not able to assign roles to the group.
Likely there are other/better ways to approach this task. Any idea on how to do so would be much appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 01:54 AM
Meanwhile a colleague helped me out with the answer: yes, it is possible to create test groups and assign them roles within a test
In order to do so, at least three test steps are required
- Create a User with permission to create groups and assign them roles, for example an admin
- Record Insert - Create the group in sys_user_group
- Record Insert - Assign the roles to the group with an entry to the table
sys_group_has_role
On the consequences of manipulating sys tables within a test I cannot tell much, apart from the fact that there are plenty of warnings to tell the user to be careful about it. So, there might be better ways to approach this task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 01:54 AM
Meanwhile a colleague helped me out with the answer: yes, it is possible to create test groups and assign them roles within a test
In order to do so, at least three test steps are required
- Create a User with permission to create groups and assign them roles, for example an admin
- Record Insert - Create the group in sys_user_group
- Record Insert - Assign the roles to the group with an entry to the table
sys_group_has_role
On the consequences of manipulating sys tables within a test I cannot tell much, apart from the fact that there are plenty of warnings to tell the user to be careful about it. So, there might be better ways to approach this task.