@@ -21,7 +21,6 @@ export default class App {
2121 readonly context : BrowserContext ;
2222
2323 readonly tabBar : Locator ;
24- readonly noteTree : Locator ;
2524 readonly noteTreeActiveNote : Locator ;
2625 readonly noteTreeHoistedNote : Locator ;
2726 readonly launcherBar : Locator ;
@@ -36,16 +35,22 @@ export default class App {
3635 this . context = context ;
3736
3837 this . tabBar = page . locator ( ".tab-row-widget-container" ) ;
39- this . noteTree = page . locator ( ".tree-wrapper" ) ;
40- this . noteTreeActiveNote = this . noteTree . locator ( ".fancytree-node.fancytree-active" ) ;
41- this . noteTreeHoistedNote = this . noteTree . locator ( ".fancytree-node" , { has : page . locator ( ".unhoist-button" ) } ) ;
38+ const desktopTree = page . locator ( ".tree-wrapper" ) ;
39+ this . noteTreeActiveNote = desktopTree . locator ( ".fancytree-node.fancytree-active" ) ;
40+ this . noteTreeHoistedNote = desktopTree . locator ( ".fancytree-node" , { has : page . locator ( ".unhoist-button" ) } ) ;
4241 this . launcherBar = page . locator ( "#launcher-container" ) ;
4342 this . currentNoteSplit = page . locator ( ".note-split:not(.hidden-ext)" ) ;
4443 this . currentNoteSplitTitle = this . currentNoteSplit . locator ( ".note-title" ) . first ( ) ;
4544 this . currentNoteSplitContent = this . currentNoteSplit . locator ( ".note-detail-printable.visible" ) ;
4645 this . sidebar = page . locator ( "#right-pane" ) ;
4746 }
4847
48+ get noteTree ( ) : Locator {
49+ return this . isMobile
50+ ? this . page . locator ( ".mobile-note-navigator" )
51+ : this . page . locator ( ".tree-wrapper" ) ;
52+ }
53+
4954 async goto ( { url, isMobile, preserveTabs } : GotoOpts = { } ) {
5055 this . isMobile = ! ! isMobile ;
5156
@@ -77,7 +82,7 @@ export default class App {
7782
7883 // Wait for the page to load.
7984 if ( url === "/" ) {
80- await expect ( this . page . locator ( ".tree" , { hasText : " Trilium Integration Test" } ) ) . toBeVisible ( ) ;
85+ await expect ( this . noteTree ) . toContainText ( " Trilium Integration Test") ;
8186 if ( ! preserveTabs ) {
8287 await this . closeAllTabs ( ) ;
8388 }
0 commit comments