Commit 4cb79a2c 4cb79a2c8654a5a38f21dae729c4acb03f3cf6ab by Nicolas Perriault

added a Casper.history property, storing all the browsed urls

1 parent 930a75d7
......@@ -53,6 +53,7 @@
timeout: null,
verbose: false
};
// privates
// local properties
this.checker = null;
this.colorizer = new phantom.Casper.Colorizer();
......@@ -1605,6 +1606,8 @@
} else {
casper.log("Successfully injected Casper client-side utilities", "debug");
}
// history
casper.history.push(casper.getCurrentUrl());
casper.loadInProgress = false;
};
page.onResourceReceived = function(resource) {
......
......@@ -210,5 +210,8 @@ casper.wait(1000, function(self) {
casper.run(function(self) {
self.test.comment('logging, again');
self.test.assertEquals(self.result.log.length, 3, 'log() logged messages');
self.test.comment('history');
self.test.assert(self.history.length > 0, 'Casper.history contains urls');
self.test.assertMatch(self.history[0], /tests\/site\/index\.html$/, 'Casper.history has the correct first url');
self.test.renderResults(true, 0, save);
});
......