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