File tree 1 file changed +9
-1
lines changed 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,13 @@ casper.open_new_notebook = function () {
29
29
30
30
this . waitForPopup ( '' ) ;
31
31
32
- this . withPopup ( '' , function ( ) { this . waitForSelector ( '.CodeMirror-code' ) ; } ) ;
32
+ this . waitFor ( this . popup_has_url ) ;
33
33
this . then ( function ( ) {
34
+ console . log ( 'Opening a new notebook under URL: ' + this . popups [ 0 ] . url ) ;
34
35
this . open ( this . popups [ 0 ] . url ) ;
35
36
} ) ;
36
37
this . waitFor ( this . page_loaded ) ;
38
+ this . waitForSelector ( '.CodeMirror-code' ) ;
37
39
38
40
// Hook the log and error methods of the console, forcing them to
39
41
// serialize their arguments before printing. This allows the
@@ -88,6 +90,12 @@ casper.page_loaded = function() {
88
90
} ) ;
89
91
} ;
90
92
93
+ casper . popup_has_url = function ( ) {
94
+ // Return whether there is a popup with non blank URL.
95
+ var url = this . popups [ 0 ] . url ;
96
+ return typeof url !== 'undefined' && url != 'about:blank' ;
97
+ } ;
98
+
91
99
casper . kernel_running = function ( ) {
92
100
// Return whether or not the kernel is running.
93
101
return this . evaluate ( function ( ) {
You can’t perform that action at this time.
0 commit comments