Update e2e tests (#1695)

This commit is contained in:
Leendert de Borst
2026-03-28 07:13:27 +01:00
parent 3d1463e43b
commit 17554ebc3b
2 changed files with 46 additions and 0 deletions

View File

@@ -4,3 +4,5 @@ Business,,login,Item for business folder,,,0,,crisply,4CSp43uhSZri8A,
,,login,Test,,,0,,test2,asdasd,
Business,,login,TutaNota,,,0,,avtest2@tutamail.com,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,
1 folder favorite type name notes fields reprompt login_uri login_username login_password login_totp
4 login Test 0 test2 asdasd
5 Business login TutaNota 0 avtest2@tutamail.com blabla otpauth://totp/Strongbox?secret=PLW4SB3PQ7MKVXY2MXF4NEXS6Y&algorithm=SHA1&digits=6&period=30
6 Business login Aliasvault.net 0 https://www.aliasvault.net root toor
7 Work/Projects login WorkItem 0 https://work.example.com workuser workpass
8 Work/Projects/Active login ActiveItem 0 https://active.example.com activeuser activepass

View File

@@ -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");
}
}