Skip to content

Build your personal knowledge base with Trilium Notes

e2e(support): failing after changes in mobile structure

Elian Doran34f09ae6571a
diff --git a/packages/trilium-e2e/src/support/app.ts b/packages/trilium-e2e/src/support/app.ts
index b8f4215af2..5b34eeca51 100644
--- a/packages/trilium-e2e/src/support/app.ts
+++ b/packages/trilium-e2e/src/support/app.ts
@@ -21,7 +21,6 @@ export default class App {
readonly context: BrowserContext;
readonly tabBar: Locator;
- readonly noteTree: Locator;
readonly noteTreeActiveNote: Locator;
readonly noteTreeHoistedNote: Locator;
readonly launcherBar: Locator;
@@ -36,9 +35,9 @@ export default class App {
this.context = context;
this.tabBar = page.locator(".tab-row-widget-container");
- this.noteTree = page.locator(".tree-wrapper");
- this.noteTreeActiveNote = this.noteTree.locator(".fancytree-node.fancytree-active");
- this.noteTreeHoistedNote = this.noteTree.locator(".fancytree-node", { has: page.locator(".unhoist-button") });
+ const desktopTree = page.locator(".tree-wrapper");
+ this.noteTreeActiveNote = desktopTree.locator(".fancytree-node.fancytree-active");
+ this.noteTreeHoistedNote = desktopTree.locator(".fancytree-node", { has: page.locator(".unhoist-button") });
this.launcherBar = page.locator("#launcher-container");
this.currentNoteSplit = page.locator(".note-split:not(.hidden-ext)");
this.currentNoteSplitTitle = this.currentNoteSplit.locator(".note-title").first();
@@ -46,6 +45,12 @@ export default class App {
this.sidebar = page.locator("#right-pane");
}
+ get noteTree(): Locator {
+ return this.isMobile
+ ? this.page.locator(".mobile-note-navigator")
+ : this.page.locator(".tree-wrapper");
+ }
+
async goto({ url, isMobile, preserveTabs }: GotoOpts = {}) {
this.isMobile = !!isMobile;
@@ -77,7 +82,7 @@ export default class App {
// Wait for the page to load.
if (url === "/") {
- await expect(this.page.locator(".tree", { hasText: "Trilium Integration Test" })).toBeVisible();
+ await expect(this.noteTree).toContainText("Trilium Integration Test");
if (!preserveTabs) {
await this.closeAllTabs();
}