Files
zulip/frontend_tests/casperjs/samples/googletesting.coffee
Tim Abbott f1074aa491 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.
2015-10-28 10:11:47 -07:00

18 lines
627 B
CoffeeScript

casper = require("casper").create
logLevel: "debug"
casper.start "http://www.google.fr/", ->
@test.assertTitle "Google", "google homepage title is the one expected"
@test.assertExists 'form[action="/search"]', "main form is found"
@fill 'form[action="/search"]', q: "foo", true
casper.then ->
@test.assertTitle "foo - Recherche Google", "google title is ok"
@test.assertUrlMatch /q=foo/, "search term has been submitted"
@test.assertEval (->
__utils__.findAll("h3.r").length >= 10
), "google search for \"foo\" retrieves 10 or more results"
casper.run ->
@test.renderResults true