@wdio/image-comparison-core
Version:
Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework
17 lines (16 loc) • 546 B
JavaScript
/**
* Add or remove the transparency from the text
*/
export default function toggleTextTransparency(enableTransparency) {
if (enableTransparency) {
const elements = document.querySelectorAll('body *:not(script):not(style)');
elements.forEach(el => {
el.style.setProperty('color', 'transparent', 'important');
});
return;
}
const elements = document.querySelectorAll('body [color]:not(script):not(style)');
elements.forEach(el => {
el.style.removeProperty('color');
});
}