Are there any solutions to the fact that Testcafe doesn't work on MacOS images with SIP enabled?

Viewed 935

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: The find-window process cannot access the Screen Recording API.

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.

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.

Any other ideas?

1 Answers

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
Related