How to use the mugshot.ElementNotVisibleError 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 / index.ts View on Github external
return rects.map(rect => {
        if (
          rect.x === 0 &&
          rect.y === 0 &&
          rect.width === 0 &&
          rect.height === 0
        ) {
          throw new ElementNotVisibleError(selector);
        }

        return {
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height
        };
      });
    }
github NiGhTTraX / mugshot / packages / puppeteer / src / index.ts View on Github external
elements.map(async element => {
        const rect = await element.boundingBox();

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

        return rect;
      })
    );