import { escapeValue } from '../utils/escapeUtil'; import { CssLocator } from './CssLocator'; import type { LocatorRelativePosition } from './LocatorRelativePosition'; import type { PartLocator } from './PartLocator'; export type ByRoleSource = { _id: 'byRole'; value: string; relative: LocatorRelativePosition; }; /** * Locate elements by their ARIA `role` attribute. * * To additionally disambiguate two same-role elements by their accessible name, * compose with {@link byAriaLabel} (verbatim `aria-label`) on the SAME element * via {@link locatorUtil.and}: * * ```ts * import { byAriaLabel, byRole, locatorUtil } from '@atomic-testing/core'; * const openButton = locatorUtil.and(byRole('button'), byAriaLabel('Open')); * ``` * * Computed accessible names (`aria-labelledby` / `