使用Testcafe比较网络日志和const

问题描述 投票:0回答:1

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

我想做的是:

  • 创建包含请求URL的一部分的const,获取特定日志
  • 从Chrome开发工具中的“网络”标签中(可能是过滤器)进行比较
  • 使用const记录以查看它是否包含相同的模式。

如果它们以相同的模式开头,则通过测试

testing automated-tests google-chrome-devtools e2e-testing testcafe
1个回答
0
投票
const logger = RequestLogger(new RegExp(`somestring`));

然后我用

await t.expect(logger.requests.length).eql(1);
© www.soinside.com 2019 - 2024. All rights reserved.