You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Don't quit a web server started by Playwright if reuseExistingServer is true #26459
If I set webServer.reuseExistingServer to true, and the server is not running when I run Playwright, it starts the server for me using webServer.command.
However, the server then seems to exit after the tests complete; this prevents me from navigating in the browser window to use the VSCode extension's "Pick locator" command, and means the server has to be started every time I run a test — making reuseExistingServer somewhat irrelevant!
Changing the way reuseExistingServer works is probably not ideal, as there is bound to be somebody who relies on the current behaviour, but could there be a keepServerAlive option that would prevent any server started by Playwright from terminating when the tests complete?
It seems like you are using it for a development scenario, for that we assume that you run your dev server in a Terminal next to your tests. Then reuseExistingServer: true should just work and running an individual test is also faster (since no server needs to be started). Would that work for you?
I think the problem is that I need two servers running: a dev server, and a test server that uses a different API endpoint so the dev database doesn't continually get clobbered.
Ideally I'd like to start the dev server manually and have VSCode start the test server when I run a test, but then leave it running.
However, I've done a bit more research, and I think a dev container that starts the two servers automatically might be the best solution here.
Amazing, I'm closing it then for now as working as intended. For your scenario with two servers, and one which needs to get started for each test, I'd suggest, that you put only one into the webServer config of your playwright.config.ts and start the other one manually, this should give you the intended development experience.
Activity
mxschmitt commentedon Aug 14, 2023
It seems like you are using it for a development scenario, for that we assume that you run your dev server in a Terminal next to your tests. Then
reuseExistingServer: trueshould just work and running an individual test is also faster (since no server needs to be started). Would that work for you?unikitty37 commentedon Aug 15, 2023
I think the problem is that I need two servers running: a dev server, and a test server that uses a different API endpoint so the dev database doesn't continually get clobbered.
Ideally I'd like to start the dev server manually and have VSCode start the test server when I run a test, but then leave it running.
However, I've done a bit more research, and I think a dev container that starts the two servers automatically might be the best solution here.
mxschmitt commentedon Aug 17, 2023
Amazing, I'm closing it then for now as working as intended. For your scenario with two servers, and one which needs to get started for each test, I'd suggest, that you put only one into the webServer config of your playwright.config.ts and start the other one manually, this should give you the intended development experience.