Feature: Domain Role Management
As admin
I can create and edit domain security roles

@auth @createuser @createdomain @deleteuser @deletedomain @logout
Scenario: Creating and update and delete Security Role audit logs check
	Given I add a new Security Role via API
	And I edit created domain
	Then I check Role Audit logs
		| Timing | UserName | Comment | EntityDisplayName    | Type   | DisplayName                 | Changes |
		|        |          |         | scenarioDataInstance | Create | formNameFromScenarioContext |         |
	When I edit created domain
	Then I check new Security Role created
	When I click on newly created Security Role
	Then I choose Role Access permission options
		| Allowed | Name      | Group | Description |
		|         | Add User  |       |             |
		|         | Edit User |       |             |
	Then I check Role Access Audit logs
		| Timing | UserName | Comment | EntityDisplayName    | Type   | DisplayName                 | Changes |
		|        |          |         | scenarioDataInstance | Create | formNameFromScenarioContext |         |
	When I delete added Security Role
	Then I check Role Audit logs
		| Timing | UserName | Comment | EntityDisplayName    | Type   | DisplayName                 | Changes |
		|        |          |         | scenarioDataInstance | Delete | formNameFromScenarioContext |         |

@auth @createuser @createdomain @deleteuser @deletedomain @logout
Scenario: Creating and update and delete User Role audit logs check
	Given I add a new Security Role via API
	And I edit created domain
	Then I check new Security Role created
	When I click on newly created Security Role
	When I enter into Users tab
	Then I add User to Security Role
		| UserName |
		| UserName |
	Then I check new Security Role created
	When I click on newly created Security Role
	When I enter into Users tab
	Then I check if user is added to Security Role
	Then I check UserRoles Audit logs
		| Timing | UserName | Comment | EntityDisplayName    | Type   | DisplayName                 | Changes |
		|        |          |         | scenarioDataInstance | Create | formNameFromScenarioContext |         |
	When I delete added User from Security Role
	Then I check UserRoles Audit logs
		| Timing | UserName | Comment | EntityDisplayName    | Type  | DisplayName                 | Changes |
		|        |          |         | scenarioDataInstance | Purge | formNameFromScenarioContext |         |