使用 Testcafe 将网络日志与 const 进行比较

Compare Network logs with const using Testcafe

我正在尝试查看当我向下滚动页面时是否触发了请求。 由于时间戳,我无法使用 RequestURL。我知道有 RequestLogger.

我想做的是:

如果他们以相同的模式开始通过测试

好的伙计们。这是一个解决方法:

const logger = RequestLogger(new RegExp(`somestring`));

那我用

await t.expect(logger.requests.length).eql(1);