flexpect - v0.9.0
    Preparing search index...
    • Asserts that the target element is fully centered both horizontally and vertically within the specified container element.

      |-----------------|
      |                 |
      |    [element]    |
      |                 |
      |-----------------|
      

      Parameters

      Returns Promise<MatcherReturnType>

      A Promise that resolves with the matcher result.

      // Check that a modal is perfectly centered within the viewport, allowing a 2% margin
      const parentLocator = page.locator('#parent');
      await expect(modalLocator).toBeFullyCentered(parentLocator, {
      tolerancePercent: 2
      });