Skip to content

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

Update BrowserExtensionPlaywrightTest.cs (#1274)

Leendert de Borstaf384ff6d16b
diff --git a/apps/server/Tests/AliasVault.E2ETests/Common/BrowserExtensionPlaywrightTest.cs b/apps/server/Tests/AliasVault.E2ETests/Common/BrowserExtensionPlaywrightTest.cs
index dbe2b77d4..bfc1b2519 100644
--- a/apps/server/Tests/AliasVault.E2ETests/Common/BrowserExtensionPlaywrightTest.cs
+++ b/apps/server/Tests/AliasVault.E2ETests/Common/BrowserExtensionPlaywrightTest.cs
@@ -8,6 +8,7 @@
namespace AliasVault.E2ETests.Common;
using AliasVault.E2ETests.Tests.Extensions;
+using Microsoft.Extensions.Configuration;
using Microsoft.Playwright;
/// <summary>
@@ -23,6 +24,16 @@ public class BrowserExtensionPlaywrightTest : ClientPlaywrightTest
/// <returns>Task.</returns>
protected override async Task SetupPlaywrightBrowserAndContext()
{
+ // Set Playwright headless mode based on appsettings.json value.
+ var configuration = new ConfigurationBuilder()
+ .SetBasePath(Directory.GetCurrentDirectory())
+ .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
+ .AddJsonFile($"appsettings.Development.json", optional: true, reloadOnChange: true)
+ .AddEnvironmentVariables()
+ .Build();
+
+ bool headless = configuration.GetValue("PlaywrightSettings:Headless", true);
+
// Make sure the extension is built and ready to use.
ExtensionSetup();
@@ -33,7 +44,8 @@ public class BrowserExtensionPlaywrightTest : ClientPlaywrightTest
userDataDir: string.Empty, // Empty string means temporary directory
new BrowserTypeLaunchPersistentContextOptions
{
- Headless = false,
+ Channel = "chromium",
+ Headless = headless,
Args = new[]
{
"--disable-extensions-except=" + _extensionPath,