Skip to content

RedisLabs/reportportal-testcafe-plugin

 
 

Repository files navigation

This is the reportportal-plugin reporter plugin for TestCafe.

Integrate with Reporter in your project

  1. Needs npm version>=6.9.0 (sudo npm install -g npm@6.9.0)

  2. Add the below to your external project: In package.json under "dependencies" add:

    "testcafe-reporter-reportportal-plugin": "npm:@redislabs/testcafe-reporter-reportportal-plugin@^0.1.1",
    
  3. In .npmrc add:

    @redislabs:registry=https://npm.pkg.github.com/redislabs
    

    Install the reporter via NPM

npm install @redislabs/testcafe-reporter-reportportal-plugin@0.1.1

Use the reporter in your TestCafe test run

When you run tests from the command line, specify the reporter name by using the --reporter option:

testcafe chrome 'path/to/test/file.js' --reporter reportportal-plugin

OR:

testcafe chrome 'path/to/test/file.js' --reporter=reportportal-plugin

When you use API, pass the reporter name to the reporter() method:

testCafe
    .createRunner()
    .src('path/to/test/file.js')
    .browsers('chrome')
    .reporter('reportportal-plugin') // <-
    .run();

Map of existing CLI Arguments:

Required Argument Description Example
Yes rdomain The domain of the report portal. https://{domain}/ --rdomain=reports.pl.portal.com
Yes rtoken The token to auth report portal with. Taken from the 'Profile' of your user. --rtoken=gfkbv5994350mg
Yes rlaunch The name of your launch. Required (Unless replaced by rlaunch-id argument). --rlaunch=my-launch
Yes rproject The name of your project. --rproject=my-project
No rlaunch-id The ID of an existing launch, can replace the rlaunch parameter. --rlaunch-id=fjvkdnvjgnf
No rsuite An optional suite name, adding a suite will put all tests under the suite instead of directly under the launch. --rsuite=my-suite-name
No rprotocol An optional ability to override the protocol of the API protocol. {protocol}://{domain}/. --rprotocol=http
No disable-live-reporting An optional ability to disable the live reporting --disable-live-reporting

Devloping the plugin?

in order to run tests in this plugin environment , in your cli run: (your reportportal parameters are listed under your reportportal profile)

npm run test ./tests/test.e2e.ts -- --rprotocol=https --rlaunch=launchName --rsuite=suitName --rdomain=YourReportportalDomain --rtoken=yourReportportalToken --rproject=YourReportportalProject

or

 testcafe chrome:headless tests/test.e2e.ts --rprotocol=https --rsuite=suitName --rdomain=YourReportportalDomain --rtoken=yourReportportalToken --rproject=YourReportportalProject --rlaunch=launchName --reporter reportportal-plugin

Adding a new appender

  1. extend LogAppender and implement its methods.
  2. in index.js: await this.logManager.addAppenders( { type: ConsoleLogAppender }, { type: ReportPortalAppender } );

Interested in contributing?

Please read our contributing guidelines here

Author

Redis https://github.com/RedisLabs/reportportal-testcafe-plugin/ forked from Dani Tseitlin (https://github.com/danitseitlin)

About

TestCafe reporter built to integrate with the Report Portal services.

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 90.6%
  • TypeScript 9.4%