In Network Calls we have a request url https://xyz.com.testqa.com/site/v3/userPref/
There is a different tab for payload where i want to validate action id in below json
c: 5232
d: {noticeId: 32029, companyId: 5232, actionId: 11, regulationId: 2, regulationType: 1,
consentGiven: 1,…}
actionId: 11
I am able to assert status code for above url using below code:
cy.intercept('POST','privacycollector.test.com/site/v3/userPref/',(req) => { }).as('getSettings')
cy.wait('@getSettings').then(({ response }) => { expect(response.statusCode).to.eq(204) })
cy.wait('@getSettings').then(({ request }) => { const requestBody = request.body cy.log(requestBody) })
but i am not able to validate json in request payload.
These calls are coming in network tab