【发布时间】:2021-09-06 09:43:42
【问题描述】:
我在单击元素时会调用以下服务。我需要拦截端点中没有f0000000000 的请求。
https://example.com/f0000000000/path1 - GET
https://example.com/f0000000000/path1 - GET
https://example.com/f0000000000/path1 - GET
https://example.com/f0000000000/path1 - GET
https://example.com/f0000000000/path1 - GET
https://example.com/f0000000000/path1 - GET
https://example.com/f2021090606/path1 - GET
我们如何在 cypress 中实现这一点?我们有类似的选择吗?
cy.intercept("GET", "**/NOT(f0000000000)/path1*").as('getForecast');
cy.get('#some').click();
cy.wait('@getForecast').its('response.statusCode').should('eq', 200)
});
【问题讨论】:
标签: cypress