|
1 | | -casper.test.begin('CSS Transition', 25, function (test) { |
| 1 | +casper.test.begin('CSS Transition', 20, function (test) { |
2 | 2 |
|
3 | 3 | var minWait = 50, |
4 | 4 | transDuration = 200 |
5 | 5 |
|
6 | 6 | casper |
7 | 7 | .start('./fixtures/transition.html', function () { |
8 | 8 | test.assertElementCount('.test', 3) |
| 9 | + test.assertVisible('.test.if') |
9 | 10 | test.assertNotVisible('.test[data-id="1"]') |
10 | 11 | }) |
11 | 12 | .thenClick('.button-0') |
12 | 13 | .wait(minWait, function () { |
13 | | - test.assertElementCount('.test', 4) |
14 | 14 | test.assertVisible('.test[data-id="1"]') |
15 | 15 | }) |
16 | 16 | .thenClick('.button-1') |
17 | 17 | .wait(minWait, function () { |
18 | | - test.assertElementCount('.test', 4) |
19 | | - test.assertElementCount('.test.v-leave', 2) |
| 18 | + test.assertElementCount('.test.v-leave', 1) |
20 | 19 | }) |
21 | 20 | .wait(transDuration, function () { |
22 | | - test.assertElementCount('.test', 3) |
23 | 21 | test.assertElementCount('.test.v-leave', 0) |
24 | 22 | test.assertNotVisible('.test[data-id="1"]') |
25 | 23 | }) |
26 | 24 | .thenClick('.button-2') |
27 | 25 | .wait(minWait, function () { |
28 | | - test.assertElementCount('.test', 3) |
29 | | - test.assertElementCount('.test.v-leave', 2) |
| 26 | + test.assertElementCount('.test.v-leave', 1) |
30 | 27 | }) |
31 | 28 | .wait(transDuration, function () { |
32 | | - test.assertElementCount('.test', 2) |
| 29 | + test.assertElementCount('.test.v-leave', 0) |
33 | 30 | test.assertNotVisible('.test[data-id="1"]') |
34 | 31 | test.assertNotVisible('.test[data-id="2"]') |
35 | 32 | }) |
36 | 33 | .thenClick('.push') |
37 | 34 | .wait(minWait, function () { |
38 | | - test.assertElementCount('.test', 4) |
39 | 35 | test.assertVisible('.test[data-id="3"]') |
40 | 36 | }) |
41 | 37 | .thenClick('.pop') |
| 38 | + .thenClick('.pop') |
42 | 39 | .wait(minWait, function () { |
43 | | - test.assertElementCount('.test', 4) |
44 | 40 | test.assertElementCount('.test.v-leave', 2) |
45 | 41 | }) |
46 | 42 | .wait(transDuration, function () { |
47 | | - test.assertElementCount('.test', 2) |
| 43 | + test.assertNotVisible('.test.if') |
48 | 44 | test.assertNotVisible('.test[data-id="1"]') |
49 | 45 | test.assertNotVisible('.test[data-id="2"]') |
50 | 46 | }) |
51 | 47 | .thenClick('.splice') |
52 | 48 | .wait(minWait, function () { |
53 | | - test.assertElementCount('.test', 3) |
54 | 49 | test.assertVisible('.test[data-id="99"]') |
55 | 50 | }) |
56 | 51 | // test Array swapping with transition |
57 | 52 | .thenEvaluate(function () { |
58 | 53 | test.items = [test.items[1], {a:3}] |
59 | 54 | }) |
60 | | - .wait(transDuration + minWait, function () { |
61 | | - test.assertElementCount('.test', 3) |
| 55 | + .wait(minWait, function () { |
| 56 | + test.assertVisible('.test.if') |
| 57 | + test.assertVisible('.test[data-id="99"]') |
62 | 58 | test.assertVisible('.test[data-id="3"]') |
63 | 59 | }) |
64 | 60 | .run(function () { |
|
0 commit comments