jasmine puts the status message in a different class on failure
[mkws-moved-to-github.git] / test / phantom / screenshot.js
1 var page = require('webpage').create(),
2     system = require('system');
3
4 var url = system.args[1] || 'http://www.indexdata.com/';
5 var file_png = system.args[2] || 'indexdata.png';
6
7 if (system.args.length === 1) {
8     console.log('Usage: screenshot.js <some URL> <file.png>');
9     phantom.exit();
10 }
11
12 // page.zoomFactor = 1.0;
13 page.viewportSize = {
14     width: system.args[3] ? system.args[3] : 1200,
15     height: system.args[4] ? system.args[4] : 1000
16 };
17
18 page.clipRect = {
19     width: page.viewportSize.width,
20     height: page.viewportSize.height
21 };
22
23 page.open(url, function () {
24     // small delay
25     setTimeout(function () {
26         var ret = page.render(file_png);
27         phantom.exit();
28     }, 200);
29 });