Data validation step definitions
JSON Path validations
The following step definitions require an additional understanding of the JSON structures and service transactions. For example, if a user wants to test a specific value that is located under persons and is a role type, they need the full path. The following path it’s only an example of how it looks a complex path : domainTree.persons[0].roleAssociations[1].attributes.RoleType
The steps on this page requires usage of a special variable called ${currentServiceTransactionUid}. This variable it’s a unique identification generated at the time of start of the service.
To acquire the path users can use the tool JSON Path (Gen) which will provide access to any path required for testing. This tool can be found on Svc Txn repository menu >

And selecting the record that want to validate and clicking on JSON PATH(GEN) tab.

Additional to this tool users can use Open Response with JSON element paths to get more information on path is they want to add additional validations when they see the test failures.

List of invididual Data validation actions
I retrieve (pending service transaction|active service transaction|email delivery logs|compliance workflow instances|service transaction workflow instances) with uid (.*)
Gets the service transaction stored with uid at the time of the request. For example, if a user executes the step after save and exit,
the service transaction will be that one generated after the save and exit. The uid will give you the snapshot version at the point of call.
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve pending service transaction with uid ${currentServiceTransactionUid}
And I expect JSON element status to be equal to pending
I create a variable called (.+) from JSON element (.+)
Creates a variable from a JSON element generated at the time of the retrieval
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve pending service transaction with uid ${currentServiceTransactionUid}
And I create a variable called testPdf from JSON element document.constitution
And I expect PDF testPDF to contain John Doe
I (expect|do not expect) JSON element (.) to (be equal to|start with|end with|contain) (.)
Validates that a specific JSON element equal/starts with/ends with/contains a value
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve pending service transaction with uid ${currentServiceTransactionUid}
And I expect JSON element status to be equal to pending
I (expect|do not expect) JSON element (.+) to exist
Validates that a specific JSON element exists or not
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve pending service transaction with uid ${currentServiceTransactionUid}
And I expect JSON element status to exists
JSON structure steps
Verne provides capabilities to validate a full/partial service transaction data via step definitions. This page contains the current list of supported step definitions. But before use this functionality you need to make sure the JSON structure is healthy and with the right format.

JSON Error debugging
If the JSON structure differs from the expected structure Magellan will provide a table structure where users can click any of the lines to navigate to the JSON file.
Line and Path: Clicking any of the links located under those rows will navigate the user to the JSON file and will locate the cursor on the line failing.

Compare JSON: Will open the system administration showing the visual differences to the user.

There are some additional tools like log viewer, open response with JSON paths, etc, that will help to the user to identify more core information if required.
List of Data validation actions
I retrieve (pending service transaction|active service transaction|email delivery logs|compliance workflow instances|service transaction workflow instances) with uid (.*)
Gets the service transaction stored with uid at the time of the request. For example, if a user executes the step after save and exit,
the service transaction will be that one generated after the save and exit. The uid will give you the snapshot version at the point of call.
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve pending service transaction with uid ${currentServiceTransactionUid}
And I compare service transaction against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/SaveAndExitTestSvcTxn.json
I (compare|strictly compare) (service transaction|email delivery logs|workflow instances) against (.*)
Compare: Compare the service transaction against different JSON templates.
Strictly compare: Compare the service transaction stored with uid at the time of the request. in strict mode, not only the value of each key have to be the same, but the order of the keys should
Note:#IGNORE#,#NONBLANK#,#UNORDERED# will not work on strict mode
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve active service transaction with uid ${currentServiceTransactionUid}
And I compare service transaction against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/SaveAndExitTestSvcTxn.json
I (compare|strictly compare) (pending service transaction|active service transaction|email delivery logs|compliance workflow instances|service transaction workflow instances) with uid (.) against (.)
Compare: Compare the service transaction stored with uid on a variable. This step is useful if a user stores different uid against different variables and wants to compare against different JSON templates
Strictly Compare: Compare the service transaction stored with uid at the time of the request. in strict mode, not only the value of each key have to be the same, but the order of the keys should.
Note:#IGNORE#,#NONBLANK#,#UNORDERED# will not work on strict mode
Example
And I click button Save and Exit
And I click button Yes,Save
#I saved the transaction
And I create a variable called C001SaveExit with value ${currentServiceTransactionUid}
And I click View for dashboard item Test Limited
And I click button Submit
#Now I'm on the Payment screen
And I create a variable called C001Payment with value ${currentServiceTransactionUid}
#Now I submit (The service has auto approve)
And I click button Submit
And I create a variable called C001Submit with value ${currentServiceTransactionUid}
And I compare pending service transaction with uid ${C001SaveExit} against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/C001SaveAndExitTestSvcTxn.json
And I compare pending service transaction with uid ${C001Payment} against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/C001Payment.json
And I compare active service transaction with uid ${C001Submit} against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/C001Submit.json
I strictly compare service transaction against (.*)
Compare the service transaction stored with uid at the time of the request. in strict mode, not only the value of each key have to be the same, but the order of the keys should also be the same.
Note:#IGNORE#,#NONBLANK#,#UNORDERED# will not work on strict mode
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve service transaction with uid ${currentServiceTransactionUid}
And I strictly compare service transaction against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/SaveAndExitTestSvcTxn.json
I strictly compare (pending|active) service transaction against (.*)
Compare the service transaction stored with uid at the time of the request. in strict mode, not only the value of each key have to be the same, but the order of the keys should also be the same.
Note:#IGNORE#,#NONBLANK#,#UNORDERED# will not work on strict mode
Example
And I click button Save and Exit
And I click button Yes,Save
And I retrieve service transaction with uid ${currentServiceTransactionUid}
And I strictly compare pending service transaction against com/fostermoore/catalyst/catapult/cluster/professionals/tests/hercules/tests/SaveAndExitTestSvcTxn.json

