Skip to content

Commit 9dd5216

Browse files
authored
Fix Linux JS Test CI job (#269)
* Fix failing CI * Wait for non-blank URL instead of explicit wait
1 parent f9e5b2b commit 9dd5216

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

nbclassic/tests/util.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ casper.open_new_notebook = function () {
2929

3030
this.waitForPopup('');
3131

32-
this.withPopup('', function () {this.waitForSelector('.CodeMirror-code');});
32+
this.waitFor(this.popup_has_url);
3333
this.then(function () {
34+
console.log('Opening a new notebook under URL: ' + this.popups[0].url);
3435
this.open(this.popups[0].url);
3536
});
3637
this.waitFor(this.page_loaded);
38+
this.waitForSelector('.CodeMirror-code');
3739

3840
// Hook the log and error methods of the console, forcing them to
3941
// serialize their arguments before printing. This allows the
@@ -88,6 +90,12 @@ casper.page_loaded = function() {
8890
});
8991
};
9092

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+
9199
casper.kernel_running = function() {
92100
// Return whether or not the kernel is running.
93101
return this.evaluate(function() {

0 commit comments

Comments
 (0)