Skip to content

Storage Steps

Beginners: start with Template Steps if you still need the authoring model first. This page is the exact storage-step reference.

Source: src/tests/steps/actions/store.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 storage steps when a later step needs to reuse text captured from the current page or form state.

the user stores the {string} element text inside the variable {string}

Terminal window
npx appraisejs@latest add step store/store-element-text
  • Resolves locator.
  • Reads textContent().
  • Stores value in runtime variable map.
ParameterRepresentsExpected data
First {string}Element locator nameExisting locator key (for example orderIdLabel).
Second {string}Target variable keyNew/existing variable name (for example capturedOrderId).
When the user stores the "orderIdLabel" element text inside the variable "capturedOrderId"

the user stores the {string} text input value inside the variable {string}

Terminal window
npx appraisejs@latest add step store/store-text-input-text
  • Resolves input locator.
  • Reads inputValue().
  • Stores into runtime variable.
ParameterRepresentsExpected data
First {string}Input locator nameExisting locator key (for example emailInput).
Second {string}Target variable keyNew/existing variable name (for example savedEmail).
When the user stores the "emailInput" text input value inside the variable "savedEmail"

the user stores the {string} textarea input value inside the variable {string}

Terminal window
npx appraisejs@latest add step store/store-textarea-text
  • Resolves textarea locator.
  • Reads inputValue().
  • Stores into runtime variable.
ParameterRepresentsExpected data
First {string}Textarea locator nameExisting locator key (for example notesTextarea).
Second {string}Target variable keyNew/existing variable name (for example savedNotes).
When the user stores the "notesTextarea" textarea input value inside the variable "savedNotes"
  • Step fails when locator cannot be resolved.
  • Stored values are only available within the current scenario world context.