Take screenshot from Karma while running tests in PhantomJS 2?
问题 I need a way to take a screenshot during a test which uses QUnit and Karma to run inside PhantomJS 2.0.1 I've found this command: window.top.callPhantom('render'); That doesn't throw any error but doesn't seem to work, or at least, I don't know where to look for the taken screenshot. Any clue? 回答1: Found a way! Solution I had to edit my custom PhantomJS custom launcher adding an option: PhantomJSCustom: { base: 'PhantomJS', options: { onCallback: function(data){ if (data.type === "render") {