https://cypress.io logo
I have an issue with Intercept: ```javascript it(...
# e2e-testing
h
I have an issue with Intercept:
Copy code
javascript
it('Save the business rule', () => {
    cy.intercept({ method: 'POST', url: `${Cypress.env('API_URL')}/api/v1/company/*/businessRule?cache_buster=*` }).as('businessRule');
    cy.el('btnSaveBusinessRule').click();
    cy.get('@businessRule').should((response: any) => {
        cy.wait(50).then(() => {
            expect(response.response.statusCode).to.eq(200);
        });
    });
});
response.response.statusCode
gives the error
cannot read undefined of statusCode
. For some reason the
response
object is empty unless I add a
wait
like I did above.