Angular 如何在cypress中拦截GetById?
我目前正在cypress中截取一个Get api,它工作正常:Angular 如何在cypress中拦截GetById?,angular,typescript,cypress,Angular,Typescript,Cypress,我目前正在cypress中截取一个Get api,它工作正常: cy.intercept('GET','/api/products', { body: list, }); 现在,我希望能够截获GetById-我尝试了下面的方法,但它不起作用,它仍然认为上面的代码是一个get all: cy.intercept('GET','/api/products/1234', { body: list, }); 有没有办法在cypress中截取带有参数的URL?为了解决这个问题,我必须更
cy.intercept('GET','/api/products', {
body: list,
});
现在,我希望能够截获GetById-我尝试了下面的方法,但它不起作用,它仍然认为上面的代码是一个get all:
cy.intercept('GET','/api/products/1234', {
body: list,
});
有没有办法在cypress中截取带有参数的URL?为了解决这个问题,我必须更新到cypress 7.0.1。在最新版本的cypress中,url的检查更加严格