test_script: Run Puppeteer install.js in its own cwd.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-10-07 16:01:50 -07:00 committed by Tim Abbott
parent 0027d7dea7
commit 9cb908682b
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ def prepare_puppeteer_run(is_firefox: bool = False) -> None:
os.environ["PUPPETEER_DOWNLOAD_PATH"] = download_path
# This will determine if the browser will be firefox or chrome.
os.environ["PUPPETEER_PRODUCT"] = "firefox" if is_firefox else "chrome"
subprocess.check_call(["node", "node_modules/puppeteer/install.js"])
subprocess.check_call(["node", "install.js"], cwd="node_modules/puppeteer")
os.makedirs("var/puppeteer", exist_ok=True)
for f in glob.glob("var/puppeteer/failure-*.png"):
os.remove(f)