From ebf1320e640631bfb9bf9201de6186a3df9d6f91 Mon Sep 17 00:00:00 2001 From: Paul Ivanov Date: Fri, 11 Oct 2013 13:28:00 -0700 Subject: [PATCH] use dashboard to simulate clicking new notebook --- IPython/html/tests/casperjs/util.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/IPython/html/tests/casperjs/util.js b/IPython/html/tests/casperjs/util.js index 84bda5fff..4a9ec5136 100644 --- a/IPython/html/tests/casperjs/util.js +++ b/IPython/html/tests/casperjs/util.js @@ -12,7 +12,19 @@ casper.get_notebook_server = function () { // Create and open a new notebook. casper.open_new_notebook = function () { var baseUrl = this.get_notebook_server(); - this.start(baseUrl + '/new'); + this.start(baseUrl); + this.thenClick('button#new_notebook'); + this.waitForPopup(''); + + this.then(function () { + // XXX: Kind of odd, the next line works for one test, but not when + // running multiple tests back-to-back, so we will just point the main + // casper browser to the same URL as the popup we just grabbed. + + //this.page = this.popups[0]; + this.open(this.popups[0].url); + }); + // initially, the cells aren't created, so wait for them to appear this.waitForSelector('.CodeMirror-code'); };