Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(install): check macOS version to be 10.14 or higher (#671)

Pavel Feldman6e4bf9561bd3
diff --git a/src/server/webkit.ts b/src/server/webkit.ts
index 126f610143..9d6a8cc55d 100644
--- a/src/server/webkit.ts
+++ b/src/server/webkit.ts
@@ -224,9 +224,11 @@ const mkdtempAsync = platform.promisify(fs.mkdtemp);
const WEBKIT_PROFILE_PATH = path.join(os.tmpdir(), 'playwright_dev_profile-');
let cachedMacVersion: string | undefined = undefined;
-function getMacVersion() {
+
+function getMacVersion(): string {
if (!cachedMacVersion) {
const [major, minor] = execSync('sw_vers -productVersion').toString('utf8').trim().split('.');
+ assert(+major === 10 && +minor >= 14, 'Error: unsupported macOS version, macOS 10.14 and newer are supported');
cachedMacVersion = major + '.' + minor;
}
return cachedMacVersion;