Kris__
❔ Blazor webassembly app hosted ASP.NET Core 7 test with WebApplicationFactory
I have a Blazor webassembly app hosted in ASP.NET Core 7 that I want to run some tests on.
I'm trying to swap out the authentication setup (azure b2c) with a in memory version of IdentityServer while testing.
I'm able to start the host using WebApplicationFactory and modify the services.
protected override void ConfigureWebHost(IWebHostBuilder builder)
But I need to apply some changes to the Blazor Webassembly client before I start the server.
I can't figure out how to access the builder object in the Webassembly Program.cs.
You can find my code at https://github.com/kristiangronli/BlazorWebAssemblyWithPlaywright
My WebApplicationFactory is in the directory test -> XunitPlaywright -> Auth -> IndividualAuthWebApplicationFactory.cs
Any help would be very much appreciated.2 replies