(page: Page)
| 409 | } |
| 410 | |
| 411 | export async function openCommandPalette(page: Page): Promise<void> { |
| 412 | // Close any existing modals first |
| 413 | await page.keyboard.press('Escape'); |
| 414 | await page.waitForTimeout(200); |
| 415 | |
| 416 | // Click on workspace to ensure focus |
| 417 | const workspace = page.locator('.workspace'); |
| 418 | if (await workspace.isVisible({ timeout: 1000 }).catch(() => false)) { |
| 419 | await workspace.click({ position: { x: 10, y: 10 } }).catch(() => {}); |
| 420 | await page.waitForTimeout(100); |
| 421 | } |
| 422 | |
| 423 | // Use Ctrl+P to open command palette |
| 424 | await page.keyboard.press('Control+p'); |
| 425 | await page.waitForSelector('.prompt', { timeout: 5000 }); |
| 426 | // Clear any existing text in the prompt input |
| 427 | const promptInput = page.locator('.prompt-input'); |
| 428 | await promptInput.fill(''); |
| 429 | } |
| 430 | |
| 431 | export async function runCommand(page: Page, command: string): Promise<void> { |
| 432 | await openCommandPalette(page); |
no outgoing calls
no test coverage detected