https://cypress.io logo
Thanks <@814803272782577674> , I was able to make ...
# best-practices
b
Thanks @magnificent-finland-58048 , I was able to make it work via the below code
Copy code
js
beforeEach(() => {
    cy.intercept('POST', '/api/product/search')
        .as('postProdSearch')
})

it('navigate to order', function() {
    // ...

    cy.wait('@postProdSearch')
})

it('check order', function() {
    // ...

    cy.wait('@postProdSearch')
})
But is it a good practice to have a
cy.intercept()
code in the
beforeEach()
hook?