I been trying to make WebApplicationFactory<Program>
to start HTTP server to do end-to-end like testing. I have tried overriding various methods and trying to add kestrel to make it listen on HTTP TCP socket.
Most approaches online seem to be building custom WebHostBuilder and injecting Startup
class, but I am using minimal APIs, so Startup
class is not present for me.
By default WebApplicationFactory
seems to make test server that only works with a http client class and do not listen on HTTP port. As descried by question asked here.
And yes I need HTTP server, I am using Playwright to do testing. Or at last trying to.