Karate tests: Cover authority deleting with integration tests
Description
Environment
Potential Workaround
Attachments
- 29 Jan 2024, 09:14 AM
- 29 Jan 2024, 09:12 AM
Checklist
hideTestRail: Results
Activity
Mukhiddin Yusupov January 29, 2024 at 9:15 AM
Latest successful test run for the added test cases: https://jenkins-aws.indexdata.com/job/Testing/job/Scheduled%20Karate%20Tests/1113/testReport/spitfire.mod-entities-links.features/get-authorities-with-filtering/
Khalilah Gambrell January 3, 2024 at 5:11 PM
Thanks @Pavlo Smahin - I am good with these scenarios.
Pavlo Smahin January 3, 2024 at 4:41 PM
@Khalilah Gambrell
Yes, only for deleted authority records
We can't test scenarious with checking purging with Karate tests because it will require at least a day for such test. One day is minimum value that could be set for retention policy.
Khalilah Gambrell January 3, 2024 at 3:02 PM
Thanks @Pavlo Smahin
The filters scenarios are only related to using the API that returns deleted authority records?
And should there scenarios regarding when the authority records in mod-entities-link and srs are purged?
Pavlo Smahin January 3, 2024 at 9:01 AM
I mean that mapped record couldn't be fetched by ID after it was deleted. But in same time it could be found with filters and specifiing that search is for deleted records.
And that's why I have a filter scenarious, to cover all that we done in the feature.
Test Case 1: Valid Deletion of Authority Record
Scenario: Deleting an Authority record by ID
Test Steps:
Given a valid Authority record ID exists in the system.
When the user deletes the Authority record using its ID.
Then the record should be deleted successfully.
And attempting to access the record by ID should result in a non-existent or inaccessible response.
And the related source record's state field should be marked as "DELETED".
And the 'deleted' attribute for the related source record should be set to true.
And the 'leaderRecordStatus' for the related source record should be 'd'.
Expected Outcome: All the specified conditions should be met after the deletion of the Authority record.
Test Case 2: Invalid Deletion Attempts
Scenario: Attempting to delete a non-existent Authority record
Test Steps:
Given an Authority record ID that does not exist in the system.
When the user attempts to delete the Authority record using this non-existent ID.
Then a suitable error or failure message should be returned.
And there should be no impact or change to any existing records.
Expected Outcome: The system should handle attempts to delete non-existent records gracefully without affecting other data.
Test Case 4: Filter by Source File
Scenario: Filtering authorities by a specific source file
Test Steps:
Given multiple Authority records exist with different source files.
When filtering authorities using a specific source file.
Then the API should return only the Authority records associated with that particular source file.
And records from other source files should not be present in the response.
Expected Outcome: The API should accurately filter and return only the Authority records associated with the specified source file.
Test Case 5: Filter by Headings Type
Scenario: Filtering authorities by a certain headings type
Test Steps:
Given multiple Authority records exist with different heading types.
When filtering authorities using a specific headings type.
Then the API should return only the Authority records that match the specified headings type.
And records with different heading types should not be included in the response.
Expected Outcome: The API should correctly filter and return only the Authority records that match the specified headings type.
Test Case 6: Filter by Date Created
Scenario: Filtering authorities by the date they were created
Test Steps:
Given multiple Authority records exist with various creation dates.
When filtering authorities based on a specific creation date range.
Then the API should return only the Authority records that were created within that date range.
And records created outside the specified date range should not be present in the response.
Expected Outcome: The API should effectively filter and return only the Authority records created within the specified date range.
Test Case 7: Filter by Date Updated
Scenario: Filtering authorities by the date they were last updated
Test Steps:
Given multiple Authority records exist with different update dates.
When filtering authorities based on a specific date range of updates.
Then the API should return only the Authority records that were updated within that date range.
And records updated outside the specified date range should not be included in the response.
Expected Outcome: The API should accurately filter and return only the Authority records updated within the specified date range.
Test Case 8: Combination of Filters
Scenario: Using multiple filters together
Test Steps:
Given a variety of Authority records with diverse source files, heading types, creation dates, and update dates.
When applying multiple filters simultaneously (e.g., source file, heading type, creation/update date ranges).
Then the API should return records that satisfy all specified filters simultaneously.
And records not meeting all filter criteria should be excluded from the response.
Expected Outcome: The API should correctly handle and apply multiple filters together, returning only the Authority records that meet all specified criteria simultaneously.
Test Case 9: Retrieving Archived Authority Records with Multiple Filters
Scenario: Fetching archived Authority records using multiple filters
Test Steps:
Given a mix of Authority records, some of which are archived and others that are active.
When retrieving archived Authority records using a combination of filters such as source file, heading type, creation date, and update date ranges.
Then the API should return only the archived Authority records that satisfy all specified filters simultaneously.
And active records or those not meeting all filter criteria should be excluded from the response.
Expected Outcome: The API should accurately filter and return only the archived Authority records that match all specified criteria (source file, heading type, creation date, update date) for archived records, leaving out any active records or those not meeting the filtering criteria.