happy-dinner-13480
08/11/2022, 12:14 PMjavascript
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.