我在自动化测试中写了 wait on 3 个不同的请求,但每次运行测试时,等待函数都会对其中一个请求起作用。
cy
.intercept('POST', '**/api/Availability')
.as('availabilecheck');
cy
.wait('@availabilecheck')
.its('response.statusCode')
.should('eq', 200)
Run Code Online (Sandbox Code Playgroud)
///////////////////////////////////////////////////////////////////////
cy
.intercept('POST','**/api/Availability/GetPrice')
.as('getpricecheck');
cy
.wait('@getpricecheck')
.its('response.statusCode')
.should('eq', 200);
Run Code Online (Sandbox Code Playgroud)
///////////////////////////////////////////////////////
cy.intercept('POST','**/api/Member/Find')
.as('memberresponse')
cy.wait('@memberresponse')
Run Code Online (Sandbox Code Playgroud)
我为 3 个不同的请求编写了上述代码,但每次运行测试时,其中一个请求实际上正在等待,而另外 2 个请求则失败。
我应该怎么办?