Skip to main content

Interface: AnchorScore

Defined in: packages/uimatch-selector-anchors/src/matching/anchor-matcher.ts:22

Scoring result for anchor matching

Example​

const score: AnchorScore = {
anchor: { id: 'button-1', hint: 'testid:submit-btn', ...otherFields },
score: 0.95,
reasons: ['Exact testid match', 'High confidence']
};

Properties​

anchor​

anchor: object;

Defined in: packages/uimatch-selector-anchors/src/matching/anchor-matcher.ts:23

fallbacks?​

optional fallbacks: object;
fallbacks.classList?​
optional classList: string[];
fallbacks.role?​
optional role: string;
fallbacks.tag?​
optional tag: string;
fallbacks.text?​
optional text: string;

hint?​

optional hint: object;
hint.ariaLabel?​
optional ariaLabel: string;
hint.expectedText?​
optional expectedText: string;
hint.prefer?​
optional prefer: ("testid" | "role" | "text" | "css")[];
hint.role?​
optional role: string;
hint.testid?​
optional testid: string;

hints?​

optional hints: object;
hints.classList?​
optional classList: string[];
hints.role?​
optional role: string;
hints.tag?​
optional tag: string;
hints.text?​
optional text: string;

id​

id: string;

lastKnown?​

optional lastKnown: object;
lastKnown.selector​
selector: string;
lastKnown.stabilityScore?​
optional stabilityScore: number;
lastKnown.timestamp?​
optional timestamp: string;

lastSeen?​

optional lastSeen: string | null;

meta?​

optional meta: object;
meta.component?​
optional component: string;
meta.description?​
optional description: string;
meta.tags?​
optional tags: string[];

resolvedCss?​

optional resolvedCss: string | null;

snippet?​

optional snippet: string;

snippetContext?​

optional snippetContext: object;
snippetContext.algorithm​
algorithm: "sha1" | "sha256" | "md5";
snippetContext.contextAfter​
contextAfter: number;
snippetContext.contextBefore​
contextBefore: number;
snippetContext.hashDigits​
hashDigits: number;

snippetHash?​

optional snippetHash: string;

source​

source: object;
source.col​
col: number;
source.file​
file: string;
source.line​
line: number;

subselector?​

optional subselector: string;

reasons​

reasons: string[];

Defined in: packages/uimatch-selector-anchors/src/matching/anchor-matcher.ts:25


score​

score: number;

Defined in: packages/uimatch-selector-anchors/src/matching/anchor-matcher.ts:24