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.X
releases
#
InstallationThe 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.
#
ConfigurationConfigure the output directory in your wdio.conf.js file:
#
Complete guide with a project sample demonstrating integration of WebdriverIO with Report PortalSee readme in wdio-rp-integration-demoC
#
Additional APIApi methods can be accessed using:
#
Methods descriptionreporter.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/png
by default
reporter.sendLogToTest(test, level, message)
- send log to specific test.test
(object) - test object fromafterTest\afterStep
wdio 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\afterStep
wdio hooklevel
(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].name
(string)โ file name.content
(String) โ attachment contenttype
(string, optional) โ attachment MIME-type,image/png
by 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 pageor more complicated way
#
Reporting test to existing launchIf 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.
#
LicenseThis project is licensed under the MIT License - see the LICENSE.md file for details