Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA-3 Defintion import validations for new Tab AccessTypeRoles - BEFTA Tests #1445

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions aat/src/aat/resources/features/F-109 AccessTypeRoles/F-109.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
@F-109
Feature: F-109 Import validations for CCD Definition with AccessTypeRoles tab

Background:
Given an appropriate test context as detailed in the test data source

@S-109.2
Scenario: Fail to import a definition file with invalid CaseTypeID in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with invalid CaseTypeId]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.3
Scenario: Fail to import a definition file invalid or duplicate AccessTypeID in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with an invalid or duplicate AccessTypeID]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.4
Scenario: Fail to import a definition file with missing OrganisationProfileID in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles missing OrganisationProfileID]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.5
Scenario: Fail to import a definition file with missing Description in AccessTypeRoles when Display is set to True
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with missing Description when Display is set to True]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.6
Scenario: Fail to import a definition file with missing Hint in AccessTypeRoles when Display is set to True
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with missing Hint when Display is set to True]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.7
Scenario: Fail to import a definition file with missing DisplayOrder in AccessTypeRoles when Display is set to True
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles missing DisplayOrder when Display is set to True]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.8
Scenario: Fail to import a definition file with DisplayOrder set to 0 in AccessTypeRoles when Display is set to True
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with DisplayOrder set to 0 when Display is set to True]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.9
Scenario: Fail to import a definition file with DisplayOrder not being unique across CaseTypeId for a Jurisdiction in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles where DisplayOrder is not unique across CaseTypeId for a Jurisdiction]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.10
Scenario: Fail to import a definition file with OrganisationalRoleName and GroupRoleName both null in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles where both OrganisationalRoleName and GroupRoleName are null]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.11
Scenario: Fail to import a definition file containing new Tab AccessTypeRoles with CaseAssignedRoleField is null in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with CaseAssignedRoleField is null when GroupRoleName is not null]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.12
Scenario: Fail to import a definition file containing new Tab AccessTypeRoles with GroupAccessEnabled is null in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with GroupAccessEnabled is null when GroupRoleName is not null]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.13
Scenario: Fail to import a definition file with AccessMandatory set to an invalid value in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with AccessMandatory set to an invalid value]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.14
Scenario: Fail to import a definition file with AccessDefault set to an invalid value in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with AccessDefault set to an invalid value]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.15
Scenario: Fail to import a definition file with Display set to an invalid value in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with Display set to an invalid value]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.16
Scenario: Fail to import a definition file with GroupAccessEnabled set to an invalid value in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with GroupAccessEnabled set to an invalid value]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.17
Scenario: Fail to import a definition file with with AccessMandatory set to a valid value in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with AccessMandatory set to a valid value]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.18
Scenario: Fail to import a definition file with AccessDefault set to a valid value in AccessTypeRoles
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with AccessDefault set to a valid value]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.22
Scenario: Fail to import a definition file containing new Tab AccessTypeRoles with CaseAccessGroupIDTemplate has invalid format when value present
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with CaseAccessGroupIDTemplate has value of the format that does not match <service>[:<id1>[:<Id2...]]]]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected

@S-109.23
Scenario: Fail to import a definition file containing new Tab AccessTypeRoles with CaseAssignedRoleField has non matching value in RoleToAccessProfiles present
Given a user with [an active profile in CCD]
When a request is prepared with appropriate values
And the request [contains a definition file with new tab AccessTypeRoles with CaseAssignedRoleField has value that does not match a value in RoleToAccessProfiles]
And it is submitted to call the [Import definition file] operation of [CCD Definition Store]
Then a negative response is received
And the response has all other details as expected


Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"_guid_": "F-109_Definition_Import_Test_Base_data",
"productName": "CCD Definition Store",
"operationName": "Import definition file",
"specs": [
"an active profile in CCD"
],
"method": "POST",
"uri": "/import",
"users": {
"invokingUser": {
"username": "[[$DEFINITION_IMPORTER_USERNAME]]",
"password": "[[$DEFINITION_IMPORTER_PASSWORD]]"
}
},
"request": {
"headers": {
"Authorization": "[[DEFAULT_AUTO_VALUE]]",
"ServiceAuthorization": "[[DEFAULT_AUTO_VALUE]]",
"Content-Type": "multipart/form-data"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-109.10",
"_extends_": "F-109_Definition_Import_Test_Base_data",
"title": "Fail to import a definition file with OrganisationalRoleName and GroupRoleName both null in AccessTypeRoles",
"specs": [
"an active profile in CCD",
"contains a definition file with new tab AccessTypeRoles where both OrganisationalRoleName and GroupRoleName are null"
],
"request": {
"body": {
"arrayInMap": [
{
"key": "file",
"filePath": "uk/gov/hmcts/ccd/test_definitions/invalid/accesstyperoles/BEFTA_Master_Definition_AccessTypeRole_OrgRoleNameAndGroupRoleNameAreNull.xlsx"
}
]
}
},
"expectedResponse": {
"responseCode": 422,
"responseMessage": "Unprocessable Entity",
"headers": {
"Content-Encoding": "[[ANYTHING_PRESENT]]",
"Content-Type": "text/plain",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"__plainTextValue__": "Validation errors occurred importing the spreadsheet.- Either 'OrganisationalRoleName' or 'GroupRoleName' must be set in the sheet 'AccessTypeRoles'"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-109.11",
"_extends_": "F-109_Definition_Import_Test_Base_data",
"title": "Fail to import a definition file containing new Tab AccessTypeRoles with CaseAssignedRoleField is null in AccessTypeRoles",
"specs": [
"an active profile in CCD",
"contains a definition file with new tab AccessTypeRoles with CaseAssignedRoleField is null when GroupRoleName is not null"
],
"request": {
"body": {
"arrayInMap": [
{
"key": "file",
"filePath": "uk/gov/hmcts/ccd/test_definitions/invalid/accesstyperoles/BEFTA_Master_Definition_AccessTypeRole_CaseAssignedRoleFieldIsNull.xlsx"
}
]
}
},
"expectedResponse": {
"responseCode": 422,
"responseMessage": "Unprocessable Entity",
"headers": {
"Content-Encoding": "[[ANYTHING_PRESENT]]",
"Content-Type": "text/plain",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"__plainTextValue__": "Validation errors occurred importing the spreadsheet.- 'CaseAssignedRoleField' must be set if 'GroupRoleName' is not null in the sheet 'AccessTypeRoles'"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-109.12",
"_extends_": "F-109_Definition_Import_Test_Base_data",
"title": "Fail to import a definition file containing new Tab AccessTypeRoles with GroupAccessEnabled is null in AccessTypeRoles",
"specs": [
"an active profile in CCD",
"contains a definition file with new tab AccessTypeRoles with GroupAccessEnabled is null when GroupRoleName is not null"
],
"request": {
"body": {
"arrayInMap": [
{
"key": "file",
"filePath": "uk/gov/hmcts/ccd/test_definitions/invalid/accesstyperoles/BEFTA_Master_Definition_AccessTypeRole_GroupAccessEnabledIsNull.xlsx"
}
]
}
},
"expectedResponse": {
"responseCode": 422,
"responseMessage": "Unprocessable Entity",
"headers": {
"Content-Encoding": "[[ANYTHING_PRESENT]]",
"Content-Type": "text/plain",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"__plainTextValue__": "Validation errors occurred importing the spreadsheet.- 'GroupAccessEnabled' must be enabled if 'GroupRoleName' is set in the sheet 'AccessTypeRoles'"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-109.13",
"_extends_": "F-109_Definition_Import_Test_Base_data",
"title": "Fail to import a definition file with AccessMandatory set to an invalid value in AccessTypeRoles",
"specs": [
"an active profile in CCD",
"contains a definition file with new tab AccessTypeRoles with AccessMandatory set to an invalid value"
],
"request": {
"body": {
"arrayInMap": [
{
"key": "file",
"filePath": "uk/gov/hmcts/ccd/test_definitions/invalid/accesstypes/BEFTA_Master_Definition_AccessType_AccessManditoryIsInvalid.xlsx"
}
]
}
},
"expectedResponse": {
"responseCode": 400,
"responseMessage": "Unprocessable Entity",
"headers": {
"Content-Encoding": "[[ANYTHING_PRESENT]]",
"Content-Type": "text/plain",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"__plainTextValue__": "Invalid value 'Yess' is found in column 'AccessMandatory' in the sheet 'AccessTypeRoles'"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-109.14",
"_extends_": "F-109_Definition_Import_Test_Base_data",
"title": "Fail to import a definition file with AccessDefault set to an invalid value in AccessTypeRoles",
"specs": [
"an active profile in CCD",
"contains a definition file with new tab AccessTypeRoles with AccessDefault set to an invalid value"
],
"request": {
"body": {
"arrayInMap": [
{
"key": "file",
"filePath": "uk/gov/hmcts/ccd/test_definitions/invalid/accesstypes/BEFTA_Master_Definition_AccessType_AccessDefaultIsInvalid.xlsx"
}
]
}
},
"expectedResponse": {
"responseCode": 400,
"responseMessage": "Unprocessable Entity",
"headers": {
"Content-Encoding": "[[ANYTHING_PRESENT]]",
"Content-Type": "text/plain",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"__plainTextValue__": "Invalid value 'YYes' is found in column 'AccessDefault' in the sheet 'AccessTypeRoles'"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-109.15",
"_extends_": "F-109_Definition_Import_Test_Base_data",
"title": "Fail to import a definition file with Display set to an invalid value in AccessTypeRoles",
"specs": [
"an active profile in CCD",
"contains a definition file with new tab AccessTypeRoles with Display set to an invalid value"
],
"request": {
"body": {
"arrayInMap": [
{
"key": "file",
"filePath": "uk/gov/hmcts/ccd/test_definitions/invalid/accesstypes/BEFTA_Master_Definition_AccessType_DisplayIsInvalid.xlsx"
}
]
}
},
"expectedResponse": {
"responseCode": 400,
"responseMessage": "Unprocessable Entity",
"headers": {
"Content-Encoding": "[[ANYTHING_PRESENT]]",
"Content-Type": "text/plain",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"__plainTextValue__": "Invalid value 'u' is found in column 'Display' in the sheet 'AccessTypeRoles'"
}
}
}
Loading
Loading