MCPcopy
hub / github.com/codeceptjs/CodeceptJS / elToString

Function elToString

lib/helper/Playwright.js:4863–4872  ·  view source on GitHub ↗
(el, numberOfElements)

Source from the content-addressed store, hash-verified

4861}
4862
4863async function elToString(el, numberOfElements) {
4864 const html = await el.evaluate(node => node.outerHTML)
4865 return (
4866 html
4867 .replace(/\n/g, '')
4868 .replace(/\s+/g, ' ')
4869 .substring(0, 100 / numberOfElements)
4870 .trim() + '...'
4871 )
4872}

Callers 3

_locateMethod · 0.85
fillFieldMethod · 0.85
proceedClickFunction · 0.85

Calls 1

evaluateMethod · 0.80

Tested by

no test coverage detected