(app: ObsidianApp)
| 389 | } |
| 390 | |
| 391 | export async function closeObsidian(app: ObsidianApp): Promise<void> { |
| 392 | // Don't close if we connected to an existing instance - leave it running for the next test run |
| 393 | if (app.isExistingInstance) { |
| 394 | console.log('Keeping existing Obsidian instance running'); |
| 395 | return; |
| 396 | } |
| 397 | if (app.browser) { |
| 398 | // Close all open tabs/pages before closing the browser |
| 399 | for (const context of app.browser.contexts()) { |
| 400 | for (const page of context.pages()) { |
| 401 | await page.close().catch(() => {}); |
| 402 | } |
| 403 | } |
| 404 | await app.browser.close(); |
| 405 | } |
| 406 | if (app.process) { |
| 407 | app.process.kill(); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | export async function openCommandPalette(page: Page): Promise<void> { |
| 412 | // Close any existing modals first |
no test coverage detected