From ce0f2c7e4afa67da1b9371e0201bfda46ffceb13 Mon Sep 17 00:00:00 2001
From: Dan Grebb <dan@dgrebb.com>
Date: Sun, 26 Nov 2023 13:38:20 -0500
Subject: [PATCH] fix(playwright): adds npx playwright install to playwright
 npm scripts

playwright apparently refuses to self-install browsers in certain situations, so let's make sure to `npx playwright install` before attempting any tests.
---
 package.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package.json b/package.json
index dcb9c88d9..55dddc034 100644
--- a/package.json
+++ b/package.json
@@ -23,11 +23,11 @@
     "dev-compare": "webpack-dev-server --content-base ./compare/output --config ./compare/webpack.config.js",
     "integration-test": "rm -rf newdir && mkdir newdir && cd newdir && node ../cli/index.js init && node ../cli/index.js reference && node ../cli/index.js test && node -e \"require('../')('test')\"",
     "smoke-test": "cd test/configs/ && node ../../cli/index.js test --config=backstop_features",
-    "smoke-test-playwright": "cd test/configs/ && node ../../cli/index.js test --config=backstop_features_pw",
+    "smoke-test-playwright": "npx playwright install && cd test/configs/ && node ../../cli/index.js test --config=backstop_features_pw",
     "smoke-test-docker": "cd test/configs/ && node ../../cli/index.js test --config=backstop_features --docker",
     "smoke-test-docker-playwright": "cd test/configs/ && node ../../cli/index.js test --config=backstop_features_pw --docker",
     "sanity-test": "cd test/configs/ && node ../../cli/index.js test",
-    "sanity-test-playwright": "cd test/configs/ && node ../../cli/index.js test --config=playwright",
+    "sanity-test-playwright": "npx playwright install && cd test/configs/ && node ../../cli/index.js test --config=playwright",
     "sanity-test-docker": "cd test/configs/ && node ../../cli/index.js test --docker",
     "sanity-test-playwright-docker": "cd test/configs/ && node ../../cli/index.js test --config=playwright --docker",
     "kill-zombies": "pkill -f \"(chrome)?(--headless)\"",