Created
May 11, 2017 15:26
-
-
Save windse7en/db016325112fe2b56363a4de10418027 to your computer and use it in GitHub Desktop.
test js file for phantomjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// phantomjs --remote-debugger-port=9000 --remote-debugger-autorun=true test.js urlPath | |
/* | |
* screenshot will be created in the cwd. | |
*/ | |
var page = new WebPage(); | |
var system = require('system'); | |
var url = 'http://localhost:8080/#/tests/' + system.args[1]; | |
function takeScreenshot() { | |
setTimeout(function() { | |
page.render('screenshot.png'); | |
}, 1000); | |
} | |
console.log(url); | |
page.open(url, function (status) { | |
console.log(status); | |
takeScreenshot(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment