0.1.3 • Published 4 years ago

jest-reporter-testrail v0.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

NPM NPM NPM

Description

Reporter plugin that sends test coverage and test results to TestRail

It does not provide std output, please use with combination with the default reporter

Usage

  1. Installation

    npm install jest-reporter-testrail --save-dev

  2. Add reporter to jest configuration. Make sure to also include default reporter if reporters option was not provided

reporters: [
  'default',
  'jest-reporter-testrail'
],
  1. Provide required options from the configuration section

Configuration

Configuration can be provided via:

  • ENV variables
  • configuration file (.testrailrc)
  • reporter options in jest config

    reporters: [ 'default', ['jest-reporter-testrail', {option1: '', option2: ''}] ],

Both configuration file and reporter options use the same schema.

ENV VariableConfigDescriptionDefaultRequired
TESTRAIL_ENABLEenabledEnables TestRail integration.false
TESTRAIL_HOSThostURL of the TestRail instance.true
TESTRAIL_USERuserAccount name which will be used to push results.true
TESTRAIL_API_KEYapiKeyAPI key which can be generated on the profile page in TestRail.true
TESTRAIL_PROJECT_IDprojectIdProject id in which test cases are stored. Ex. P123true
TESTRAIL_SUITE_IDsuiteIdSuite id in which test cases are stored. Ex. S123true
TESTRAIL_COVERAGE_CASE_IDcoverageCaseIdTest Case ID which will be used to post test results. It will appear in Test Run as executed with coverage and results as description.true
TESTRAIL_RUN_NAMErunNameTest Run name. Configurable with variables %BRANCH% - see config option branchEnv%BUILD% - see config option buildNoEnv%DATE% - see config option dateFormat%BRANCH%#%BUILD% - %DATE%
TESTRAIL_RUN_DESCRIPTIONrunDescriptionYou can provide you own Test Run description. If this option is not configured, it will contain test results and test coverage.
TESTRAIL_REFERENCEreferenceString that will be added to the refs field in TestRail. This can enable integration with other tools like https://github.com/DamianOsipiuk/testcafe-reporter-testrail/. Configurable with variables %BRANCH% - see config option branchEnv%BUILD% - see config option buildNoEnv
TESTRAIL_BRANCH_ENVbranchEnvWhich ENV variable is used to store branch name on which tests are run.BRANCH
TESTRAIL_BUILD_NO_ENVbuildNoEnvWhich ENV variable is used to store build number of tests run.BUILD_NUMBER
TESTRAIL_DATE_FORMATdateFormatWhat date format should be used for %DATE% placeholder. https://momentjs.com/ formats supported.YYYY-MM-DD HH:mm:ss