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 a separate property for the reporter factory function #6286

Closed
mokone91 opened this issue Jun 7, 2021 · 8 comments
Closed

Add a separate property for the reporter factory function #6286

mokone91 opened this issue Jun 7, 2021 · 8 comments
Labels
TYPE: enhancement The accepted proposal for future implementation.

Comments

@mokone91
Copy link

mokone91 commented Jun 7, 2021

Seems it's not possible to use local reporter using config file now.
Its can be wery useful feature, especially as is possible with js interface.


{
    reporter: [
        {
            'name/path': 'test/reporter.ts',
            'output': './e2e_report.xml'
        }
}
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 7, 2021
@Dmitry-Ostashev
Copy link
Contributor

This functionality will be available after we support the JS configuration file. You will be able to load your reporter using the require method. Please track the following issue to be notified of our progress: #5109

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 8, 2021
@mokone91
Copy link
Author

Hi! seems js configuration already implemented, is there any guide which shows how can i use my local reporter?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 24, 2021
@Dmitry-Ostashev
Copy link
Contributor

Hi @mokone91,

You can specify your local reporter in the JS configuration file in the following way:

.testcaferc.js

const reporter = require('./reporter');

module.exports = {
    reporter,
    browsers: 'chrome',
    src: ['test.js']
}

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 26, 2021
@mokone91
Copy link
Author

mokone91 commented Nov 26, 2021

Hi!
So i have implemented it using next snippet:


const customReporter = require('./customReporter');

module.exports = {
  ...
  reporter: [
    {
      name: 'spec'
    },
    {
      name: customReporter,
      output: './reports/e2e_report.xml'
    }
  ],
}

and seems it works as expected, the only point here - I passing reporter as name 🙃

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 26, 2021
@miherlosev
Copy link
Collaborator

@mokone91

It occurred due to the parsing reporting parameters algorithm. It's not part of a public API and can be changed at any time. Please, use the approach from the #6286 (comment).

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 29, 2021
@mokone91
Copy link
Author

@mokone91

It occurred due to the parsing reporting parameters algorithm. It's not part of a public API and can be changed at any time. Please, use the approach from the #6286 (comment).

Hi @miherlosev

But how then I can select multiple reporters and configure outputPath for custom?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 29, 2021
@miherlosev
Copy link
Collaborator

miherlosev commented Dec 1, 2021

Hi @mokone91

We discussed this with @AndreyBelym one more time and decided the following:

  1. We should make a separate property for a reporter if it's specified as a factory function.
const customReporter = require('./customReporter');

module.exports = {
  ...
  reporter: [
    {
      reporter: customReporter, <--- new property
      output: './reports/e2e_report.xml'
    }
  ],
}
  1. The name property should accept only the string name of a reporter. We should raise a warning if the value of the another type is accepted.
  2. We recommend using the name property until the new property is implemented.

@miherlosev miherlosev reopened this Dec 1, 2021
@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Dec 1, 2021
@miherlosev miherlosev added the TYPE: enhancement The accepted proposal for future implementation. label Dec 1, 2021
@miherlosev miherlosev changed the title Local reporter Add a separate property for the reporter factory function Dec 1, 2021
@AndreyBelym AndreyBelym added this to the Pre-2.0 Breaking changes milestone Jul 7, 2022
@AlexKamaev
Copy link
Contributor

Since there is a workaround (using the name property) and the issue is not popular among TestCafe users, we decided to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

5 participants