This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 986
/
flow.js
49 lines (49 loc) · 1.55 KB
/
flow.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Generated by CoffeeScript 1.8.0
casper.test.begin('handling waits and timeouts', 13, function(test) {
var step;
step = 0;
casper.start("tests/site/resources.html", function() {
test.assertEquals(++step, 1, "step 1");
this.wait(400, function() {
test.assertEquals(++step, 2, "step 1.1");
this.wait(200, function() {
test.assertEquals(++step, 3, "step 1.1.1");
return this.wait(200, function() {
return test.assertEquals(++step, 4, "step 1.1.1.1");
});
});
return this.then(function() {
return test.assertEquals(++step, 5, "step 1.1.2.1");
});
});
return this.wait(400, function() {
return test.assertEquals(++step, 6, "step 1.2");
});
});
casper.wait(200, function() {
return test.assertEquals(++step, 7, "step 2");
});
casper.waitForSelector('#noneExistingSelector', function() {
return test.fail("should run into timeout");
}, function() {
return test.assertEquals(++step, 8, "step 3 sucessfully timed out");
}, 1000);
casper.then(function() {
test.assertEquals(++step, 9, "step 4");
this.wait(300, function() {
test.assertEquals(++step, 10, "step 4.1");
return this.wait(300, function() {
return test.assertEquals(++step, 11, "step 4.1.1");
});
});
return this.wait(100, function() {
return test.assertEquals(++step, 12, "step 5.2");
});
});
casper.then(function() {
return test.assertEquals(++step, 13, "last step");
});
return casper.run(function() {
return test.done();
});
});