UNPKG

@wdio/image-comparison-core

Version:

Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework

13 lines (12 loc) 323 B
/** * Get the element position relative to the viewport */ export function getBoundingClientRect(element) { const { height, width, x, y } = element.getBoundingClientRect(); return { height: Math.round(height), width: Math.round(width), x: Math.round(x), y: Math.round(y), }; }