在 Safari 浏览器上运行 TestCafe 测试所需的设置

ago*_*off 1 testing safari automated-tests e2e-testing testcafe

我正在尝试在本地安装的 Safari 上执行 TestCafe 套件。我之前已经在 chrome、chrome:headless、firefox 和 firefox:headless 上执行过测试。当运行命令testcafe --list-browsers来检索已安装浏览器的列表时,我收到以下信息:

testcafe --list-browsers
Using locally installed version of TestCafe.
firefox
chrome
safari
Run Code Online (Sandbox Code Playgroud)

当我通过命令行执行简单测试时testcafe safari path/to/tests/,Safari 浏览器将启动,但不会发生导航。我保留在启动窗口上(显示我最喜欢的页面和最近访问的页面)。当对不同的浏览器(例如,)执行相同的命令时testcafe chrome path/to/tests/,测试将在本地浏览器中执行。

我是否缺少启动 Safari 并与 TestCafe 一起运行所需的东西?我正在使用 TestCafe 版本1.6.1。我没有看到 TestCafe 文档中提到的任何其他设置......

ago*_*off 5

我能够通过禁用TestCafe Browser Toolsin的所有使用来解决此问题System Preferences -> Security & Privacy -> Privacy -> Automation。在随后的执行中,系统提示我允许适用于 Safari 的 TestCafe 浏览器工具。接受提示后,测试按预期运行。

我还删除了我的node_modules目录并重新安装了依赖项,尽管我怀疑这是否有帮助。