Closed ShMajed closed 1 year ago
@ShMajed you should use programmatic way
new Mocha({ reporter: 'mocha-multi-reporters', reporterOptions: { reporterEnabled: 'spec,mocha-junit-reporter,@reportportal/agent-js-mocha', mochaJunitReporterReporterOptions: { mochaFile: 'path.xml' }, reportportalAgentJsMochaReporterOptions: { token: 'xxxx', endpoint: 'endpoint', project: 'project', launch: 'launch', description: 'desc', } } });
I got it working with a config like this File: multi-reporter-config.json
{
"reporterEnabled": "mochawesome, @reportportal/agent-js-mocha",
"mochawesomeReporterOptions": {
"code": false,
"charts": true,
"reportFilename": "[datetime]-[name]",
"timestamp": "isoDateTime",
"json": true,
"html": true
},
"reportportalAgentJsMochaReporterOptions": {
"token": "00000000-0000-0000-0000-000000000000",
"endpoint": "https://your.reportportal.server/api/v1",
"project": "YourReportPortalProjectName",
"launch": "YourLauncherName",
"attributes": [
{
"key": "component",
"value": "something"
},
{
"key": "test-suite",
"value": "regression"
},
{
"key": "environment",
"value": "development"
},
{
"key": "component-version",
"value": "4.0.0"
},
{
"key": "languages",
"value": "language"
}
]
}
}
And using the following command in package.json scripts
"regression": "mocha --reporter mocha-multi-reporters --reporter-options configFile=./multi-reporter-config.json ./tests/*",
Hope this helps.
@nixpix works perfectly, thanks for the help 🚀
Hey,
I'm trying to use mocha-multi-reporters to have two reports, the issue is that the report portal is not showing any reports after passing it in the report option
my mocharc file looks like this
is there a way to make this possible?