mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 08:28:39 +00:00
Fix race condition in test
This commit is contained in:
parent
5059d31c69
commit
3f15930d61
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,11 @@ public class AuthenticationTests : LighthouseWebTest
|
|||
string password = CryptoHelper.Sha256Hash(CryptoHelper.GenerateRandomBytes(64).ToArray());
|
||||
UserEntity user = await database.CreateUser($"unitTestUser{CryptoHelper.GenerateRandomInt32()}", CryptoHelper.BCryptHash(CryptoHelper.Sha256Hash(password)));
|
||||
|
||||
this.Driver.Navigate().GoToUrl(this.BaseAddress + "/login");
|
||||
// Sometimes not having this causes a race condition
|
||||
// ReSharper disable once MethodHasAsyncOverload
|
||||
database.SaveChanges();
|
||||
|
||||
await this.Driver.Navigate().GoToUrlAsync(this.BaseAddress + "/login");
|
||||
|
||||
this.Driver.FindElement(By.Id("text")).SendKeys(user.Username);
|
||||
this.Driver.FindElement(By.Id("password")).SendKeys(password);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue