Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74020

TestCafe - How to get the html output of an element on fail

$
0
0

When I run tests I cannot capture screenshots at the moment in Jenkins without some heavy work. What I would like to do is get the HTML output of the body to see what is displayed when a particular error occurs.

What I've already tried is getting the textContent, which is pretty close but I would like to get the stringified HTML if possible.

await t
    .click(something)
    .wait(1000)
    .click(somethingElse)
    .wait(1000)
    .expect(mySelector.exists)
    .ok(await Selector('body').textContent, { timeout: 25000 }); // if .ok fails it should print out the contents of body

I get the text but would want HTML.


Viewing all articles
Browse latest Browse all 74020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>