question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Find a way to run TestCafe on macOS without requiring Screen Capture and Automation permissions

See original GitHub issue

What is your Scenario?

I want to run testcafe on a Github Actions macOS 10.15 instance

What is the Current behavior?

Regardless of passing --disable-screenshots and using headless browsers, and not enabling video, testcafe requires the screen recording permission, which there’s no clear way to grant from the command line, only the UI

ERROR UnableToAccessScreenRecordingAPIError: The find-window process cannot access the Screen Recording API.
    at runFindWindowBinary (/Users/runner/work/learn-something/learn-something/node_modules/testcafe-browser-tools/src/api/find-window.js:36:19)
    at Object.default_1 (/Users/runner/work/learn-something/learn-something/node_modules/testcafe-browser-tools/src/api/find-window.js:43:15)
    at checkAuthentication (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/cli/authentication-helper.ts:28:26)
    at Object.authenticationHelper [as default] (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/cli/authentication-helper.ts:43:29)
    at Runner._checkRequiredPermissions (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/runner/index.js:530:27)
    at Runner._validateBrowsers (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/runner/index.js:304:13)
    at Runner._validateRunOptions (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/runner/index.js:461:9)

Type "testcafe -h" for help.

What is the Expected behavior?

When screenshots are disabled and video is not enabled, the screen recording permission should not be required

What is your public website URL? (or attach your complete example)

https://learnsomething.app

What is your TestCafe test code?

n/a, happens with any tests

Your complete configuration file

testcafe --config-file ./testcafe.ci.json safari:headless ./e2e/*.test.ts

testcafe.ci.json:

{
    "disableScreenshots": true
}

Your complete test report

ERROR UnableToAccessScreenRecordingAPIError: The find-window process cannot access the Screen Recording API.
    at runFindWindowBinary (/Users/runner/work/learn-something/learn-something/node_modules/testcafe-browser-tools/src/api/find-window.js:36:19)
    at Object.default_1 (/Users/runner/work/learn-something/learn-something/node_modules/testcafe-browser-tools/src/api/find-window.js:43:15)
    at checkAuthentication (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/cli/authentication-helper.ts:28:26)
    at Object.authenticationHelper [as default] (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/cli/authentication-helper.ts:43:29)
    at Runner._checkRequiredPermissions (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/runner/index.js:530:27)
    at Runner._validateBrowsers (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/runner/index.js:304:13)
    at Runner._validateRunOptions (/Users/runner/work/learn-something/learn-something/node_modules/testcafe/src/runner/index.js:461:9)

Type "testcafe -h" for help.
ERROR: "test:e2e:safari:headless" exited with 1.
ERROR: "test:e2e:ci:mac" exited with 1.
Error: Process completed with exit code 1.

Screenshots

No response

Steps to Reproduce

  1. Run testcafe on a macOS 10.15 instance in Github Actions

TestCafe version

1.17.1

Node.js version

v15.3.0

Command-line arguments

–config-file ./testcafe.ci.json safari:headless ./e2e/*.test.ts

Browser name(s) and version(s)

Safari, not sure of the version

Platform(s) and version(s)

macOS 10.15 in Github Actions

Other

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
roelvandijk88commented, Dec 30, 2021

It’s working again with the v1.18.0 upgrade instructions. My studio isn’t working but that should be fixed with the release of 1.7.0. Thanks for the help 😃

2reactions
AlexanderMoiseevcommented, Dec 23, 2021

Hi,

Thank you for your input. We have reproduced the problem. Please stay tuned.

Note for team - reproducible on Intel machine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grant or Fix TestCafe Permissions on macOS | Recipes | Docs
Follow these instructions if you have a new installation of TestCafe. Step 1. Run TestCafe. Launch TestCafe. If you don't have a TestCafe...
Read more >
Testcafe tests are not executed on MacBook Big Sur with ...
TestCafe requires permission to record the screen. Open 'System Preferences > Security & Privacy > Privacy > Screen Recording' and check ' ...
Read more >
Test Configuration Options - Sauce Labs Documentation
An index of automation test configuration settings compatible with Sauce Labs test protocols.
Read more >
TestCafe Webinar - Your Questions Answered
TestCafe does not require browser plugins, SDKs or other tools and ... You can find information how to run tests in parallel in...
Read more >
Run TestCafe tests on internal networks | BrowserStack Docs
You do not need to make any separate arrangements to run any locally hosted website. You can simply specify the localhost URL and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found