Show More
@@ -1,40 +1,41 | |||
|
1 | 1 | |
|
2 | 2 | |
|
3 | 3 | casper.get_list_items = function () { |
|
4 | 4 | return this.evaluate(function () { |
|
5 | 5 | return $.makeArray($('.item_link').map(function () { |
|
6 | 6 | return { |
|
7 | 7 | link: $(this).attr('href'), |
|
8 | 8 | label: $(this).find('.item_name').text() |
|
9 | } | |
|
9 | }; | |
|
10 | 10 | })); |
|
11 | 11 | }); |
|
12 | } | |
|
12 | }; | |
|
13 | 13 | |
|
14 | 14 | casper.test_items = function (baseUrl) { |
|
15 | 15 | casper.then(function () { |
|
16 | 16 | var items = casper.get_list_items(); |
|
17 | 17 | casper.each(items, function (self, item) { |
|
18 |
if (!item.label.match( |
|
|
18 | if (!item.label.match(/\.ipynb$/)) { | |
|
19 | 19 | var followed_url = baseUrl+item.link; |
|
20 |
if (!followed_url.match( |
|
|
20 | if (!followed_url.match(/\/\.\.$/)) { | |
|
21 | 21 | casper.thenOpen(followed_url, function () { |
|
22 | this.waitFor(this.page_loaded); | |
|
22 | 23 | casper.wait_for_dashboard(); |
|
23 | 24 | // getCurrentUrl is with host, and url-decoded, |
|
24 | 25 | // but item.link is without host, and url-encoded |
|
25 | 26 | var expected = baseUrl + decodeURIComponent(item.link); |
|
26 | 27 | this.test.assertEquals(this.getCurrentUrl(), expected, 'Testing dashboard link: ' + expected); |
|
27 | 28 | casper.test_items(baseUrl); |
|
28 | 29 | this.back(); |
|
29 | 30 | }); |
|
30 | 31 | } |
|
31 | 32 | } |
|
32 | 33 | }); |
|
33 | 34 | }); |
|
34 | } | |
|
35 | }; | |
|
35 | 36 | |
|
36 | 37 | casper.dashboard_test(function () { |
|
37 | 38 | baseUrl = this.get_notebook_server(); |
|
38 | 39 | casper.test_items(baseUrl); |
|
39 | }) | |
|
40 | }); | |
|
40 | 41 |
General Comments 0
You need to be logged in to leave comments.
Login now