How to use the mugshot.ElementNotFound function in mugshot

To help you get started, we’ve selected a few mugshot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NiGhTTraX / mugshot / packages / webdriverio / src / lib / webdriverio-adapter.ts View on Github external
getElementRect = async (selector: string) => {
    const rect: DOMRect | null = await this.browser.execute(
      getBoundingRect,
      selector
    ) as DOMRect | null;

    if (!rect) {
      throw new ElementNotFound(selector);
    }

    return {
      x: rect.x,
      y: rect.y,
      width: rect.width,
      height: rect.height
    };
  };