Set up working environment
To make playwright work locally you must run the following powershell command from the ‘PlaywrightTests’ project : pwsh bin/Debug/net6.0/playwright.ps1 install
More here https://playwright.dev/dotnet/docs/intro
Toggling fake authentication
*NOTE: This step is already done and deployed to rsig-playwright.azure.net , but will be important to run the tests locally in the future *
In order to test with playwright we must fake an authenticated user. This can be done with the FakeAuthenticationStateProvider class within our codebase.
The following changes must be made to program.cs:
Remove the following line:
options.FallbackPolicy = options.DefaultPolicy;
Add the following line anywhere in the file before “app.UseAuthentication()” :
builder.Services.AddScoped<AuthenticationStateProvider, FakeAuthenticationStateProvider>();