Report Portal Reporter
wdio-reportportal-reporter is a 3rd party package, for more information please see GitHub | npm
A WebdriverIO v6 reporter plugin to report results to Report Portal(http://reportportal.io/). For v4 version see this branch For Report Portal v4 use
5.X.Xreleases
Installation#
The easiest way is to keep wdio-reportportal-reporter and wdio-reportportal-service as a devDependency in your package.json.
Instructions on how to install WebdriverIO can be found here.
Configuration#
Configure the output directory in your wdio.conf.js file:
Complete guide with a project sample demonstrating integration of WebdriverIO with Report Portal#
See readme in wdio-rp-integration-demoC
Additional API#
Api methods can be accessed using:
Methods description#
reporter.sendLog(level, message)โ send log to current suite\test item.level(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].message(String)โ log message content.
reporter.sendFile(level, name, content, [type])โ send file to current suite\test item.level(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].name(string)โ file name.content(String) โ attachment contenttype(String, optional) โ attachment MIME-type,image/pngby default
reporter.sendLogToTest(test, level, message)- send log to specific test.test(object) - test object fromafterTest\afterStepwdio hooklevel(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].message(String)โ log message content.
reporter.sendFileToTest(test, level, name, content, [type])โ send file to to specific test.test(object) - test object fromafterTest\afterStepwdio hooklevel(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].name(string)โ file name.content(String) โ attachment contenttype(string, optional) โ attachment MIME-type,image/pngby default
Pay attention: sendLog\sendFile sends log to current running test item. It means if you send log without active test(e.g from hooks or on suite level) it will not be reported Report Portal UI.
Methods sendLogToTest\sendFileToTest are useful when you need to send screenshots or logs to the failed test item from wdio afterTest hook.
Mocha example:
Jasmine example:
WDIO Cucumber "5.14.3+" Example:
Getting link to Report Portal UI launch page#
or more complicated way
Reporting test to existing launch#
If you want report test to existing active launch you may pass it to reporter by environment variable REPORT_PORTAL_LAUNCH_ID
You are responsible for finishing launch as well as starting such launch.
License#
This project is licensed under the MIT License - see the LICENSE.md file for details