例如,我有api“localhost:4000/ api /配准”,我想在单个测试用例中按这个api 10次
发布于 2022-03-03 14:25:49
使用房倒法Cypress._.times()
示例:
Cypress._.times(10, (k) => {
it(`register ${k + 1} times`, () => {
// here the test
})
})发布于 2022-03-03 17:59:00
你也可以喜欢这个,这是我用的样本,
const count = 10;
static pollAndWait(count) {
cy.testNetwork().then((response) => {
expect(response.status).to.eq(200);
if (response.body.resultSizeEstimate > 0 || count == 0) {
return;
}
else {
this.testNetwork(--count);
}
});
}https://stackoverflow.com/questions/71338715
复制相似问题