我正在使用 Protractor 编写测试。如果我在测试中输入以下代码,我就可以进入调试器:
browser.pause();
但是,我无法退出调试器并恢复测试执行。 根据this documentation :
When you finish debugging, exit by pressing Ctrl-C. Your tests will continue where they left off, using the same browser.
实际上,即使调试器本身在暂停时也告诉我同样的信息:
------- WebDriver Debugger -------
ready
press c to continue to the next webdriver command
press d to continue to the next debugger statement
type "repl" to enter interactive mode
type "exit" to break out of interactive mode
press ^C to exit
这一切听起来不错,但是当我尝试 Ctrl-C 时,它会中断整个测试。我做错了什么?
我正在 Windows 7 上使用 grunt-protractor-runner@1.2.1 运行 Protractor 测试。
最佳答案
正如消息中所述,您可以使用
press d to continue to the next debugger statement
整个套件将继续执行,直到遇到另一个调试器调用(因此您必须再按“d”一次)或直到套件的最后。
注意:按 d
实际上意味着您输入字母“d”并按“Enter”
关于debugging - 如何从调试器恢复而不中断 Protractor 中的整个测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31406948/