I want to check mixpanel events, so for this I intercept request with wanted url and I want after specific lines of code assert that right thing was printed in the console
Here is my code:
browser
.captureNetworkRequests((requestParams) => {
if (requestParams.request.method === 'POST' && requestParams.request.url === tEventUrl) {
const postData = requestParams.request.postData;
const dataObject = JSON.parse(postData);
console.log('t Event: ', dataObject.event);
}
});
So during the code some t Events are triggered and sent, I just want to assert that their text matches what I expect.
Or maybe there is some other way to assert it without checking the terminal output
I found nightwatch getLog method, but from what I see it reacts to the browser console, not the one in my IDE