terminal.spec.ts 602 B

123456789101112131415161718
  1. import { test, expect } from "../fixtures"
  2. import { waitTerminalReady } from "../actions"
  3. import { terminalSelector } from "../selectors"
  4. import { terminalToggleKey } from "../utils"
  5. test("terminal panel can be toggled", async ({ page, gotoSession }) => {
  6. await gotoSession()
  7. const terminal = page.locator(terminalSelector)
  8. const initiallyOpen = await terminal.isVisible()
  9. if (initiallyOpen) {
  10. await page.keyboard.press(terminalToggleKey)
  11. await expect(terminal).toHaveCount(0)
  12. }
  13. await page.keyboard.press(terminalToggleKey)
  14. await waitTerminalReady(page, { term: terminal })
  15. })