Skip to main content
Version: 1.x

Function: assertField()

assertField(ui5, vocabulary, label, expected): Promise<IntentResult<void>>

Defined in: src/intents/core-wrappers.ts:338

Resolves a field label via vocabulary, reads the control's text, and compares it.

Parameters

ui5

UI5HandlerSlice

UI5 interaction handler.

vocabulary

VocabLookup

Vocabulary lookup service.

label

string

Human-readable field label (e.g. 'Status').

expected

string

Expected text value.

Returns

Promise<IntentResult<void>>

An IntentResult<void> describing the outcome. status is 'error' when the term is not found or the value does not match.

Intent

Assert a field value by business label without knowing the control ID.

Capability

Enables readable, maintainable assertions in E2E tests.

Example

import { assertField } from '#intents/core-wrappers.js';

const result = await assertField(ui5, vocab, 'Status', 'In Process');
expect(result.status).toBe('success');