mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-04-03 22:44:49 -04:00
Update e2e tests (#1695)
This commit is contained in:
@@ -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,
|
||||
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user