Add Test Case Records to Records Management Policy
Vera’s Records Management Policy (RMP) is a data model shared between multiple software components in the Vera application architecture. Vera uses this model to know which fields to import when records are routed for approval.
Create the RMP JSON File
Below we will create a Records Management Policy, and we will define the qTest Test Case and Automated Test Case record types.
Create a new JSON file and add a Revision number, Version number and Schema save the file as VeraRMPTutorial-part1.json.
{ "Revision": "1", "Records Management Policy": { "Version": "Vera Tutorial 1", "Schema": { "ID": "http://tx3services.com/schemas/0/0/records-management-policy.json", "Major": "0", "Minor": "0" } }
Policy Revision management was introduced in Vera 2023.2. You still need to include a Revision and Version number to upload policies. The Version number can be used as a reference number. The Revision number is managed by Vera. The Revision number in the file is ignored when uploading policies.
Create qTest Test Case Record Type
Add a Record Type Name. We are going to start by defining a qTest Test Case. We will create unique record types for qTest and Tosca tests:
{ "Revision": "1", "Records Management Policy": { "Version": "Vera Tutorial 1", "Schema": { "ID": "http://tx3services.com/schemas/0/0/records-management-policy.json", "Major": "0", "Minor": "0" }, "Record Types": [ { "Name": "qTest Test Case" } ] } }
Define the Record Type by System and Item Type. qTest is the System and the Item Type is test-case:
"Definitions": [ { "Systems": ["qTest"], "Item Types": ["test-case"], "Singular Name": "Test Case", "Plural Name": "Test Cases" } ]
Here is the updated Records Management Policy with above code block:
Define the record Author. The record’s Author can be the Route Owner (the person who routed the record for approval) or by a record field:
Here is the updated Records Management Policy with above code block:
Add a Constraint to the definition to further specify the type of qTest test case and create a unique record type. Identify any qTest test case that does not have Tosca automation flag as a qTest Test Case using the Field Is Not Equal constraint:
Here is the updated Records Management Policy with above code block:
Add the record fields you want to include in Vera by adding a Fields section to the Record Type. You will add the Status, Description, and Precondition test case fields. Currently Vera only imports data fields so you will include the “Is Data”: true for each field:
Here is the updated Records Management Policy with above code block:
Create qTest Test Step Record Type
In addition to record fields, qTest Test Cases have a sub-record called Test Steps. Add the qTest Test Steps as a record type as well. Start by adding the Record Type Name under Record Types:
Here is the updated Records Management Policy with above code block:
Add the qTest Test Step definition with the System qTest and Item Type test-step:
Here is the updated Records Management Policy with above code block:
Add the Record fields you want to include in Vera by adding the Fields section to the Record Type. Add the test step Description and Expected Result fields. Now we have a complete qTest Test Case record defined for any qTest Test Case that does not have a Tosca Automation Flag set:
Here is the updated Records Management Policy with above code block:
Create Automated Test Case Record Type
Add a Record Type Name for Tosca Test Case. Use the Base Record Type to inherit fields from another record. We will use the Base Record Type of qTest Test Case:
Here is the updated Records Management Policy with above code block:
Define the Record Type by System and Item Type. qTest is the System and the Item Type is test-case:
Here is the updated Records Management Policy with above code block:
Define the Record Author. The Record Author can be the Route Owner (the person who routed the record for approval) or by a record field:
Here is the updated Records Management Policy with above code block:
Add a Constraint to the definition to create unique Record Types. Identify any qTest Test Case that has Tosca automation flag as a Tosca Test Case using the Field Is Equal constraint:
Here is the updated Records Management Policy with above code block:
The completed JSON file above can be downloaded here:
Next we will add Test Runs to the Records Management Policy Add Test Run Records to Records Management Policy