Hi there, if I want to use this code to check my scripts requests are loaded or not, anyone has an idea how to do it better or maybe add more checks for it like check if other scripts are also loading and so on. thanks
describe('Intercept my scripts', () => {
before (() => {
cy.visit('https://mydomain.com)
})
it('Intercept - Heatmap script request', () => {
cy
.intercept({
method: 'GET',
url: '/v1/myscipt.js',
})
.as('myscript.js');
cy
.wait('@myscript.js')
.then((myscript) => {
expect(myscript.response.statusCode).to.eq(200, 'myscript.js is loaded');
});
});