aquality-selenium-dotnet
aquality-selenium-dotnet copied to clipboard
Add possibility to use async/await in the tests
At the moment AquaityService uses ThreadLocal to keep AppContainer and ServiceProviderContainer instances. But it brings problems if you want to make your tests to be used in async context. To solve this we must use AsyncLocal instead https://learn.microsoft.com/en-us/dotnet/api/system.threading.asynclocal-1?view=net-8.0&redirectedfrom=MSDN
private static readonly ThreadLocal<TApplication> AppContainer = new ThreadLocal<TApplication>();
private static readonly ThreadLocal<IServiceProvider> ServiceProviderContainer = new ThreadLocal<IServiceProvider>();