mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 11:14:12 +01:00
add more tests in cli_test-samples: flowchart, sequence, gantt, gitgraph, load html in phantomjs and save screenshot png
This commit is contained in:
15
test/fixtures/samples/load_html_save_screenshot_png.phantomjs
vendored
Normal file
15
test/fixtures/samples/load_html_save_screenshot_png.phantomjs
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// usage: ../../../node_modules/.bin/phantomjs <html> <png>
|
||||
var system = require('system');
|
||||
var html = system.args[1];
|
||||
var png = system.args[2];
|
||||
console.log('png:', png)
|
||||
var page = require('webpage').create(),
|
||||
loadInProgress = false,
|
||||
fs = require('fs');
|
||||
|
||||
page.open(html);
|
||||
page.onLoadFinished = function() {
|
||||
loadInProgress = false;
|
||||
page.render(png);
|
||||
phantom.exit();
|
||||
}
|
||||
Reference in New Issue
Block a user