Skip to content

Input Steps

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

See shared placeholder rules in Step Parameter Conventions.

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

What it does:

  • Resolves input locator.
  • Fills input with provided literal value.

Parameters:

ParameterRepresentsExpected data
First {string}Input locator nameExisting locator key (for example emailInput).
Second {string}Value to typeAny text value (for example qa@example.com).

Example:

When the user fills in the "emailInput" input field with value "qa@example.com"

Signature: the user clears the {string} field

What it does:

  • Resolves field locator.
  • Clears existing value using Playwright clear().

Parameters:

ParameterRepresentsExpected data
{string}Input locator nameExisting locator key (for example searchBox).

Example:

When the user clears the "searchBox" field

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

What it does:

  • Resolves dropdown locator.
  • Selects the option through selectOption().

Parameters:

ParameterRepresentsExpected data
First {string}Option identifierOption value/label (for example admin).
Second {string}Dropdown locator nameExisting locator key (for example roleSelect).

Example:

When the user selects the "admin" option of the "roleSelect" dropdown

Signature: the user checks the {string} checkbox

What it does:

  • Resolves checkbox locator.
  • Marks checkbox checked.

Parameters:

ParameterRepresentsExpected data
{string}Checkbox locator nameExisting locator key (for example termsCheckbox).

Example:

When the user checks the "termsCheckbox" checkbox

Signature: the user unchecks the {string} checkbox

What it does:

  • Resolves checkbox locator.
  • Marks checkbox unchecked.

Parameters:

ParameterRepresentsExpected data
{string}Checkbox locator nameExisting locator key (for example newsletterCheckbox).

Example:

When the user unchecks the "newsletterCheckbox" checkbox

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

What it does:

  • Reads value from runtime variable store.
  • Resolves input locator.
  • Fills input with stored value.

Parameters:

ParameterRepresentsExpected data
First {string}Input locator nameExisting locator key (for example emailInput).
Second {string}Variable keyExisting runtime variable name (for example generatedEmail).

Example:

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.