Skip to content

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

Update ClientPlaywrightTest.cs (#1404)

Leendert de Borstc40bba1c0b91
diff --git a/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs b/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs
index c0d8a51a7..e02dcc588 100644
--- a/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs
+++ b/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs
@@ -146,6 +146,33 @@ public class ClientPlaywrightTest : PlaywrightTest
Page = await Context.NewPageAsync();
InputHelper = new(Page);
+ // Set up page-level console logging (in addition to context-level)
+ Page.Console += (_, msg) =>
+ {
+ var type = msg.Type;
+ var text = msg.Text;
+
+ // Log all console messages to both Console and TestContext
+ var logMessage = $"[PAGE CONSOLE {type.ToUpper()}] {text}";
+ Console.WriteLine(logMessage);
+ TestContext.Progress.WriteLine(logMessage);
+
+ // Also write to stderr for errors to ensure visibility
+ if (type == "error")
+ {
+ Console.Error.WriteLine(logMessage);
+ }
+ };
+
+ // Log page errors
+ Page.PageError += (_, error) =>
+ {
+ var errorMessage = $"[PAGE EXCEPTION] {error}";
+ Console.WriteLine(errorMessage);
+ Console.Error.WriteLine(errorMessage);
+ TestContext.Progress.WriteLine(errorMessage);
+ };
+
// Check that we get redirected to /user/start when accessing the root URL and not authenticated.
await Page.GotoAsync(AppBaseUrl);
await WaitForUrlAsync("user/start");
diff --git a/apps/server/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs b/apps/server/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs
index db9bb40f9..e2fd01a44 100644
--- a/apps/server/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs
+++ b/apps/server/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs
@@ -198,6 +198,33 @@ public abstract class PlaywrightTest
var playwright = await Playwright.CreateAsync();
Browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions { Headless = headless });
Context = await Browser.NewContextAsync();
+
+ // Set up console message logging to help debug CI issues
+ Context.Console += (_, msg) =>
+ {
+ var type = msg.Type;
+ var text = msg.Text;
+
+ var logMessage = $"[CONTEXT CONSOLE {type.ToUpper()}] {text}";
+
+ // Write to multiple outputs to ensure visibility
+ Console.WriteLine(logMessage);
+ TestContext.Progress.WriteLine(logMessage);
+
+ if (type == "error")
+ {
+ Console.Error.WriteLine(logMessage);
+ }
+ };
+
+ // Log failed requests to help identify network issues
+ Context.RequestFailed += (_, request) =>
+ {
+ var failureMessage = $"[REQUEST FAILED] {request.Failure} - {request.Url}";
+ Console.WriteLine(failureMessage);
+ Console.Error.WriteLine(failureMessage);
+ TestContext.Progress.WriteLine(failureMessage);
+ };
}
/// <summary>