1.0.0 • Published 1 year ago

wdio-wdiov5testrail-modified-reporter v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

wdio-wdiov5testrail-reporter

TestRail reporter for versions 5 and 6 of WebdriverIO

Installation

npm install wdio-wdiov5testrail-reporter --save-dev

Usage

Add the following to wdio.conf

const testrailUtil = require('wdio-wdiov5testrail-reporter/lib');
  beforeSession: function (config, capabilities, specs) {
    testrailUtil.startup();
  },
  onComplete: (exitCode, conf, capabilities, results) => {
    testrailUtil.cleanup(conf); // This method returns the run id used
  },
  reporters: [
    ['wdiov5testrail', {
      domain: 'your domain',
      username: 'your testrail username',
      password: 'your testrail password (or api key)',
      projectId: your testrail project id,
      // See below for additional options
    }],
  ],

REQUIRED options

NameDescription
domainTestRail domain. Do not include protocol.
usernameTestRail username / email.
passwordTestRail API key.
projectIdTestRail project id.

OPTIONAL... options

NameDescription
suiteIdTestRail suite id. Suite id for a multi-suite project Mandatory in multi-suite projects. Do not use in single-suite projects.
titleTitle of test run (or plan) to create.
runIdTestRail run id. Update a specific run instead of creating a new run.
useLatestRunIdtrue if updating latest run id instead of creating a new run. Defaults to false.
versionVersion tested, if required by TestRail instance.
createTestPlanIf true, creates a test plan to which runs are added. Runs within are appended with the browser name.
includeAlltrue to include all tests in run, regardless of whether actually run by Webdriver.io. Defaults to true.
strictCaseMatchingfalse to NOT throw an error if a test case found is not apart of the suite. Defaults to true.
skippedStatusIdA custom status id assigned to skipped tests. If not assigned, skipped tests will be marked as status 4.
closeTestRailRuntrue to close test run in Test Rail after tests are complete. Defaults to false.
casesFieldFilterA {key: value} object to filter cases added to the test run, e.g. {'priority_id': 1, 'type_id': 2}. Values should be taken from TestRails. Running with empty value or with missing closeTestRailRun option will return a full list of cases. NOTE 1: if you use multiple key:value pairs in the filter object it will work as AND conditions. NOTE 2: casesFieldFilter takes into account only if includeAll=false

Prefix all test assertions you wish to map with the test number.

Include the letter C.

 it(`C123 Can load the page`, function() {}

(optional) Add additional logging with addTestRailComment

const { addTestRailComment } = require('wdio-wdiov5testrail-reporter').default;
addTestRailComment('Will be added to test comment in TestRail');

Acknowledgement

@fijijavis - his reporter provided a solution for compiling test results