tests: Move page console.log support into common.js

(imported from commit e875e67ad44ef10d9d84671a14a4d1755c0154df)
This commit is contained in:
Keegan McAllister 2013-03-21 19:52:38 -04:00
parent 0263bace8a
commit 50ef0a6edb
2 changed files with 9 additions and 8 deletions

View File

@ -79,6 +79,15 @@ exports.then_log_out = function () {
});
};
exports.enable_page_console = function () {
// Call this (after casper.start) to enable printing page-context
// console.log (plus some CasperJS-specific messages) to the
// terminal.
casper.on('remote.message', function (msg) {
casper.echo(msg);
});
};
exports.send_message = function (type, params) {
casper.waitForSelector('#left_bar_compose_' + type + '_button_big', function () {
casper.click('#left_bar_compose_' + type + '_button_big');

View File

@ -12,14 +12,6 @@ var utils = require('utils');
var common = require('../common.js').common;
// Uncomment this to get page-context console.log in the CasperJS output
// (plus some CasperJS-specific messages)
/*
casper.on('remote.message', function (msg) {
casper.echo(msg);
});
*/
common.start_and_log_in();
casper.then(function () {