Skip to content

Input Steps

Beginners: start with Creating Tests or Locators if you still need the workflow context. This page is the exact input-step reference.

Source: src/tests/steps/actions/input.step.ts.

See shared placeholder rules in Step Parameter Conventions.

Prefer installing published steps with npx appraisejs@latest add step ... instead of adding the package to your project with npm install.

Use input steps when the scenario must type, select, check, uncheck, or inject stored values into a form control.

the user fills in the {string} input field with value {string}

Terminal window
npx appraisejs@latest add step input/fill
  • Resolves input locator.
  • Fills input with provided literal value.
ParameterRepresentsExpected data
First {string}Input locator nameExisting locator key (for example emailInput).
Second {string}Value to typeAny text value (for example qa@example.com).
When the user fills in the "emailInput" input field with value "qa@example.com"

the user clears the {string} field

Terminal window
npx appraisejs@latest add step input/clear
  • Resolves field locator.
  • Clears existing value using Playwright clear().
ParameterRepresentsExpected data
{string}Input locator nameExisting locator key (for example searchBox).
When the user clears the "searchBox" field

the user selects the {string} option of the {string} dropdown

Terminal window
npx appraisejs@latest add step input/select-dropdown-option
  • Resolves dropdown locator.
  • Selects the option through selectOption().
ParameterRepresentsExpected data
First {string}Option identifierOption value/label (for example admin).
Second {string}Dropdown locator nameExisting locator key (for example roleSelect).
When the user selects the "admin" option of the "roleSelect" dropdown

the user checks the {string} checkbox

Terminal window
npx appraisejs@latest add step input/check
  • Resolves checkbox locator.
  • Marks checkbox checked.
ParameterRepresentsExpected data
{string}Checkbox locator nameExisting locator key (for example termsCheckbox).
When the user checks the "termsCheckbox" checkbox

the user unchecks the {string} checkbox

Terminal window
npx appraisejs@latest add step input/uncheck
  • Resolves checkbox locator.
  • Marks checkbox unchecked.
ParameterRepresentsExpected data
{string}Checkbox locator nameExisting locator key (for example newsletterCheckbox).
When the user unchecks the "newsletterCheckbox" checkbox

the user fills in the {string} input with data from the stored variable {string}

Terminal window
npx appraisejs@latest add step input/fill-input-with-stored-value
  • Reads value from runtime variable store.
  • Resolves input locator.
  • Fills input with stored value.
ParameterRepresentsExpected data
First {string}Input locator nameExisting locator key (for example emailInput).
Second {string}Variable keyExisting runtime variable name (for example generatedEmail).
When the user fills in the "emailInput" input with data from the stored variable "generatedEmail"
  • Any locator lookup failure throws immediately.
  • Stored-variable fill fails when variable key does not exist.