// Assert that a button is left-aligned with its card container, allowing 3% horizontal tolerance awaitexpect(buttonLocator).toBeHorizontallyAlignedWith(parentLocator, HorizontalAlignment.Left, { tolerancePercent:3 });
Example
// Assert that a button is horizontally centered with its card container (default options) awaitexpect(buttonLocator).toBeHorizontallyAlignedWith(parentLocator, HorizontalAlignment.Center);
Asserts that the target element is horizontally aligned with the specified container according to the given alignment type.
Left alignment (
alignment = 'left'
):Center alignment (
alignment = 'center'
):Right alignment (
alignment = 'right'
):