From 6792b5e84dc0d029ca842143f2403b5f044c98f4 Mon Sep 17 00:00:00 2001 From: Matthew Griffin Date: Fri, 14 Jun 2024 13:52:13 +0100 Subject: [PATCH] Use cross platform method of running npm Ensure server is terminated on interrupt --- playwright/tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playwright/tests/conftest.py b/playwright/tests/conftest.py index a1ce0a81..66a3c25a 100644 --- a/playwright/tests/conftest.py +++ b/playwright/tests/conftest.py @@ -1,4 +1,5 @@ import pytest +import shutil from xprocess import ProcessStarter @pytest.fixture(autouse=True, scope="session") @@ -8,7 +9,9 @@ class Starter(ProcessStarter): pattern = "Application bundle generation complete." # command to start process - args = ['sh', 'npm', 'start'] + args = [shutil.which('npm'), 'start'] + + terminate_on_interrupt = True # ensure process is running and return its logfile logfile = xprocess.ensure("estimator", Starter)