Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't require unnecessary OS permissions on MacOS #7028

Closed
wants to merge 1 commit into from
Closed

Don't require unnecessary OS permissions on MacOS #7028

wants to merge 1 commit into from

Conversation

vergilfromadyen
Copy link
Contributor

@vergilfromadyen vergilfromadyen commented May 13, 2022

Purpose

Makes it so that disabling screenshots doesn't trigger a permission request for screen recording on MacOS Monterey. This lets users who don't have access to changing permissions still use TestCafe when the permission is not necessary.

Approach

Changes the validateBrowsers method to not request extra permissions when screenshots are disabled on MacOS

References

Resolves #7019.

I'm sorry I couldn't update the tests but they don't seem to pass with or without my changes as noted in #7029. This also meant I couldn't really write test-cases.

Resolves #7019.   
Makes it so that disabling screenshots doesn't trigger a permission request for screen recording on MacOS Monterey. This lets users who don't have access to changing permissions still use TestCafe when the permission is not necessary.
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 13, 2022
@vergilfromadyen vergilfromadyen temporarily deployed to CI May 13, 2022 10:00 Inactive
@vergilfromadyen vergilfromadyen marked this pull request as ready for review May 13, 2022 13:13
@miherlosev miherlosev added the STATE: PR Review Pending A note that this PR will be reviewed. label May 16, 2022
@github-actions
Copy link

Thank you for your contribution to TestCafe. We will review this PR.

@github-actions github-actions bot removed STATE: Need response An issue that requires a response or attention from the team. STATE: PR Review Pending A note that this PR will be reviewed. labels May 16, 2022
@AndreyBelym
Copy link
Contributor

Thank you for your contribution. I discussed the related issues with the team and there are some things we should discuss before accepting this PR and reviewing it.

First of all, the Screen Recording permission isn't the only permission required to run TestCafe on macOS. When TestCafe starts a browser, the OS will ask a user for the Automation permission. Without it, we cannot even open a Safari window without it: https://github.com/DevExpress/testcafe-browser-tools/blob/88b97b77e583d79088ea6b5a48c9c5f75d41711e/src/natives/open/mac/open.m#L15

It is also required for window management tasks in all browsers (focusing, resizing) and querying some system information (like the size of a browser window).

So since avoiding the Screen Recording permission only won't help you much, we do not plan to accept this PR for now. We also do not intend to introduce additional flags to disable additional functionality, since the disabled functionality could be critical for TestCafe (like opening Safari windows). We think that the most viable approach is using the Safari WebDriver and native browser debugging protocols to control browsers on macOS. But since it will require a lot of time for research and implementation, we cannot give any estimates about this feature for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestCafe requires screen capture permission on MacOS when disableScreenshots is true
3 participants