MCPcopy
hub / github.com/callumalpass/tasknotes / openCommandPalette

Function openCommandPalette

e2e/obsidian.ts:411–429  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

409}
410
411export 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
431export async function runCommand(page: Page, command: string): Promise<void> {
432 await openCommandPalette(page);

Callers 2

tasknotes.spec.tsFile · 0.90
runCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected