added a small coffeescript test
Showing
1 changed file
with
21 additions
and
0 deletions
tests/run.coffee
0 → 100644
1 | # a small subset of the run.js written in coffeescript | ||
2 | |||
3 | phantom.injectJs "casper.js" | ||
4 | casper = new phantom.Casper( | ||
5 | faultTolerant: false | ||
6 | verbose: true | ||
7 | ) | ||
8 | |||
9 | casper.start "tests/site/index.html", -> | ||
10 | @test.assertTitle "CasperJS test index", "Casper.start() casper can start itself an open an url" | ||
11 | @test.comment "fetching" | ||
12 | @test.assertEquals @fetchText("ul li"), "onetwothree", "Casper.fetchText() can retrieves text contents" | ||
13 | @test.comment "clicking" | ||
14 | @click "a[href=\"test.html\"]" | ||
15 | |||
16 | casper.test.comment "then" | ||
17 | casper.then -> | ||
18 | @test.assertTitle "CasperJS test target", "Casper.click() casper can click on a text link" | ||
19 | @click "a[href=\"form.html\"]" | ||
20 | |||
21 | casper.run() | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment