@wdio/image-comparison-core
Version:
Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework
18 lines (17 loc) • 514 B
JavaScript
/**
* Get the click and dimensions of the mobile webview and remove the overlay
*/
export function getMobileWebviewClickAndDimensions(overlaySelector) {
const overlay = document.querySelector(overlaySelector);
const defaultValue = { y: 0, x: 0, width: 0, height: 0 };
if (!overlay || !overlay.dataset.icsWebviewData) {
return defaultValue;
}
overlay.remove();
try {
return JSON.parse(overlay.dataset.icsWebviewData);
}
catch {
return defaultValue;
}
}