How to Use WebApplicationFactory with Testcontainers for SpecFlow Tests?
I’m working on a .NET project where I want to integrate WebApplicationFactory with Testcontainers to use PostgreSQL for my SpecFlow tests. I’m facing some challenges ensuring that the PostgreSQL container is started and ready before the application configuration is applied. I want to ask first if this is feasible in the first place? My biggest challenge is configuring and using the context, it is not working. Can I inject any service I wanr with WebHostFactory? Here’s what I’ve tried so far: