@@ -15,10 +15,10 @@ test.describe('Ledger API Integration', () => {
1515 await page . waitForLoadState ( 'networkidle' ) ;
1616
1717 // Check page title
18- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Journal Entries' ) ;
18+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Journal Entries' , { timeout : 30000 } ) ;
1919
20- // Check company selector is visible
21- await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( ) ;
20+ // Check company selector is visible (may take time to load)
21+ await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
2222
2323 // Check date filters are visible after company selection
2424 const companySelect = page . locator ( 'select#company-select' ) ;
@@ -40,10 +40,10 @@ test.describe('Ledger API Integration', () => {
4040 await page . waitForLoadState ( 'networkidle' ) ;
4141
4242 // Check page title
43- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Trial Balance' ) ;
43+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Trial Balance' , { timeout : 30000 } ) ;
4444
45- // Company selector should be visible
46- await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( ) ;
45+ // Company selector should be visible (may take time to load)
46+ await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
4747
4848 // Select a company if available
4949 const companySelect = page . locator ( 'select#company-select' ) ;
@@ -90,10 +90,10 @@ test.describe('Ledger API Integration', () => {
9090 await page . waitForLoadState ( 'networkidle' ) ;
9191
9292 // Check page title
93- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Profit & Loss' ) ;
93+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Profit & Loss' , { timeout : 30000 } ) ;
9494
95- // Company selector should be visible
96- await expect ( page . locator ( 'select' ) ) . toBeVisible ( ) ;
95+ // Company selector should be visible (may take time to load)
96+ await expect ( page . locator ( 'select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
9797
9898 // Select a company if available
9999 const companySelect = page . locator ( 'select' ) . first ( ) ;
@@ -141,10 +141,10 @@ test.describe('Ledger API Integration', () => {
141141 await page . waitForLoadState ( 'networkidle' ) ;
142142
143143 // Check page title
144- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'VAT Summary' ) ;
144+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'VAT Summary' , { timeout : 30000 } ) ;
145145
146- // Company selector should be visible
147- await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( ) ;
146+ // Company selector should be visible (may take time to load)
147+ await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
148148
149149 const companySelect = page . locator ( 'select#company-select' ) ;
150150 const optionCount = await companySelect . locator ( 'option' ) . count ( ) ;
@@ -198,9 +198,10 @@ test.describe('Ledger API Integration', () => {
198198 await page . waitForLoadState ( 'networkidle' ) ;
199199
200200 // Check page title
201- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Ledger Invoices' ) ;
201+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Ledger Invoices' , { timeout : 30000 } ) ;
202202
203203 const companySelect = page . locator ( 'select#company-select' ) ;
204+ await expect ( companySelect ) . toBeVisible ( { timeout : 30000 } ) ;
204205 const optionCount = await companySelect . locator ( 'option' ) . count ( ) ;
205206
206207 if ( optionCount > 1 ) {
@@ -291,9 +292,9 @@ test.describe('Ledger API Integration', () => {
291292 await page . goto ( url ) ;
292293 await page . waitForLoadState ( 'networkidle' ) ;
293294
294- // Company selector should always be visible
295+ // Company selector should always be visible (may take time to load)
295296 const companySelect = page . locator ( 'select#company-select, select' ) ;
296- await expect ( companySelect . first ( ) ) . toBeVisible ( ) ;
297+ await expect ( companySelect . first ( ) ) . toBeVisible ( { timeout : 30000 } ) ;
297298
298299 // Should have at least the "Select Company..." option
299300 const options = companySelect . first ( ) . locator ( 'option' ) ;
0 commit comments