testing - 使用 TestCafe 和 Electron,有没有办法让 Electron 应用程序自行关闭而不会挂起 TestCafe?
问题描述
我需要从 Electron 应用程序 UI 中关闭我们的 Electron 应用程序。但是,当我这样做时,TestCafe 经常挂起,因为它很可能想要关闭应用程序本身并在内部执行某种清理。
我尝试了各种解决方案,包括破解 TestCafe 源本身以及在各种 after 和 afterEach 回调中关闭 UI,但没有找到可靠的解决方案。有时 TestCafe 会优雅地关闭,有时它会因错误而挂起:
ERROR The Electron 3.0.2 / Windows 10 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.
有没有一种方法可以让被测试的 Electron 应用程序自行关闭而不会挂起 TestCafe?任何帮助表示赞赏。
米
解决方案
推荐阅读
- java - 使用新的 Android Scoped Storage 将 exif 信息从一个 Uri 复制到另一个?
- c - 尝试了一个来自 ac 教程网站的例子有点弄错了
- rust - BTreeSet 包含值(使用自定义 Ord 实现)并错误地为 `contains` 返回 true
- python - 如何在 macOS 上以编程方式按名称打开应用程序?
- r - 通过 R 闪亮的 UI 对 posgresql 数据库进行多个查询
- regex - 当一个字符不是使用前缀的文件名中的前 8 个字符之一时,如何查找和替换字符?
- matlab-gui - 如何在 GUI MATLAB 中为静态文本框中的值分配颜色
- javascript - 我无法访问 react.createContext() 中的上下文功能
- css - 如何使用 css 使内容适合 div 框?
- python - 如何仅更改 repl.it 数据库中列表的一个值?