Tuple of additional arguments the check function expects.
Raw check function that performs a single assertion attempt.
A matcher function with auto-retry, suitable for registerUI5Matcher.
Provide a factory so custom matchers automatically get web-first retry behavior identical to built-in Praman matchers.
The returned function:
MatcherOptions from the argumentspollUntilPassimport { createUI5Matcher, registerUI5Matcher } from 'playwright-praman';
import { getControlProperty } from 'playwright-praman';
const checkUI5Icon = createUI5Matcher<[string]>(
async (page, controlId, expected) => {
const actual = await getControlProperty(page, controlId, 'icon');
const pass = actual === expected;
return {
pass,
message: () =>
pass
? `Expected icon not to be '${expected}'`
: `Expected icon to be '${expected}', got '${String(actual)}'`,
actual,
expected,
};
},
);
registerUI5Matcher('toHaveUI5Icon', checkUI5Icon);
Wraps a raw check function with pollUntilPass auto-retry semantics.