Skip to content

Instantly share code, notes, and snippets.

@ismailmechbal
Forked from LeCoupa/casperjs.cheatsheet.js
Created September 7, 2018 09:14
Show Gist options
  • Save ismailmechbal/60df7aee112f22bf90913b7dff95f09e to your computer and use it in GitHub Desktop.
Save ismailmechbal/60df7aee112f22bf90913b7dff95f09e to your computer and use it in GitHub Desktop.

Revisions

  1. @LeCoupa LeCoupa revised this gist Nov 10, 2017. No changes.
  2. Julien Le Coupanec revised this gist Jul 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -212,7 +212,7 @@ var spooky = new Spooky({
    'proxy-auth': 'username:password'
    },
    casper: {
    logLevel: "debug",
    logLevel: "debug", // can also be set to "info", "warning" or "error"
    verbose: false
    pageSettings: {
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36'
  3. Julien Le Coupanec revised this gist May 16, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -219,7 +219,7 @@ var spooky = new Spooky({
    }
    }
    }, function() {
    // do your stuff
    // The magic begins here.
    })

    // Passing values between spooky environment (NodeJS) to CasperJS.
  4. Julien Le Coupanec revised this gist May 16, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -208,12 +208,15 @@ utils.unique(array);
    var spooky = new Spooky({
    child: {
    'transport': "http",
    'proxy': '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of thing I like with Spooky)
    'proxy': '192.128.101.42:9001', // when you want to switch a proxy (kind of thing I like with Spooky)
    'proxy-auth': 'username:password'
    },
    casper: {
    logLevel: "debug",
    verbose: false
    pageSettings: {
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36'
    }
    }
    }, function() {
    // do your stuff
  5. Julien Le Coupanec revised this gist May 16, 2014. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -207,8 +207,9 @@ utils.unique(array);

    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of thing I like with Spooky)
    'transport': "http",
    'proxy': '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of thing I like with Spooky)
    'proxy-auth': 'username:password'
    },
    casper: {
    logLevel: "debug",
  6. Julien Le Coupanec revised this gist Apr 17, 2014. 1 changed file with 46 additions and 46 deletions.
    92 changes: 46 additions & 46 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -23,43 +23,43 @@ page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
    $ brew install casperjs --devel // install CasperJS with brew

    var casper = require('casper').create({
    clientScripts: [
    'includes/jquery.js',
    'includes/underscore.js'
    ],
    exitOnError: true,
    httpStatusHandlers: { },
    logLevel: "error",
    onAlert: null,
    onDie: null,
    onError: null,
    onLoadError: null,
    onPageInitialized: null,
    onResourceReceived: null,
    onResourceRequested: null,
    onStepComplete: null,
    onStepTimeout: null,
    onTimeout: null,
    onWaitTimeout: null,
    page: null,
    pageSettings: {
    javascriptEnabled: true,
    loadImages: false,
    loadPlugins: false,
    localToRemoteUrlAccessEnabled: false,
    userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)",
    userName: null,
    password: null,
    XSSAuditingEnabled: false,
    },
    remoteScripts: [ ],
    safeLogs: [ ],
    stepTimeout: null,
    timeout: null,
    verbose: true,
    viewportSize: null,
    retryTimeout: 100,
    waitTimeout: 5000,
    clientScripts: [
    'includes/jquery.js',
    'includes/underscore.js'
    ],
    exitOnError: true,
    httpStatusHandlers: { },
    logLevel: "error",
    onAlert: null,
    onDie: null,
    onError: null,
    onLoadError: null,
    onPageInitialized: null,
    onResourceReceived: null,
    onResourceRequested: null,
    onStepComplete: null,
    onStepTimeout: null,
    onTimeout: null,
    onWaitTimeout: null,
    page: null,
    pageSettings: {
    javascriptEnabled: true,
    loadImages: false,
    loadPlugins: false,
    localToRemoteUrlAccessEnabled: false,
    userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)",
    userName: null,
    password: null,
    XSSAuditingEnabled: false,
    },
    remoteScripts: [ ],
    safeLogs: [ ],
    stepTimeout: null,
    timeout: null,
    verbose: true,
    viewportSize: null,
    retryTimeout: 100,
    waitTimeout: 5000,
    });

    casper.options.waitTimeout = 1000; // alter an option at runtime
    @@ -206,16 +206,16 @@ utils.unique(array);
    // Spooky Cheatsheet (Spooky is used to control CasperJS from the Node environment)

    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of thing I like with Spooky)
    },
    casper: {
    logLevel: "debug",
    verbose: false
    }
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of thing I like with Spooky)
    },
    casper: {
    logLevel: "debug",
    verbose: false
    }
    }, function() {
    // do your stuff
    // do your stuff
    })

    // Passing values between spooky environment (NodeJS) to CasperJS.
  7. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -166,7 +166,7 @@ casper.emit(String event);
    // run.complete, run.start, starting, started, step.added, step.complete, step.created, step.error, step.start, step.timeout, timeout, url.changed,
    // viewport.changed, wait.done, wait.start, waitFor.timeout

    casper.setFIlter(String event, Function then);
    casper.setFilter(String event, Function then);

    // Filters referenced: capture.target_filename, echo.message, log.message, open.location, page.confirm, page.prompt

  8. Julien Le Coupanec revised this gist Apr 6, 2014. No changes.
  9. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -159,11 +159,16 @@ casper.zoom(Number factor);
    casper.on(String event, Function then);
    casper.emit(String event);

    Events referenced: back, capture.saved, click, complete.error, die, downloaded.file, error, exit, fill, forward, http.auth, http.status.[code], load.started, load.failed, load.finished, log, mouse.click, mouse.down, mouse.move, mouse.up, navigation.requested, open, page.created, page.error, page.initialized, page.resource.received, page.resource.requested, popup.created, popup.loaded, popup.close, popup.created, remote.alert, remote.callback, remote.message, resource.received, resource.requested, run.complete, run.start, starting, started, step.added, step.complete, step.created, step.error, step.start, step.timeout, timeout, url.changed, viewport.changed, wait.done, wait.start, waitFor.timeout.
    // Events referenced: back, capture.saved, click, complete.error, die, downloaded.file, error, exit, fill, forward,
    // http.auth, http.status.[code], load.started, load.failed, load.finished, log, mouse.click, mouse.down, mouse.move,
    // mouse.up, navigation.requested, open, page.created, page.error, page.initialized, page.resource.received, page.resource.requested,
    // popup.created, popup.loaded, popup.close, popup.created, remote.alert, remote.callback, remote.message, resource.received, resource.requested,
    // run.complete, run.start, starting, started, step.added, step.complete, step.created, step.error, step.start, step.timeout, timeout, url.changed,
    // viewport.changed, wait.done, wait.start, waitFor.timeout

    casper.setFIlter(String event, Function then);

    Filters referenced: capture.target_filename, echo.message, log.message, open.location, page.confirm, page.prompt,
    // Filters referenced: capture.target_filename, echo.message, log.message, open.location, page.confirm, page.prompt


    // CasperJS Utils Module Cheatsheet
  10. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -213,7 +213,7 @@ var spooky = new Spooky({
    // do your stuff
    })

    // Passing values between spooky environment (NodeJS) to casper.
    // Passing values between spooky environment (NodeJS) to CasperJS.
    spooky.then([{ x: x }, function () { console.log('x:', x); }]); // function tuples
    spooky.thenEvaluate(function (x) { console.log('x:', x); }, { x: x }); // argument hashes

  11. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -203,7 +203,7 @@ utils.unique(array);
    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of the things I like with Spooky)
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of thing I like with Spooky)
    },
    casper: {
    logLevel: "debug",
  12. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -203,7 +203,7 @@ utils.unique(array);
    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of things I like with Spooky)
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of the things I like with Spooky)
    },
    casper: {
    logLevel: "debug",
  13. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -168,7 +168,7 @@ Filters referenced: capture.target_filename, echo.message, log.message, open.loc

    // CasperJS Utils Module Cheatsheet

    var utils = require(utils);
    var utils = require('utils');

    utils.betterTypeOf(input);
    utils.dump(value);
  14. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -210,7 +210,7 @@ var spooky = new Spooky({
    verbose: false
    }
    }, function() {
    // do your stuff.
    // do your stuff
    })

    // Passing values between spooky environment (NodeJS) to casper.
  15. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -203,7 +203,7 @@ utils.unique(array);
    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch your proxy (kind of things I like with Spooky)
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of things I like with Spooky)
    },
    casper: {
    logLevel: "debug",
  16. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -168,7 +168,7 @@ Filters referenced: capture.target_filename, echo.message, log.message, open.loc

    // CasperJS Utils Module Cheatsheet

    var utils = require('utils');
    var utils = require(utils);

    utils.betterTypeOf(input);
    utils.dump(value);
    @@ -203,7 +203,7 @@ utils.unique(array);
    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of things I like with Spooky)
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch your proxy (kind of things I like with Spooky)
    },
    casper: {
    logLevel: "debug",
  17. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -168,7 +168,7 @@ Filters referenced: capture.target_filename, echo.message, log.message, open.loc

    // CasperJS Utils Module Cheatsheet

    var utils = require(utils);
    var utils = require('utils');

    utils.betterTypeOf(input);
    utils.dump(value);
  18. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -166,7 +166,7 @@ casper.setFIlter(String event, Function then);
    Filters referenced: capture.target_filename, echo.message, log.message, open.location, page.confirm, page.prompt,


    UTILS MODULE
    // CasperJS Utils Module Cheatsheet

    var utils = require(’utils’);

    @@ -198,7 +198,7 @@ utils.serialize(value);
    utils.unique(array);


    // SPOOKY (is used to control Casper from Node)
    // Spooky Cheatsheet (Spooky is used to control CasperJS from the Node environment)

    var spooky = new Spooky({
    child: {
  19. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ $ brew install casperjs --devel // install CasperJS with brew
    var casper = require('casper').create({
    clientScripts: [
    'includes/jquery.js',
    'includes/underscore.js''
    'includes/underscore.js'
    ],
    exitOnError: true,
    httpStatusHandlers: { },
  20. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -24,8 +24,8 @@ $ brew install casperjs --devel // install CasperJS with brew

    var casper = require('casper').create({
    clientScripts: [
    includes/jquery.js,
    includes/underscore.js
    'includes/jquery.js',
    'includes/underscore.js''
    ],
    exitOnError: true,
    httpStatusHandlers: { },
  21. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ var casper = require('casper').create({
    ],
    exitOnError: true,
    httpStatusHandlers: { },
    logLevel: error,
    logLevel: "error",
    onAlert: null,
    onDie: null,
    onError: null,
    @@ -47,7 +47,7 @@ var casper = require('casper').create({
    loadImages: false,
    loadPlugins: false,
    localToRemoteUrlAccessEnabled: false,
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)',
    userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)",
    userName: null,
    password: null,
    XSSAuditingEnabled: false,
  22. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"

    // CasperJS Module Cheatsheet

    $ brew install casperjs --devel // install casperjs in your environment with brew
    $ brew install casperjs --devel // install CasperJS with brew

    var casper = require('casper').create({
    clientScripts: [
  23. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // PhantomJS Cheatsheet

    $ brew update && brew install phantomjs // install phantomjs in your environment with brew
    $ brew update && brew install phantomjs // install PhantomJS with brew

    phantom.exit();

  24. Julien Le Coupanec revised this gist Apr 6, 2014. 1 changed file with 39 additions and 39 deletions.
    78 changes: 39 additions & 39 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // PHANTOMJS
    // PhantomJS Cheatsheet

    $ brew update && brew install phantomjs // install phantomjs in your environment with brew

    @@ -18,48 +18,48 @@ page.onError = function(msg, trace) { console.log(msg); ... }
    page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {} );


    // CASPER MODULE
    // CasperJS Module Cheatsheet

    $ brew install casperjs --devel // install casperjs in your environment with brew

    var casper = require('casper').create({
    clientScripts: [
    ‘includes/jquery.js’,
    ‘includes/underscore.js’
    ],
    exitOnError: true,
    httpStatusHandlers: { },
    logLevel: “error”,
    onAlert: null,
    onDie: null,
    onError: null,
    onLoadError: null,
    onPageInitialized: null,
    onResourceReceived: null,
    onResourceRequested: null,
    onStepComplete: null,
    onStepTimeout: null,
    onTimeout: null,
    onWaitTimeout: null,
    page: null,
    pageSettings: {
    javascriptEnabled: true,
    loadImages: false,
    loadPlugins: false,
    localToRemoteUrlAccessEnabled: false,
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)',
    userName: null,
    password: null,
    XSSAuditingEnabled: false,
    },
    remoteScripts: [ ],
    safeLogs: [ ],
    stepTimeout: null,
    timeout: null,
    verbose: true,
    viewportSize: null,
    retryTimeout: 100,
    waitTimeout: 5000,
    clientScripts: [
    ‘includes/jquery.js’,
    ‘includes/underscore.js’
    ],
    exitOnError: true,
    httpStatusHandlers: { },
    logLevel: “error”,
    onAlert: null,
    onDie: null,
    onError: null,
    onLoadError: null,
    onPageInitialized: null,
    onResourceReceived: null,
    onResourceRequested: null,
    onStepComplete: null,
    onStepTimeout: null,
    onTimeout: null,
    onWaitTimeout: null,
    page: null,
    pageSettings: {
    javascriptEnabled: true,
    loadImages: false,
    loadPlugins: false,
    localToRemoteUrlAccessEnabled: false,
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)',
    userName: null,
    password: null,
    XSSAuditingEnabled: false,
    },
    remoteScripts: [ ],
    safeLogs: [ ],
    stepTimeout: null,
    timeout: null,
    verbose: true,
    viewportSize: null,
    retryTimeout: 100,
    waitTimeout: 5000,
    });

    casper.options.waitTimeout = 1000; // alter an option at runtime
  25. Julien Le Coupanec created this gist Apr 6, 2014.
    219 changes: 219 additions & 0 deletions casperjs.cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,219 @@
    // PHANTOMJS

    $ brew update && brew install phantomjs // install phantomjs in your environment with brew

    phantom.exit();

    var page = require('webpage').create();

    page.open('http://example.com', function() {});
    page.evaluate(function() { return document.title; });
    page.render('example.png');

    page.onConsoleMessage = function(msg) { console.log(msg); };
    page.onResourceRequested = function(request) { console.log('Request ' + JSON.stringify(request, undefined, 4)); };
    page.onResourceReceived = function(response) { console.log('Receive ' + JSON.stringify(response, undefined, 4)); };
    page.onError = function(msg, trace) { console.log(msg); ... }

    page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {} );


    // CASPER MODULE

    $ brew install casperjs --devel // install casperjs in your environment with brew

    var casper = require('casper').create({
    clientScripts: [
    ‘includes/jquery.js’,
    ‘includes/underscore.js’
    ],
    exitOnError: true,
    httpStatusHandlers: { },
    logLevel: “error”,
    onAlert: null,
    onDie: null,
    onError: null,
    onLoadError: null,
    onPageInitialized: null,
    onResourceReceived: null,
    onResourceRequested: null,
    onStepComplete: null,
    onStepTimeout: null,
    onTimeout: null,
    onWaitTimeout: null,
    page: null,
    pageSettings: {
    javascriptEnabled: true,
    loadImages: false,
    loadPlugins: false,
    localToRemoteUrlAccessEnabled: false,
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)',
    userName: null,
    password: null,
    XSSAuditingEnabled: false,
    },
    remoteScripts: [ ],
    safeLogs: [ ],
    stepTimeout: null,
    timeout: null,
    verbose: true,
    viewportSize: null,
    retryTimeout: 100,
    waitTimeout: 5000,
    });

    casper.options.waitTimeout = 1000; // alter an option at runtime

    casper.cli.args
    casper.cli.options
    casper.cli.has(); casper.cli.get(); casper.cli.drop();

    casper.back(),
    casper.exit([int status]);
    caper.forward();
    casper.run(fn onComplete[, int time]);
    casper.start(String url[, Function then]);
    casper.then(Function then);
    casper.thenBypass(Number nb);
    casper.thenBypassIf(Mixed condition, Number nb);
    casper.thenBypassUnless(Mixed condition, Number nb);
    casper.thenClick(String selector[, Function then]);
    casper.thenEvaluate(Function fn[, arg1[, arg2[, ...]]]);
    casper.thenOpen(String location[, mixed options]);
    casper.thenOpenAndEvaluate(String location[, Function then[, arg1[, arg2[, ...]]]);

    casper.base64encode(String url[, String method, Object data]);
    casper.bypass(Numbr nb);

    casper.click(String selector);
    casper.clickLabel(String label[, String tag]);

    casper.capture(String targetFilepath, Object clipRect);
    casper.captureBase64(String format[, Mixed area]);
    casper.captureSelector(String targetFile, String selector);

    casper.clear(); // clears the current page execution environment context
    casper.debugHTML([String selector, Boolean outer]);
    casper.debugPage();
    casper.die(String message[, int status]);

    casper.download(String url, String target[, String method, Object data]);

    casper.each(Array array, Function fn);
    casper.eachThen(String message[, String style]);

    casper.echo(String message[, String style]);
    casper.evaluate(Function fn[, arg1[, arg2[, ]]]);
    casper.evaluateOrDie(Function fn[, String message]);
    casper.exists(String selector);
    casper.fetchText(String selector);

    casper.log(String message[, String level, String space]);

    casper.fill(String selector, Object values[, Boolean submit]); // fields are referenced by name attribute
    casper.fillSelectors(String selector, Object values[, Boolean submit]); // fields are referenced by css3 selectors
    casper.fillXPath(String selector, Object values[, Boolean submit]); // fields are referenced by XPath selectors

    casper.getCurrentUrl();
    casper.getElement(s)Attribute(String selector, String attribute);
    casper.getElement(s)Bounds(String selector);
    casper.getElement(s)Info(String selector);
    casper.getFormValues(String selector);
    casper.getGlobal(String name);
    casper.getHTML([String selector, Boolean outer]);
    casper.getPageContent();
    casper.getTitle();

    casper.mouseEvent(String type, String selector); // mouseup, mousedown, click, mousemove, mouseover, mouseout

    casper.open(String location, Object Settings); // settings: method, data, headers
    casper.reload([Function then];
    casper.repeat(int times, Function then);
    casper.resourceExists(Mixed test);
    casper.sendKeys(Selector selector, String keys[, Object options]); // options: keepFocus, modifiers
    casper.setHttpAuth(String username, String password);
    casper.status(Boolean asString);

    casper.toString();
    casper.userAgent(String agent);
    casper.viewport(Number width, Number height[, Function then]);
    casper.visible(String selector);

    casper.unwait();
    casper.wait(Number timeout[, Function then]);
    casper.waitFor(Function testFx[, Function then, Function onTimeout, Number timeout]);
    casper.waitForPopup(String|RegExp urlPattern[, Function then, Function onTimeout, Number timeout]);
    casper.waitForResource(Function testFx[, Function then, Function onTimeout, Number timeout]);
    casper.waitForUrl(String|RegExp url[, Function then, Function onTimeout, Number timeout]);
    casper.waitForSelector(String selector[, Function then, Function onTimeout, Number timeout]);
    casper.waitWhileSelector(String selector[, Function then, Function onTimeout, Number timeout]);
    casper.waitForSelectorTextChange(String selectors[, Function then, Function onTimeout, Number timeout]);
    casper.waitForText(String text[, Function then, Function onTimeout, Number timeout]);
    casper.waitUntilVisible(String selector[, Function then, Function onTimeout, Number timeout]);
    casper.waitWhileVisible(String selector[, Function then, Function onTimeout, Number timeout]);
    casper.warn(String message);
    casper.withFrame(String|Number frameInfo, Function then);
    casper.withPopup(Mixed popupInfo, Function then);
    casper.zoom(Number factor);

    casper.on(String event, Function then);
    casper.emit(String event);

    Events referenced: back, capture.saved, click, complete.error, die, downloaded.file, error, exit, fill, forward, http.auth, http.status.[code], load.started, load.failed, load.finished, log, mouse.click, mouse.down, mouse.move, mouse.up, navigation.requested, open, page.created, page.error, page.initialized, page.resource.received, page.resource.requested, popup.created, popup.loaded, popup.close, popup.created, remote.alert, remote.callback, remote.message, resource.received, resource.requested, run.complete, run.start, starting, started, step.added, step.complete, step.created, step.error, step.start, step.timeout, timeout, url.changed, viewport.changed, wait.done, wait.start, waitFor.timeout.

    casper.setFIlter(String event, Function then);

    Filters referenced: capture.target_filename, echo.message, log.message, open.location, page.confirm, page.prompt,


    UTILS MODULE

    var utils = require(’utils’);

    utils.betterTypeOf(input);
    utils.dump(value);
    utils.fileExt(file);
    utils.fillBlanks(text, pad);
    utils.format(f);
    utils.getPropertyPath(Object obj, String path);
    utils.inherits(ctor, superCtor);

    utils.isArray(value);
    utils.isCasperObject(value);
    utils.isClipRect(value);
    utils.isFalsy(subject);
    utils.isFunction(value);
    utils.isJsFile(file);
    utils.isNull(value);
    utils.isNumber(value);
    utils.isObject(value);
    utils.isString(value);
    utils.isTruthy(subject);
    utils.isType(what, type);
    utils.isUndefined(value);
    utils.isWebPage(what);
    utils.mergeObjects(origin, add);
    utils.node(name, attributes);
    utils.serialize(value);
    utils.unique(array);


    // SPOOKY (is used to control Casper from Node)

    var spooky = new Spooky({
    child: {
    transport: "http",
    proxy: '192.128.101.42:9001' // incredibly powerful when you want to switch a proxy (kind of things I like with Spooky)
    },
    casper: {
    logLevel: "debug",
    verbose: false
    }
    }, function() {
    // do your stuff.
    })

    // Passing values between spooky environment (NodeJS) to casper.
    spooky.then([{ x: x }, function () { console.log('x:', x); }]); // function tuples
    spooky.thenEvaluate(function (x) { console.log('x:', x); }, { x: x }); // argument hashes