Replies: 1 comment 2 replies
-
TestServer is entirely in memory, so it's not listening on any port an external process like a browser can access. You can build on top of There's an example of how you can do that in this sample repo of mine: https://github.com/martincostello/dotnet-minimal-api-integration-testing |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When we're using an in-memory
TestServer
, how does theHttpClient
returned fromCreateClient
orCreateDefaultClient
work?When doing UI testing via Playwright, we can't just navigate to localhost, because it's not actually running a server AFAIK and the only way to talk to it is through that HttpClient?
The workarounds online are instead not using the test server, and actually running Kestrel locally, which kinda defeats the purpose I feel?
I raised a feature request to allow us to resolve requests in Playwright via a custom HttpClient, but I don't know if that'll happen: microsoft/playwright-dotnet#3089
It'd be nice to run through UI tests via a browser, while still using the TestServer and not having to spin up a real server.
Beta Was this translation helpful? Give feedback.
All reactions