There are many posts around Playwright .NET. These cover set up and running it against hosted sites.
What I didn’t find many posts on, was running Playwright .NET using Microsofts WebApplicationFactory. Why? Because it isn’t as simple as implementing the WebApplicationFactory with Playwright .NET and hitting run.
I’ll show how you can create a CustomWebApplicationFactory that will allow you to run your Playwright .NET tests locally using the WebApplicationFactory in .NET 6.