Skip to content

Instantly share code, notes, and snippets.

@alexgibson
Forked from schalkneethling/casperjs-snippets.cson
Last active August 29, 2015 14:23
Show Gist options
  • Save alexgibson/86b333276b4ecdd4221e to your computer and use it in GitHub Desktop.
Save alexgibson/86b333276b4ecdd4221e to your computer and use it in GitHub Desktop.
".source.js":
"Casperjs Skeleton":
"prefix": "casper-init"
"body": """
/* This Source Code Form is subject to the terms of the Mozilla Public" + '/n' +
"* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global casper */
'use strict';
var config = require('../lib/config');
var helpers = require('../lib/helpers');
var path = '/firefox/sync/';
var url = config.base() + path;
casper.test.begin('Firefox Sync, Elements: ' + url, 1, function suite(test) {
casper.start(url, function() {
test.assertHttpStatus(200);
});
casper.run(function() {
test.done();
helpers.done();
});
});
"""
".source.js":
"Casperjs Begin Block":
"prefix": "casper-begin"
"body": """
casper.test.begin('$1' + url, 1, function suite(test) {
casper.start(url, function() {
$2
});
casper.run(function() {
test.done();
helpers.done();
});
});
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment