Skip to content

Commit

Permalink
Fix Linux JS Test CI job (#269)
Browse files Browse the repository at this point in the history
* Fix failing CI

* Wait for non-blank URL instead of explicit wait
  • Loading branch information
krassowski authored Jan 17, 2024
1 parent f9e5b2b commit 9dd5216
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nbclassic/tests/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ casper.open_new_notebook = function () {

this.waitForPopup('');

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

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

casper.popup_has_url = function() {
// Return whether there is a popup with non blank URL.
var url = this.popups[0].url;
return typeof url !== 'undefined' && url != 'about:blank';
};

casper.kernel_running = function() {
// Return whether or not the kernel is running.
return this.evaluate(function() {
Expand Down

0 comments on commit 9dd5216

Please sign in to comment.