Skip to content

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

Update e2e tests (#1695)

Leendert de Borst17554ebc3b67
diff --git a/apps/server/Tests/AliasVault.E2ETests/TestData/TestImportBitwarden.csv b/apps/server/Tests/AliasVault.E2ETests/TestData/TestImportBitwarden.csv
index b43c15745..80fbfa555 100644
--- a/apps/server/Tests/AliasVault.E2ETests/TestData/TestImportBitwarden.csv
+++ b/apps/server/Tests/AliasVault.E2ETests/TestData/TestImportBitwarden.csv
@@ -4,3 +4,5 @@ Business,,login,Item for business folder,,,0,,crisply,4CSp43uhSZri8A,
,,login,Test,,,0,,test2,asdasd,
Business,,login,TutaNota,,,0,,[email protected],blabla,otpauth://totp/Strongbox?secret=PLW4SB3PQ7MKVXY2MXF4NEXS6Y&algorithm=SHA1&digits=6&period=30
Business,,login,Aliasvault.net,,,0,https://www.aliasvault.net,root,toor,
+Work/Projects,,login,WorkItem,,,0,https://work.example.com,workuser,workpass,
+Work/Projects/Active,,login,ActiveItem,,,0,https://active.example.com,activeuser,activepass,
diff --git a/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard3/ImportTests.cs b/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard3/ImportTests.cs
index 1fdf429e2..b3f4e8f55 100644
--- a/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard3/ImportTests.cs
+++ b/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard3/ImportTests.cs
@@ -71,6 +71,9 @@ public class ImportTests : ClientPlaywrightTest
// Verify the Business folder was created.
Assert.That(pageContent, Does.Contain("Business"), "Business folder not created");
+ // Verify the Work folder was created (root of Work/Projects hierarchy).
+ Assert.That(pageContent, Does.Contain("Work"), "Work folder not created");
+
// Navigate to the Business folder by clicking on it.
await Page.ClickAsync("text=Business");
await Page.WaitForSelectorAsync("text=Item for business folder");
@@ -83,5 +86,46 @@ public class ImportTests : ClientPlaywrightTest
Assert.That(folderPageContent, Does.Contain("TutaNota"), "TutaNota item not imported in Business folder");
Assert.That(folderPageContent, Does.Contain("Aliasvault.net"), "Aliasvault.net item not imported in Business folder");
});
+
+ // Navigate back to root and test hierarchical folders.
+ await NavigateUsingBlazorRouter("items");
+ await WaitForUrlAsync("items", "Find all of your items");
+
+ // Debug: Print all folders visible on the page
+ var allFolders = await Page.Locator(".folder-item, [class*='folder']").AllTextContentsAsync();
+ Console.WriteLine($"All folders found: {string.Join(", ", allFolders)}");
+
+ // Debug: Print entire page content to see what's there
+ var debugContent = await Page.TextContentAsync("body") ?? string.Empty;
+ Console.WriteLine($"Page contains 'Work': {debugContent.Contains("Work")}");
+ Console.WriteLine($"Page contains 'Business': {debugContent.Contains("Business")}");
+
+ // Navigate to Work folder.
+ await Page.ClickAsync("text=Work"});
+ await Page.WaitForSelectorAsync("text=Projects");
+
+ // Verify Projects subfolder exists inside Work.
+ var workFolderContent = await Page.TextContentAsync("body") ?? string.Empty;
+ Assert.That(workFolderContent, Does.Contain("Projects"), "Projects subfolder not created under Work");
+
+ // Navigate into Projects subfolder.
+ await Page.ClickAsync("text=Projects");
+ await Page.WaitForSelectorAsync("text=WorkItem");
+
+ // Verify WorkItem is in the Projects folder.
+ var projectsFolderContent = await Page.TextContentAsync("body") ?? string.Empty;
+ Assert.Multiple(() =>
+ {
+ Assert.That(projectsFolderContent, Does.Contain("WorkItem"), "WorkItem not imported in Work/Projects folder");
+ Assert.That(projectsFolderContent, Does.Contain("Active"), "Active subfolder not created under Projects");
+ });
+
+ // Navigate into Active subfolder.
+ await Page.ClickAsync("text=Active");
+ await Page.WaitForSelectorAsync("text=ActiveItem");
+
+ // Verify ActiveItem is in the Active folder (3 levels deep: Work/Projects/Active).
+ var activeFolderContent = await Page.TextContentAsync("body") ?? string.Empty;
+ Assert.That(activeFolderContent, Does.Contain("ActiveItem"), "ActiveItem not imported in Work/Projects/Active folder");
}
}