diff --git a/IPython/html/tests/casperjs/util.js b/IPython/html/tests/casperjs/util.js
index 8659769..91d1f78 100644
--- a/IPython/html/tests/casperjs/util.js
+++ b/IPython/html/tests/casperjs/util.js
@@ -11,6 +11,8 @@ casper.getNotebookServer = function () {
casper.openNewNotebook = function () {
var baseUrl = this.getNotebookServer();
this.start(baseUrl + '/new');
+ // initially, the cells aren't created, so wait for them to appear
+ this.waitForSelector('.CodeMirror-code');
};
// Shut down the current notebook's kernel.