From 25528bb1b3262956469272fb6a0ad98d4e48b251 Mon Sep 17 00:00:00 2001 From: Vergil Penkov <85731267+vergilfromadyen@users.noreply.github.com> Date: Fri, 13 May 2022 12:00:22 +0200 Subject: [PATCH] Don't require unnecessary OS permissions on MacOS 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. --- src/runner/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runner/index.js b/src/runner/index.js index 2da7d579b04..ffa4359f46a 100644 --- a/src/runner/index.js +++ b/src/runner/index.js @@ -318,11 +318,12 @@ export default class Runner extends EventEmitter { async _validateBrowsers () { const browsers = this.configuration.getOption(OPTION_NAMES.browsers); + const disableScreenshots = this.configuration.getOption(OPTION_NAMES.disableScreenshots); if (!browsers || Array.isArray(browsers) && !browsers.length) throw new GeneralError(RUNTIME_ERRORS.browserNotSet); - if (OS.mac) + if (OS.mac && !disableScreenshots) await this._checkRequiredPermissions(browsers); if (OS.linux && !detectDisplay())