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

Getting 'Custom reporters must export a unique 'reporterName' property' issue while trying to use Custom Reporters. #2077

Closed
JaspreetBamrah opened this issue May 17, 2017 · 7 comments

Comments

@JaspreetBamrah
Copy link

The problem

I am getting the following error message while trying to use the Custom Reporters.
My config file:
var CustomReporter = require('./reporter/my.custom.reporter');

exports.config = {
reporters: [CustomReporter],
reporterOptions: {
outputDir: './'
}
}
My.custom.reporter.js contains:
var util = require('util'),
events = require('events');
var CustomReporter = function(options) {
....
}
same as available in the project.

ERROR: Error: Custom reporters must export a unique 'reporterName' property
at Launcher.initReporters

Environment

  1. appium -v. 1.6.4
  2. npm -v 4.2.0
  3. node -v v7.10.0
  4. java version "1.8.0_131"

Can someone help please.

@andriilazebnyi
Copy link
Member

andriilazebnyi commented May 17, 2017

@JaspreetBamrah

You can fix this by adding reporterName property to CustomReporter.

var CustomReporter = require('./reporter/my.custom.reporter');
CustomReporter.reporterName = 'myCustomReporter';

@JaspreetBamrah
Copy link
Author

@andriilazebnyi Thank you so much for your reply. And this goes in the config file?
Sorry I am still a new learner and I want to implement good looking HTML reports for my testing test results in Jasmine with WebDriverIO. Any suggestions please.

@JaspreetBamrah
Copy link
Author

@andriilazebnyi Adding the following code in config file did resolve my issue
var CustomReporter = require('./reporter/my.custom.reporter');
CustomReporter.reporterName = 'myCustomReporter';

But I want to have a HTML formatted report. Can we do this using Custom Reporter in WebDriverIO or is there a plugin?

@christian-bromann
Copy link
Member

I want to implement good looking HTML reports for my testing test results in Jasmine with WebDriverIO

Why don't you use the Allure reporter?

@JaspreetBamrah
Copy link
Author

JaspreetBamrah commented May 18, 2017

I did try my hands on the Allure reporter:

wdio config:
reporters: [allure],
reporterOptions: {
allure: {
outputDir: 'allure-results'
}
},
Command I am using:
allure generate './allure-results' && allure report open

Command Result:
Allure: Target directory /Users/jaspreet/Desktop/Jazz/Official/tests-mobileBK/tradie/allure-report for the report is already in use, add a '--clean' option to overwrite
jaspreets-mbp:tradie jaspreet$ allure generate './allure-results' --clean && allure report open
Report successfully generated to allure-report
Could not parse arguments: Expected a command, got report
Usage: allure [options] [command] [command options]
Options:
--help
Print commandline help.
-q, --quiet
Switch on the quiet mode.
Default: false
-v, --verbose
Switch on the verbose mode.
Default: false
--version
Print commandline version.
Default: false
Commands:
generate Generate the report
Usage: generate [options] The directories with allure results
Options:
-c, --clean
Clean Allure report directory before generating a new one.
Default: false
--profile
Allure commandline configuration profile.
-o, --report-dir, --output
The directory to generate Allure report into.
Default: allure-report

serve      Serve the report
  Usage: serve [options] The directories with allure results
    Options:
      -p, --port
        This port will be used to start web server for the report.
        Default: 0
      --profile
        Allure commandline configuration profile.

open      Open generated report
  Usage: open [options] The report directory
    Options:
      -p, --port
        This port will be used to start web server for the report.
        Default: 0

plugin      Generate the report
  Usage: plugin [options]
    Options:
      --profile
        Allure commandline configuration profile.

My /allure-report/index.html is an empty file. The Allure menu however appears on left but nothing in the index.html page.
Can you help please. What am I missing here?

@christian-bromann
Copy link
Member

It's all in the docs 😉

@christian-bromann
Copy link
Member

I think this can be closed now. If you have further questions on these topics come join our Gitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants