How to use the casper.create function in casper

To help you get started, we’ve selected a few casper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timelyportfolio / rCharts_dimple / screenshot.js View on Github external
// screenshot.js
var casper = require('casper').create({viewportSize:{width:1600,height:900}});
var args = casper.cli.args;
var imgfile = (args[1] || Math.random().toString(36).slice(2)) + '.png'
casper.start(args[0], function() {
    this.captureSelector(imgfile, '.rChart');
});

casper.run();
github yandex-ui / nanoislands / regression-tests / tools / screenshot.js View on Github external
function makeCasper() {
    phantom.casperPath = './phantomcss/CasperJs';
    phantom.injectJs(phantom.casperPath + '/bin/bootstrap.js');
    phantom.injectJs('jquery.js');

    var casper = require('casper').create({
        viewportSize: {
            width: 1024,
            height: 800
        }
    });

    return casper;
}
github iamchrismiller / grunt-casper / test / fixtures / testScreenshots.js View on Github external
var casper = require("casper").create();

casper.start('test/fixtures/basicSiteWithImages.html');

casper.then(function() {
  this.capture('tmp/test.png');
});

casper.run();
github Pylons / webtest / tests / fixtures / test_casperjs_fail.js View on Github external
var system = require('system');
var url = system.env['APPLICATION_URL'];

var casper = require('casper').create();
casper.start(url, function() {
    this.test.assertTitle('It Work!');
});

casper.run(function() {
    this.test.done();
    this.test.renderResults(true);
});
github ingf / elegant-writing-javascript / server.js View on Github external
var casper = require('casper').create()

casper.start('http://casperjs.org/')

casper.then(function() {
  this.echo('First Page: ' + this.getTitle())
})

casper.thenOpen('http://phantomjs.org', function() {
  this.echo('Second Page: ' + this.getTitle())
})

casper.run()

casper

Helpers and handlers for building APIs in express.

MIT
Latest version published 11 years ago

Package Health Score

42 / 100
Full package analysis

Popular casper functions