Add tests for `Tester.skip`
Showing
1 changed file
with
63 additions
and
0 deletions
tests/suites/casper/skip.js
0 → 100644
1 | /*global casper*/ | ||
2 | /*jshint strict:false*/ | ||
3 | casper.test.begin('Skip tests', 1, function(test) { | ||
4 | casper.start('tests/site/index.html'); | ||
5 | |||
6 | casper. | ||
7 | then(function () { | ||
8 | test.skip(1); | ||
9 | }). | ||
10 | then(function () { | ||
11 | test.fail("This test should be skipped."); | ||
12 | }). | ||
13 | then(function () { | ||
14 | test.pass("This test should be executed."); | ||
15 | }); | ||
16 | |||
17 | casper.run(function() { | ||
18 | test.done(); | ||
19 | }); | ||
20 | }); | ||
21 | |||
22 | casper.test.begin('Skip multiple', 1, function(test) { | ||
23 | casper. | ||
24 | then(function () { | ||
25 | test.skip(2); | ||
26 | }). | ||
27 | then(function () { | ||
28 | test.fail("This test should be skipped."); | ||
29 | }). | ||
30 | then(function () { | ||
31 | test.fail("This test should be skipped."); | ||
32 | }). | ||
33 | then(function () { | ||
34 | test.pass("This test should be executed."); | ||
35 | }); | ||
36 | |||
37 | casper.run(function() { | ||
38 | test.done(); | ||
39 | }); | ||
40 | }); | ||
41 | |||
42 | casper.test.begin('Skip more than there is', 0, function(test) { | ||
43 | casper. | ||
44 | then(function () { | ||
45 | test.skip(2); | ||
46 | }); | ||
47 | |||
48 | casper.run(function() { | ||
49 | test.done(); | ||
50 | }); | ||
51 | }); | ||
52 | |||
53 | casper.test.begin('Next suite should be executed', 1, function(test) { | ||
54 | casper. | ||
55 | then(function () { | ||
56 | test.pass("This test should be executed."); | ||
57 | }); | ||
58 | |||
59 | casper.run(function() { | ||
60 | test.done(); | ||
61 | }); | ||
62 | }); | ||
63 |
-
Please register or sign in to post a comment