Testcafe 测试未在 MacBook Big Sur 上执行,并出现 UnableToAccessScreenRecordingAPIError:

Jan*_*ara 4 testing automation automated-tests e2e-testing testcafe

即使设置了屏幕录制权限,在 MachBook Air 11.6.3 (20G405) 上,Testcafe 基本测试执行也会失败并出现错误。

重现步骤

  1. 创建基本测试
  2. 从命令行运行测试

testcafe chrome -e test_suite/tests/temp_test.ts

  1. 提示是否允许录屏

在此输入图像描述 4. 提供所需的权限

在此输入图像描述

即使授予权限后也会引发以下错误。

Using locally installed version of TestCafe.
TestCafe requires permission to record the screen. Open 'System Preferences > Security & Privacy > Privacy > Screen Recording' and check 'TestCafe Browser Tools' in the application list.

Press any key to retry.
ERROR UnableToAccessScreenRecordingAPIError: The find-window process cannot access the Screen Recording API.

Run Code Online (Sandbox Code Playgroud)

小智 5

请参阅TestCafe 文档中的指南它描述了如何解决 macOS 上的权限问题。