Request interception with nightwatch/axios

37 views Asked by At

I want to intercept a request and then get some values from it and store into my variables

I did it with cypress and I want it to be like this

cy.intercept('*', (req) => {
   req.headers['Authorization'] = `Token ${Cypress.env('auth')}`;
});

Or like this

cy.intercept('POST', 'api/users').as('register');

I read that nightwatch doesn't have it, so I decided to use axios, but I can't find working method to intercept a query.

So I need to intercept specific query, I know the HTTP method and request url, how can I do it?

0

There are 0 answers