mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-10 22:08:39 +00:00
Merge branch 'main' into mod-panel
This commit is contained in:
commit
ea25751e71
136 changed files with 4358 additions and 161 deletions
|
@ -9,14 +9,14 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.7">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="Selenium.WebDriver" Version="4.2.0" />
|
||||
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="101.0.4951.4100" />
|
||||
<PackageReference Include="Selenium.WebDriver" Version="4.3.0" />
|
||||
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="103.0.5060.13400" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
|
|
@ -78,7 +78,7 @@ public class AuthenticationTests : LighthouseWebTest
|
|||
[DatabaseFact]
|
||||
public async Task ShouldLoginWithInjectedCookie()
|
||||
{
|
||||
const string loggedInAsUsernameTextXPath = "/html/body/div/div/div/p[1]/b";
|
||||
const string loggedInAsUsernameTextXPath = "/html/body/div/div/div/p[1]";
|
||||
|
||||
await using Database database = new();
|
||||
Random random = new();
|
||||
|
@ -96,10 +96,10 @@ public class AuthenticationTests : LighthouseWebTest
|
|||
INavigation navigation = this.Driver.Navigate();
|
||||
|
||||
navigation.GoToUrl(this.BaseAddress + "/");
|
||||
Assert.DoesNotContain(user.Username, this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text);
|
||||
this.Driver.Manage().Cookies.AddCookie(new Cookie("LighthouseToken", webToken.UserToken));
|
||||
Assert.Throws<NoSuchElementException>(() => this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)));
|
||||
navigation.Refresh();
|
||||
Assert.True(this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text == user.Username);
|
||||
Assert.Contains(user.Username, this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text);
|
||||
|
||||
await database.RemoveUser(user);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue