Move frontend tests out of zerver/tests/.

This fixes an unfortunate bug where the backend tests in
zerver/tests.py were not being run automatically, and also makes these
a bit easier to find.
This commit is contained in:
Tim Abbott
2015-10-13 17:34:50 -04:00
parent a36ac151ef
commit f1074aa491
211 changed files with 26 additions and 26 deletions

View File

@@ -0,0 +1,40 @@
/*jshint strict:false*/
/*global CasperError console phantom require*/
var casper = require("casper").create({
loadImages: false,
logLevel: "debug",
verbose: true
});
var links = {
"http://edition.cnn.com/": 0,
"http://www.nytimes.com/": 0,
"http://www.bbc.co.uk/": 0,
"http://www.guardian.co.uk/": 0
};
var fantomas = Object.create(casper);
fantomas.countLinks = function() {
return this.evaluate(function() {
return __utils__.findAll("a[href]").length;
});
};
fantomas.renderJSON = function(what) {
this.echo(JSON.stringify(what, null, " "));
};
fantomas.start();
Object.keys(links).forEach(function(url) {
fantomas.thenOpen(url, function() {
links[url] = this.countLinks();
});
});
fantomas.run(function() {
this.renderJSON(links);
this.exit();
});