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,26 @@
/*jshint strict:false*/
/*global CasperError console phantom require*/
var casper = require("casper").create({
logLevel: "debug"
});
casper.start("http://www.google.fr/", function() {
this.test.assertTitle("Google", "google homepage title is the one expected");
this.test.assertExists('form[action="/search"]', "main form is found");
this.fill('form[action="/search"]', {
q: "foo"
}, true);
});
casper.then(function() {
this.test.assertTitle("foo - Recherche Google", "google title is ok");
this.test.assertUrlMatch(/q=foo/, "search term has been submitted");
this.test.assertEval((function() {
return __utils__.findAll("h3.r").length >= 10;
}), "google search for \"foo\" retrieves 10 or more results");
});
casper.run(function() {
this.test.renderResults(true);
});