{
  "slug": "k6-browser-locator-presssequentially-types-with-keyboard-events-038fcfc1c573",
  "title": "k6/browser locator.pressSequentially() types with keyboard events",
  "tools": [
    "k6"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-01-05T19:37:51.000Z",
  "announced_at": "2026-01-05T19:37:51.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When testing input behavior that responds to individual keystrokes, use `locator.pressSequentially()` to type characters and fire keyboard events. Set `delay` in milliseconds to test handlers that depend on time between keystrokes.",
    "examples": [
      "import { browser } from 'k6/browser';\n\nexport const options = {\n  scenarios: {\n    browser: {\n      executor: 'shared-iterations',\n      options: { browser: { type: 'chromium' } },\n    },\n  },\n};\n\nexport default async function () {\n  const page = await browser.newPage();\n  try {\n    await page.goto('<URL>');\n    await page.locator('<input selector>').pressSequentially('<text>', { delay: 100 });\n  } finally {\n    await page.close();\n  }\n}"
    ],
    "gotchas": [
      "Version: v1.5.0",
      "text (required): String to type into the focused element character by character.",
      "options.delay: Milliseconds to wait between key presses; defaults to 0.",
      "options.noWaitAfter: If true, do not wait for navigation caused by the action to complete; defaults to false.",
      "options.timeout: Maximum time in milliseconds; defaults to 30000, or the BrowserContext/Page default timeout. Use 0 to disable.",
      "A configurable delay between keystrokes is supported.",
      "Docs conflict: The latest documentation shows k6 v2.3.x, newer than the card's v1.5.0; version-specific differences were not established."
    ]
  },
  "why_it_matters": "Test a browser input that reacts to each keystroke, such as autocomplete or per-character validation.",
  "before": "Use `locator.type()` for gradual typing without keyboard events, or `locator.fill()` for simple form filling.",
  "sources": [
    "https://github.com/grafana/k6/releases/tag/v1.5.0",
    "https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/presssequentially/"
  ],
  "rank": 0.98036,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-586cf8a8904fff8d-2:gate",
    "evidence_hash": "a56e3f88b056059d85ecbdf65359def0fbd1d2054d8cb41abb9141ea3143a06c"
  },
  "review": {
    "draft_hash": "bcd70cccf27d7259dfabfbeb686c55b9472ed706f5c067e3b31173135a3b7f46",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
