flexpect - v0.9.0
    Preparing search index...

    Function toHaveSameSizeAs

    • Asserts that the target element has the same width and height as the specified container element.

      Parameters

      Returns Promise<MatcherReturnType>

      A Promise that resolves with the matcher result.

      // Checks that the element matches the container's size, with up to 5% tolerance in width and height
      await expect(elementLocator).toHaveSameSizeAs(containerLocator, {
      tolerancePercent: 5
      });
      // Checks that the element has exactly the same width and height as its container using default alignment options
      await expect(elementLocator).toHaveSameSizeAs(containerLocator);