-
Notifications
You must be signed in to change notification settings - Fork 22
Update reporter to be compatible with wdio v5 #14
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
Changes from 12 commits
f7a4a31
2298e16
5030557
ded854a
cd4d97f
858fc60
b285f96
1e541b6
4928dc8
3cd81af
aaa5bab
4acffa6
aae35f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"es2015" | ||
[ | ||
"env", | ||
{ | ||
"targets": { | ||
"node": "8" | ||
} | ||
} | ||
] | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,4 @@ notifications: | |
|
||
language: node_js | ||
node_js: | ||
- "6" | ||
- "4" | ||
- "0.12" | ||
- "8" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,20 +20,20 @@ const { camelCase, get, invoke } = require('lodash'); | |
|
||
const paths = { | ||
browser: ({ suite }) => ['suite', 'runner', suite.cid, 'browserName'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this might need an update as well. I did a console.log(ctx) to see what object properties are available - you can see the result here Based on that, this works (at least for chrome): |
||
details: () => 'suite.err.stack', | ||
flowId: ({ suite }) => ['reporter', 'baseReporter', 'stats', 'runners', suite.cid, 'sessionID'], | ||
details: () => 'suite.error.stack', | ||
flowId: () => 'reporter.browser.sessionId', | ||
hash: () => 'suite.specHash', | ||
message: () => 'suite.err.message', | ||
message: () => 'suite.error.message', | ||
title: () => 'suite.title', | ||
}; | ||
|
||
const events = { | ||
'suite:start': '##teamcity[testSuiteStarted flowId=\'[flowId]\' name=\'[name]\']', | ||
'test:start': '##teamcity[testStarted flowId=\'[flowId]\' name=\'[name]\' captureStandardOutput=\'[captureStandardOutput]\']', | ||
'test:end': '##teamcity[testFinished flowId=\'[flowId]\' name=\'[name]\']', | ||
'test:fail': '##teamcity[testFailed flowId=\'[flowId]\' name=\'[name]\' message=\'[message]\' details=\'[details]\']', | ||
'test:pending': '##teamcity[testIgnored flowId=\'[flowId]\' name=\'[name]\' message=\'pending\']', | ||
'suite:end': '##teamcity[testSuiteFinished flowId=\'[flowId]\' name=\'[name]\']', | ||
var events = { | ||
'onSuiteStart': '##teamcity[testSuiteStarted flowId=\'[flowId]\' name=\'[name]\']', | ||
'onTestStart': '##teamcity[testStarted flowId=\'[flowId]\' name=\'[name]\' captureStandardOutput=\'[captureStandardOutput]\']', | ||
'onTestEnd': '##teamcity[testFinished flowId=\'[flowId]\' name=\'[name]\']', | ||
'onTestFail': '##teamcity[testFailed flowId=\'[flowId]\' name=\'[name]\' message=\'[message]\' details=\'[details]\']', | ||
'onTestSkip': '##teamcity[testIgnored flowId=\'[flowId]\' name=\'[name]\' message=\'pending\']', | ||
'onSuiteEnd': '##teamcity[testSuiteFinished flowId=\'[flowId]\' name=\'[name]\']' | ||
}; | ||
|
||
exports.buildFormatter = buildFormatter; | ||
|
@@ -52,7 +52,7 @@ function buildFormatter(eventName, opts) { | |
return formatter; | ||
|
||
function formatter(suite) { | ||
if (suite.pending && eventName !== 'test:pending') { | ||
if (suite.pending && eventName !== 'onTestSkip') { | ||
return ''; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like wdio tries to use this as a ES6 module.
Adding
module.exports.default = WdioTeamcityReporter;
made it not crash for me, when trying to consume this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added that. It should be working now. I was using importing the reporter instead of specifying the name so I didn't catch that. Thanks!