I'm trying to compare that values from UI are matched with json coming from the API response, using JSONPath in a Cypress test.
I want to get iPhone (refer Evaluation Result box) and want to compare it with the UI
Here's my test
cy.intercept('https://jsonpath.com/').as('test');
cy.visit('/');
var jp = require('jsonpath');
var names = jp.query('@test', '$.phoneNumbers[:1].type');
cy.get('@test').should((response) => {
cy.log(JSON.stringify(test));
The error I am getting is