As a newcomer to Playwright, my focus is on writing API tests in TypeScript with an API response structured like this:
{
"id" : "abc123",
"appCode" : "09000007",
"applicationReference" : "ABCDEF",
"datetimeSubmitted" : "2023-03-09T17:56:28.912876Z",
"firstName" : "ABC",
"surname" : "DEF",
"lastAddress" : {
"street" : "9779 Pat Loaf",
"property": "2"
}
}
I am seeking guidance on how to validate the JSON schema within the response JSON using TypeScript in the Playwright framework.
Specifically, I wish to verify if the response JSON includes:
id, appCode, applicationReference, datetimeSubmitted, firstname, surname, lastAddress.street, lastAddress.property
Could you suggest any methods or third-party plugins that can assist in conducting such tests with Playwright?
Your assistance would be greatly appreciated.