diff options
Diffstat (limited to 'packages/app/e2e/terminal')
| -rw-r--r-- | packages/app/e2e/terminal/terminal-init.spec.ts | 25 | ||||
| -rw-r--r-- | packages/app/e2e/terminal/terminal.spec.ts | 16 |
2 files changed, 41 insertions, 0 deletions
diff --git a/packages/app/e2e/terminal/terminal-init.spec.ts b/packages/app/e2e/terminal/terminal-init.spec.ts new file mode 100644 index 000000000..6faa73a75 --- /dev/null +++ b/packages/app/e2e/terminal/terminal-init.spec.ts @@ -0,0 +1,25 @@ +import { test, expect } from "../fixtures" +import { promptSelector, terminalSelector, terminalToggleKey } from "../utils" + +test("smoke terminal mounts and can create a second tab", async ({ page, gotoSession }) => { + await gotoSession() + + const terminals = page.locator(terminalSelector) + const opened = await terminals.first().isVisible() + + if (!opened) { + await page.keyboard.press(terminalToggleKey) + } + + await expect(terminals.first()).toBeVisible() + await expect(terminals.first().locator("textarea")).toHaveCount(1) + await expect(terminals).toHaveCount(1) + + // Ghostty captures a lot of keybinds when focused; move focus back + // to the app shell before triggering `terminal.new`. + await page.locator(promptSelector).click() + await page.keyboard.press("Control+Alt+T") + + await expect(terminals).toHaveCount(2) + await expect(terminals.nth(1).locator("textarea")).toHaveCount(1) +}) diff --git a/packages/app/e2e/terminal/terminal.spec.ts b/packages/app/e2e/terminal/terminal.spec.ts new file mode 100644 index 000000000..aaf5c2d75 --- /dev/null +++ b/packages/app/e2e/terminal/terminal.spec.ts @@ -0,0 +1,16 @@ +import { test, expect } from "../fixtures" +import { terminalSelector, terminalToggleKey } from "../utils" + +test("terminal panel can be toggled", async ({ page, gotoSession }) => { + await gotoSession() + + const terminal = page.locator(terminalSelector) + const initiallyOpen = await terminal.isVisible() + if (initiallyOpen) { + await page.keyboard.press(terminalToggleKey) + await expect(terminal).toHaveCount(0) + } + + await page.keyboard.press(terminalToggleKey) + await expect(terminal).toBeVisible() +}) |
