赛普拉斯中的暂停和调试有什么区别

What is the difference between pause and debug in Cypress

从 API 看来 pause and debug 很相似。到底有什么不同?

差异已在文档中解释。

暂停

This does not set a debugger in your code, unlike .debug()

调试

You need to have your Developer Tools open for .debug() to hit the breakpoint.

两者都是来自 cypress 包的实用命令,可以以相同的方式执行(链接 cy 或关闭另一个命令)并且没有超时期限。但差异是:

  • pause() 将停止测试执行以检查 Web 应用程序、DOM、网络,而 debug() 将仅在开发人员工具打开时停止
  • pause() 不提供任何调试信息,而 debug() 在浏览器控制台选项卡中提供详细信息
  • 使用 pause() 我们可以在测试运行器中找到 'next' 按钮选项,它允许我们逐步执行代码,debug() 没有这个功能。