What is the easiest way to attach screenshots to Karate JSON report?
We test REST API and our tests cases require to perform some operation on web side(log into web application, perform verification, take screenshot). We've handled with it writing some static methods which are called from Karate using Java interop mechanism.
What I want to do is write some generic, reusable code to attach screenshots taken during test execution.
I don't want to repeat steps:
* def bytes = getScreenBytes()
* eval karate.embed(bytes,'image/jpg')
each time when screenshot should be attached to report.
It would be perfect to attach taken screenshots directly from java code to not to expose such details in scenarios.
Is there such possibility?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…