fillIn()

Sets the value of an input or textarea and fires input events.

Since Ember 4/5 (Octane) Spec ↗

Syntax

await fillIn(target, value)

Parameters

NameTypeRequiredDescription
target string | Element No A selector or element for the field.
value string No The text to enter.

Returns

Promise<void> — Resolves once the resulting render settles.

Examples

import { render, fillIn, click } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

test('submits the form', async function (assert) {
  await render(hbs`<LoginForm />`);
  await fillIn('[data-test-email]', 'ada@example.com');
  await fillIn('[data-test-password]', 'secret123');
  await click('[data-test-submit]');
  assert.dom('[data-test-status]').hasText('Welcome');
});

Notes

fillIn focuses the element, sets its value, and dispatches an input event so two-way bound state and validation react. Use typeIn() when you need per-keystroke keydown/keyup events.