File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,12 +117,12 @@ export class HomePage extends BasePage {
117117 }
118118
119119 async navigateToHome ( ) : Promise < void > {
120- await this . page . goto ( '/' , { waitUntil : 'load' } ) ;
120+ await this . page . goto ( '/' ) ;
121121 await this . waitForPageLoad ( ) ;
122122 }
123123
124124 async navigateToLogin ( ) : Promise < void > {
125- await this . page . goto ( '/#/login' , { waitUntil : 'load' } ) ;
125+ await this . page . goto ( '/#/login' ) ;
126126 await this . waitForPageLoad ( ) ;
127127 // Wait for potential redirect to complete by checking URL change
128128 await waitForUrlNotContaining ( this . page , '#/login' ) ;
@@ -189,6 +189,7 @@ export class HomePage extends BasePage {
189189 }
190190
191191 async filterNotes ( searchTerm : string ) : Promise < void > {
192+ await this . nodeList . filterInput . waitFor ( { state : 'visible' , timeout : 5000 } ) ;
192193 await this . nodeList . filterInput . fill ( searchTerm ) ;
193194 }
194195
Original file line number Diff line number Diff line change @@ -183,31 +183,23 @@ export class HomePageUtil {
183183 async verifyCreateNewNoteWorkflow ( ) : Promise < void > {
184184 await this . homePage . clickCreateNewNote ( ) ;
185185
186- await this . page . waitForFunction (
187- ( ) => {
188- return document . querySelector ( 'zeppelin-note-create' ) !== null ;
189- } ,
190- { timeout : 10000 }
191- ) ;
186+ await this . page . waitForFunction ( ( ) => document . querySelector ( 'zeppelin-note-create' ) !== null , { timeout : 10000 } ) ;
192187 }
193188
194189 async verifyImportNoteWorkflow ( ) : Promise < void > {
195190 await this . homePage . clickImportNote ( ) ;
196191
197- await this . page . waitForFunction (
198- ( ) => {
199- return document . querySelector ( 'zeppelin-note-import' ) !== null ;
200- } ,
201- { timeout : 10000 }
202- ) ;
192+ await this . page . waitForFunction ( ( ) => document . querySelector ( 'zeppelin-note-import' ) !== null , { timeout : 10000 } ) ;
203193 }
204194
205195 async testFilterFunctionality ( filterTerm : string ) : Promise < void > {
206196 await this . homePage . filterNotes ( filterTerm ) ;
207197
208- await this . page . waitForTimeout ( 1000 ) ;
198+ const notebookTreeLocator = this . page . locator ( 'nz-tree .node' ) ;
199+ await notebookTreeLocator . first ( ) . waitFor ( { state : 'attached' , timeout : 5000 } ) ;
200+ await this . page . waitForLoadState ( 'domcontentloaded' ) ;
209201
210- const filteredResults = await this . page . locator ( 'nz-tree .node' ) . count ( ) ;
202+ const filteredResults = await notebookTreeLocator . count ( ) ;
211203 expect ( filteredResults ) . toBeGreaterThanOrEqual ( 0 ) ;
212204 }
213205
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ test.describe('Home Page Note Operations', () => {
2424 await page . goto ( '/' ) ;
2525 await waitForZeppelinReady ( page ) ;
2626 await performLoginIfRequired ( page ) ;
27- await page . waitForSelector ( 'zeppelin-node-list' , { timeout : 15000 } ) ;
27+ const noteListLocator = page . locator ( 'zeppelin-node-list' ) ;
28+ await expect ( noteListLocator ) . toBeVisible ( { timeout : 15000 } ) ;
2829 } ) ;
2930
3031 test . describe ( 'Given note operations are available' , ( ) => {
@@ -93,13 +94,10 @@ test.describe('Home Page Note Operations', () => {
9394
9495 await page
9596 . waitForFunction (
96- ( ) => {
97- return (
98- document . querySelector ( 'zeppelin-note-rename' ) !== null ||
99- document . querySelector ( '[role="dialog"]' ) !== null ||
100- document . querySelector ( '.ant-modal' ) !== null
101- ) ;
102- } ,
97+ ( ) =>
98+ document . querySelector ( 'zeppelin-note-rename' ) !== null ||
99+ document . querySelector ( '[role="dialog"]' ) !== null ||
100+ document . querySelector ( '.ant-modal' ) !== null ,
103101 { timeout : 5000 }
104102 )
105103 . catch ( ( ) => {
You can’t perform that action at this time.
0 commit comments