我在自动化测试中针对3个不同的请求编写了等待函数,但每次运行测试时,其中一个请求上的等待函数会失效。
cy
.intercept('POST', '**/api/Availability')
.as('availabilecheck');
cy
.wait('@availabilecheck')
.its('response.statusCode')
.should('eq', 200)
////////////////////////////////////////
cy
.intercept('POST','**/api/Availability/GetPrice')
.as('getpricecheck');
cy
.wait('@getpricecheck')
.its('response.statusCode')
.should('eq', 200);
////////////////////////////
cy.intercept('POST','**/api/Member/Find')
.as('memberresponse')
cy.wait('@memberresponse')
我为三个不同的请求编写了上述代码,但每次运行测试时,其中一个请求实际上会等待,而其他两个请求则会失败。
我该怎么办?