Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update Playwright stability (#240)

Leendert de Borstc4e82205b61d
diff --git a/.github/workflows/dotnet-e2e-tests.yml b/.github/workflows/dotnet-e2e-tests.yml
index fd6ceb7c7..020a3d437 100644
--- a/.github/workflows/dotnet-e2e-tests.yml
+++ b/.github/workflows/dotnet-e2e-tests.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
+
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
@@ -30,19 +30,19 @@ jobs:
- name: Ensure browsers are installed
run: pwsh src/Tests/AliasVault.E2ETests/bin/Debug/net8.0/playwright.ps1 install --with-deps
- - name: Run AdminTests with retry
+ - name: Run ClientTests with retry
uses: nick-fields/retry@v3
with:
- timeout_minutes: 10
- max_attempts: 3
- command: dotnet test src/Tests/AliasVault.E2ETests --no-build --verbosity normal --filter "Category=AdminTests"
+ timeout_minutes: 10
+ max_attempts: 3
+ command: dotnet test src/Tests/AliasVault.E2ETests --no-build --verbosity normal --filter "Category=ClientTests"
- - name: Run ClientTests with retry
+ - name: Run AdminTests with retry
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
- command: dotnet test src/Tests/AliasVault.E2ETests --no-build --verbosity normal --filter "Category=ClientTests"
+ command: dotnet test src/Tests/AliasVault.E2ETests --no-build --verbosity normal --filter "Category=AdminTests"
- name: Run remaining tests with retry
uses: nick-fields/retry@v3
diff --git a/src/AliasVault.Admin/Program.cs b/src/AliasVault.Admin/Program.cs
index b792c0774..bfd397ca9 100644
--- a/src/AliasVault.Admin/Program.cs
+++ b/src/AliasVault.Admin/Program.cs
@@ -114,7 +114,7 @@ app.MapRazorComponents<App>()
using (var scope = app.Services.CreateScope())
{
var container = scope.ServiceProvider;
- var db = await container.GetRequiredService<IDbContextFactory<AliasServerDbContext>>().CreateDbContextAsync();
+ await using var db = await container.GetRequiredService<IDbContextFactory<AliasServerDbContext>>().CreateDbContextAsync();
await db.Database.MigrateAsync();
await StartupTasks.CreateRolesIfNotExist(scope.ServiceProvider);
diff --git a/src/Tests/AliasVault.E2ETests/Infrastructure/WebApplicationApiFactoryFixture.cs b/src/Tests/AliasVault.E2ETests/Infrastructure/WebApplicationApiFactoryFixture.cs
index b9d77fae8..c8d0e86ea 100644
--- a/src/Tests/AliasVault.E2ETests/Infrastructure/WebApplicationApiFactoryFixture.cs
+++ b/src/Tests/AliasVault.E2ETests/Infrastructure/WebApplicationApiFactoryFixture.cs
@@ -111,12 +111,9 @@ public class WebApplicationApiFactoryFixture<TEntryPoint> : WebApplicationFactor
SetEnvironmentVariables();
- builder.ConfigureServices((context, services) =>
+ builder.ConfigureServices(services =>
{
- // Remove existing registrations
RemoveExistingRegistrations(services);
-
- // Add new registrations
AddNewRegistrations(services);
});
}
@@ -138,9 +135,9 @@ public class WebApplicationApiFactoryFixture<TEntryPoint> : WebApplicationFactor
{
var descriptorsToRemove = new[]
{
- services.SingleOrDefault(d => d.ServiceType == typeof(ITimeProvider)),
services.SingleOrDefault(d => d.ServiceType == typeof(IDbContextFactory<AliasServerDbContext>)),
services.SingleOrDefault(d => d.ServiceType == typeof(DbContextOptions<AliasServerDbContext>)),
+ services.SingleOrDefault(d => d.ServiceType == typeof(ITimeProvider)),
};
foreach (var descriptor in descriptorsToRemove)
diff --git a/src/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs b/src/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs
index 2947e1a71..a8d488e0a 100644
--- a/src/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs
+++ b/src/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs
@@ -52,10 +52,14 @@ public class TwoFactorAuthLockoutTests : AdminPlaywrightTest
Assert.That(pageContent, Does.Contain("Sign in to"), "No login page visible after logout.");
// Login with username and password.
- await Page.Locator("input[id='username']").FillAsync(TestUserUsername);
- await Page.Locator("input[id='password']").FillAsync(TestUserPassword);
+ // Enter login credentials.
+ await InputHelper.FillInputFields(new Dictionary<string, string>
+ {
+ { "username", TestUserUsername },
+ { "password", TestUserPassword },
+ });
- submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Login to your account" });
+ submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Login" });
await submitButton.ClickAsync();
// Wait for 2FA page.