Testcafe 在启用了 SIP 的 MacOS 映像上无法运行的事实是否有任何解决方案?

编程入门 行业动态 更新时间:2024-10-10 06:20:17
本文介绍了Testcafe 在启用了 SIP 的 MacOS 映像上无法运行的事实是否有任何解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

目前,我们使用 Github Actions 来运行我们的 Testcafe 套件,但问题是在 macos-latest 映像(即 10.15 Catalina)上运行 Safari 测试时出现以下错误:

Currently, we use Github Actions to run our Testcafe suites, but the problem is running Safari tests on the macos-latest image, which is 10.15 Catalina, gives the following error:

UnableToAccessScreenRecordingAPIError:查找窗口进程无法访问屏幕录制 API.

这是因为 MacOS 图像没有默认授予的权限.显然,您无法以编程方式处理此问题,并且在 10.15 Catalina 中启用了一项名为 SIP 的功能,可阻止您绕过它.这在此处讨论.

This is because MacOS images don't come with that permission granted by default. Apparently you can't handle this programmatically, and there's a feature called SIP that is turned on in 10.15 Catalina that stops you from getting around it. This is discussed here.

由于我们依赖 Github 提供图像,因此他们无法向我们提供所讨论的非 SIP 图像此处.提供的解决方法没有任何帮助.

Since we're relying on Github to provide images, they've not been able to provide us with a non-SIP image as discussed here. The workarounds provided there have been of no help.

还有其他想法吗?

推荐答案

正如您已经提到的,由于 MacOS 计算机上启用了 SIP,TestCafe 不会捕获屏幕截图并调整它们的大小.但是,可以使用远程模式,因为默认情况下禁用平台特定功能.您可以执行以下步骤:

As you already mentioned, TestCafe doesn't capture screenshots and resize them because of SIP enabled on machines with MacOS. However, it is possible to use the remote mode since the platform specific functionality is disabled by default. You can execute these steps:

testcafe remote test.js --hostname ${HOSTNAME} --ports ${PORT1},${PORT2} &
pid=$!
open -a Safari http://${HOSTNAME}:${PORT1}/browser/connect
wait $pid

这篇关于Testcafe 在启用了 SIP 的 MacOS 映像上无法运行的事实是否有任何解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 23:08:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1400912.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:映像   有任何   事实   解决方案   Testcafe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!