mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
Import CasperJS 1.0.0-RC4-0-g8c798c7
(imported from commit b24184d9de034ecf4054dbc72cd6c28b49309182)
This commit is contained in:
23
zephyr/tests/frontend/casperjs/samples/googletesting.js
Normal file
23
zephyr/tests/frontend/casperjs/samples/googletesting.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user