Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fresh/tests/deps.ts>Page#type

The next-gen web framework.
Extremely Popular
Go to Latest
method Page.prototype.type
Re-export
import { Page } from "https://deno.land/x/fresh@1.6.1/tests/deps.ts";

Sends a keydown, keypress/input, and keyup event for each character in the text.

To press a special key, like Control or ArrowDown, use Keyboard.press.

Examples

Example 1

await page.type('#mytextarea', 'Hello');
// Types instantly
await page.type('#mytextarea', 'World', {delay: 100});
// Types slower, like a user

Parameters

selector: string
  • A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used.
text: string
  • A text to type into a focused element.
optional
options: { delay: number; }
  • have property delay which is the Time to wait between key presses in milliseconds. Defaults to 0.

Returns

Promise<void>