flexpect - v0.9.0
    Preparing search index...

    Function toBeInside

    • Asserts that the target element is fully contained within the specified container element, allowing for an optional margin of tolerance.

      The check ensures that all sides of the target element (top, bottom, left, right) are strictly within the bounds of the container, with an optional offset based on a percentage of the container's dimensions.

      Parameters

      • element: Locator
      • container: Locator

        The container element as a Locator within which the element is expected to be fully contained.

      • options: ToBeInsideOptions = {}

        Optional containment options.

      Returns Promise<MatcherReturnType>

      A Promise that resolves with the matcher result.

      // Verify that the modal content is fully inside its container with a 2% tolerance
      await expect(modalContentLocator).toBeInside(parentLocator, {
      tolerancePercent: 2
      });
      // Verify that the modal content is strictly inside its container without any tolerance
      await expect(modalContentLocator).toBeInside(parentLocator);