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

Make reporter compatible with WebdriverIO v5 #36

Closed
christian-bromann opened this issue Jan 8, 2019 · 4 comments · Fixed by #38
Closed

Make reporter compatible with WebdriverIO v5 #36

christian-bromann opened this issue Jan 8, 2019 · 4 comments · Fixed by #38

Comments

@christian-bromann
Copy link

Hola 👋

WebdriverIO released v5 around Christmas, see also this blogpost. To make this reporter usable with the new version there are some small adjustments necessary. There are some minor changes that need to be made. You can find a general overview here. Most important ones to point out are:

  • set "@wdio/cli": "^5.0.0" as peerDependency
  • let the reporter extend from @wdio/reporter
  • change the constructor so it calls super()
    Note: if your reporter is designed to report to stdout have it the following way:
    /**
     * make reporter to write to output stream by default
     */
    options = Object.assign(options, { stdout: true });
    super(options)
    if your reporter should rather report to a file per default just call:
    super(options)
  • all file or stdout messages need to be propagated by this.write("my log message")

Feel free to drop by the webdriverio/v5 support channel in case you need support.

Thanks so much for contributing to the WebdriverIO community. We really appreciate it 🙏 !

@christian-bromann
Copy link
Author

Any updates?

@fijijavis
Copy link
Collaborator

fijijavis commented May 15, 2019

@christian-bromann Almost done. I've run across an issue I'm hoping you can help address.

In v4 as part of the test result we could see a list of the wdio commands that were executed for a test under an output key. Something like:

output: [{ type: 'screenshot', payload: { filename: 'test.png' } }]

This reporter uses that info to determine if any screenshots were captured during test execution. If there were screenshots, then we could have them embedded directly in the HTML report.

With v5, it appears that output key is no longer available. Was that purposefully removed? Does this even make sense?

@christian-bromann
Copy link
Author

@fijijavis you should be able to use the beforeCommand and afterCommand methods to track the commands that are being called during the test.

@fijijavis
Copy link
Collaborator

@christian-bromann Somehow I completely missed those 🤦‍♂️. Thanks

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

Successfully merging a pull request may close this issue.

2 participants