Skip to content

Commit

Permalink
Merge pull request #183 from Evilweed/time6a
Browse files Browse the repository at this point in the history
fix protractor 6 duration issue #140
  • Loading branch information
miller45 authored Sep 25, 2019
2 parents f9264c6 + 3f8415f commit 360eb06
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 135 deletions.
9 changes: 5 additions & 4 deletions app/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class Jasmine2Reporter {

this._screenshotReporter = screenshotReporter;
this._suiteNames = [];
this._times = [];

}

Expand All @@ -200,11 +201,11 @@ class Jasmine2Reporter {
}

specStarted(result) {
this._addTaskToFlow(async () => result.started = nowString());
this._addTaskToFlow(async () => this._times.push(nowString()));
}

specDone(result) {
this._addTaskToFlow(async () => this._asyncSpecDone(result));
this._addTaskToFlow(async () => this._asyncSpecDone(result, this._times.pop()));
}

_addTaskToFlow(callback) {
Expand All @@ -226,12 +227,12 @@ class Jasmine2Reporter {
this._asyncFlow = null;
}

async _asyncSpecDone(result) {
async _asyncSpecDone(result, start) {
// Don't report if it's skipped and we don't need it
if (['pending', 'disabled', 'excluded'].includes(result.status) && this._screenshotReporter.excludeSkippedSpecs) {
return;
}

result.started = start;
result.stopped = nowString();

await this._gatherBrowserLogs(result);
Expand Down
Loading

0 comments on commit 360eb06

Please sign in to comment.