Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add console reporter statements to execution flow #205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions conf/profile.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,14 @@ exports.config = {
],

plugins: [
/*{name: './plugins/browserLogsPlugin'}*/
{name: './plugins/browserLogsPlugin'}
],

matchers: [],

/*
log: {
browser: {
level: 'error'
level: 'info'
}
}
*/
};
119 changes: 71 additions & 48 deletions src/reporter/consoleReporter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var _ = require('lodash');

/**
* @typedef ConsoleReporterConfig
Expand Down Expand Up @@ -34,26 +35,38 @@ JasmineConsoleReporter.prototype.jasmineStarted = function() {
};

JasmineConsoleReporter.prototype.suiteStarted = function() {
this.logger.info('Suite started: ' + this.collector.getCurrentSuite().name);
var that = this;
var suiteName = _.cloneDeep(that.collector.getCurrentSuite().name);
browser.controlFlow().execute(function () {
that.logger.info('Second try: Suite started: ' + suiteName);
});
};

JasmineConsoleReporter.prototype.specStarted = function() {
this.logger.info('Spec started: ' + this.collector.getCurrentSpec().name);
var that = this;
var specName = _.cloneDeep(that.collector.getCurrentSpec().name);
browser.controlFlow().execute(function () {
that.logger.info('Spec started: ' + specName);
});
};

JasmineConsoleReporter.prototype.specDone = function() {
var spec = this.collector.getCurrentSpec();
spec.expectations.forEach(function (expectation) {
if (expectation.status === 'failed') {
this.logger.info('Expectation FAILED: ' + expectation.message);
if(expectation.details){
this.logger.info('Expectation FAILED details: ${JSON.stringify(details)}',{details: expectation.details});
var that = this;
var spec = _.cloneDeep(that.collector.getCurrentSpec());
that.logger.info('Spec finished call is now');
browser.controlFlow().execute(function () {
spec.expectations.forEach(function (expectation) {
if (expectation.status === 'failed') {
that.logger.info('Expectation FAILED: ' + expectation.message);
if(expectation.details){
that.logger.info('Expectation FAILED details: ${JSON.stringify(details)}',{details: expectation.details});
}
that.logger.debug('Expectation FAILED stack: ${stack}',{stack: expectation.stack});
}
this.logger.debug('Expectation FAILED stack: ${stack}',{stack: expectation.stack});
}
},this);
this.logger.info('Spec finished: ' + this.collector.getCurrentSpec().name +
' with status: ' + spec.status.toUpperCase());
}, that);
that.logger.info('Spec finished: ' + spec.name +
' with status: ' + spec.status.toUpperCase());
});
/*
this.logger.info('Spec expectations summary' +
', total: ' + spec.statistic.expectations.total +
Expand All @@ -65,44 +78,54 @@ JasmineConsoleReporter.prototype.specDone = function() {
};

JasmineConsoleReporter.prototype.suiteDone = function() {
var suite = this.collector.getCurrentSuite();
this.logger.info('Suite finished: ' + suite.name +
' with status: ' + suite.status.toUpperCase() +
' for: ' + suite.statistic.duration/1000 + 's');
this.logger.info('Suite specs summary' +
', total: ' + suite.statistic.specs.total +
', passed: ' + suite.statistic.specs.passed +
', failed: ' + suite.statistic.specs.failed +
', pending: ' + suite.statistic.specs.pending +
', disabled: ' + suite.statistic.specs.disabled);
this.logger.info('Suite expectations summary' +
', total: ' + suite.statistic.expectations.total +
', passed: ' + suite.statistic.expectations.passed +
', failed total: ' + suite.statistic.expectations.failed.total +
', failed with error: ' + suite.statistic.expectations.failed.error +
', failed with image comparison: ' + suite.statistic.expectations.failed.image);
var that = this;
var suite = _.cloneDeep(that.collector.getCurrentSuite());
that.logger.info('Suite finished call is now');
browser.controlFlow().execute(function () {
that.logger.info('Suite finished: ' + suite.name +
' with status: ' + suite.status.toUpperCase() +
' for: ' + suite.statistic.duration/1000 + 's');
that.logger.info('Suite specs summary' +
', total: ' + suite.statistic.specs.total +
', passed: ' + suite.statistic.specs.passed +
', failed: ' + suite.statistic.specs.failed +
', pending: ' + suite.statistic.specs.pending +
', disabled: ' + suite.statistic.specs.disabled);
that.logger.info('Suite expectations summary' +
', total: ' + suite.statistic.expectations.total +
', passed: ' + suite.statistic.expectations.passed +
', failed total: ' + suite.statistic.expectations.failed.total +
', failed with error: ' + suite.statistic.expectations.failed.error +
', failed with image comparison: ' + suite.statistic.expectations.failed.image);
});
};

JasmineConsoleReporter.prototype.jasmineDone = function() {
var overview = this.collector.getOverview();
this.logger.info('Overall status: ' + overview.status.toUpperCase() +
' for: ' + overview.statistic.duration/1000 + 's');
this.logger.info('Overall suites summary' +
', total: ' + overview.statistic.suites.total +
', passed: ' + overview.statistic.suites.passed +
', failed: ' + overview.statistic.suites.failed);
this.logger.info('Overall specs summary' +
', total: ' + overview.statistic.specs.total +
', passed: ' + overview.statistic.specs.passed +
', failed: ' + overview.statistic.specs.failed +
', pending: ' + overview.statistic.specs.pending +
', disabled: ' + overview.statistic.specs.disabled);
this.logger.info('Overall expectations summary' +
', total: ' + overview.statistic.expectations.total +
', passed: ' + overview.statistic.expectations.passed +
', failed total: ' + overview.statistic.expectations.failed.total +
', failed with error: ' + overview.statistic.expectations.failed.error +
', failed with image comparison: ' + overview.statistic.expectations.failed.image);
var that = this;
var overview = _.cloneDeep(that.collector.getOverview());
that.logger.info('Overall status call is now');
/*
browser.controlFlow().execute(function () {
that.logger.info('Overall status: ' + overview.status.toUpperCase() +
' for: ' + overview.statistic.duration/1000 + 's');
that.logger.info('Overall suites summary' +
', total: ' + overview.statistic.suites.total +
', passed: ' + overview.statistic.suites.passed +
', failed: ' + overview.statistic.suites.failed);
that.logger.info('Overall specs summary' +
', total: ' + overview.statistic.specs.total +
', passed: ' + overview.statistic.specs.passed +
', failed: ' + overview.statistic.specs.failed +
', pending: ' + overview.statistic.specs.pending +
', disabled: ' + overview.statistic.specs.disabled);
that.logger.info('Overall expectations summary' +
', total: ' + overview.statistic.expectations.total +
', passed: ' + overview.statistic.expectations.passed +
', failed total: ' + overview.statistic.expectations.failed.total +
', failed with error: ' + overview.statistic.expectations.failed.error +
', failed with image comparison: ' + overview.statistic.expectations.failed.image);
});
*/
};

/**
Expand Down