{"name":"@wdio/reporter","version":"8.8.6","keywords":["webdriver","wdio","wdio-reporter"],"author":{"name":"Christian Bromann","email":"mail@bromann.dev"},"license":"MIT","_id":"@wdio/reporter@8.8.6","maintainers":[{"name":"christian-bromann","email":"mail@bromann.dev"},{"name":"wdio-user","email":"christian+webdriverio@saucelabs.com"},{"name":"wswebcreation-nl","email":"wim@wswebcreation.nl"}],"homepage":"https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-reporter","bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"4f396cccfcea2f65131a7326b9df2a191c98f127","tarball":"http://registry-npm.ywwl.com/@wdio/reporter/download/@wdio/reporter-8.8.6.tgz","fileCount":30,"integrity":"sha512-UNOR7UAK6uuokE/ZSZJ6Hat/ThJgoPYb5nwNUPK2OVGNO48iwbiDubwCGRkdn3M9hJzqwqkdLIjqnc2iYqisQQ==","signatures":[{"sig":"MEYCIQCi3CHR/kfJQPwb2hwCBuBdvfd1OB9pznkfZRfH6hxe3gIhAPwdisfZtivjX+brIY7GR81eDFfhTlvUsbKm+P1QlkP6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQZtPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9Nw//UL02ggU9V7MTbyaVH/Bg+g8k+v/MMHO8aNk4gKgZvr/mLvxA\r\nHvFFJ9NBZDQurdk49qEmqha4S1ku3Z9DCIHAuOCe6cvWqU1Kh1H9AWMvSloC\r\nJXkOP4oZ0mol/v2Xly7WneSN99sk3ll0Gf0Rn5ANamtjP4DQ+kSicohVIhC2\r\nEyCoyOsQJeXElWy1OXywqiUNSeENvOXVA5gsx+kiH+n00KRULSI9A4Zwk6FH\r\np/bparA10yo1jMxqx2vbg4ROd31ftK/U03OPeVg9JcroZ9RNa4N3OUgV+tRJ\r\nxjlC7R5cewzhAs5Ktd5/lY7daxrROTFxiVMbFxy72AQaQe8Zed8sSmiBsaET\r\nadKFiTgQC1oeexaLhVFpMDYjSDWJiolnTYtk5RVtPVmdI0fi/4Tf6FNoO3zO\r\n3WnHXACV1ho+hHOm0sfJB5Gf+uGb/KiRAz5a+F/xqfzUlo+FR+0eLkSY3QJH\r\nymonZTR0WSreLIw2kb+7jo5Taa93KiAm01Q6QUOBmwUIP4I3YgvB98EAdO+5\r\nd4OyV20gO4/LZ8uhBOUyD2lm6ltJRN6IHjuUR01hzznr9jbB46w3xW25THJI\r\nFFIztQfEdv1NukoUivjSWo12k+CNHNjALjDOLHpzeC3sAkWlT4tAJavWd1Y8\r\nALE9pZIi0aske+pohQzBt20iPBQxa8A+iXk=\r\n=Io+g\r\n-----END PGP SIGNATURE-----\r\n","size":14073,"noattachment":false,"key":"/@wdio/reporter/-/@wdio/reporter-8.8.6.tgz"},"type":"module","types":"./build/index.d.ts","engines":{"node":"^16.13 || >=18"},"exports":{".":"./build/index.js","./package.json":"./package.json"},"gitHead":"0db3b2f595ef834e6e01f58873dbde776dc08240","_npmUser":{"name":"wdio-user","email":"christian+webdriverio@saucelabs.com"},"repository":{"url":"git://github.com/webdriverio/webdriverio.git","type":"git","directory":"packages/wdio-reporter"},"_npmVersion":"lerna/6.6.1/node@v18.16.0+x64 (linux)","description":"A WebdriverIO utility to help reporting all events","directories":{},"_nodeVersion":"18.16.0","dependencies":{"diff":"^5.0.0","@types/node":"^18.0.0","@wdio/types":"8.8.6","@wdio/logger":"8.6.6","object-inspect":"^1.12.0","supports-color":"9.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tmp":"^0.2.1","@types/tmp":"^0.2.3","@types/diff":"^5.0.2","@types/object-inspect":"^1.8.1","@types/supports-color":"^8.1.1"},"typeScriptVersion":"3.8.3","_npmOperationalInternal":{"tmp":"tmp/reporter_8.8.6_1682021198969_0.9979950997975879","host":"s3://npm-registry-packages"},"readme":"WebdriverIO Reporter\n====================\n\n> A WebdriverIO utility to help reporting all events\n\nThe `@wdio/reporter` package can be used to create own custom reporter and publish them to NPM. They have to follow a specific convention as described below in order to work properly. First you need to add `@wdio/reporter` as dependency of your custom reporter:\n\n```sh\nnpm install @wdio/reporter\n```\n\nor\n\n```sh\nyarn add @wdio/reporter\n```\n\nThen you need to extend your reporter with the main `@wdio/reporter` class:\n\n```js\nimport Reporter from '@wdio/reporter'\n\nexport default MyCustomReporter extends Reporter {\n    constructor () {\n        super()\n        // your custom logic if necessary\n        // ...\n    }\n\n    onRunnerStart () {\n        // ...\n    }\n\n    onSuiteStart (suite) {\n        // ...\n    }\n\n    // ...\n}\n```\n\nThe `Reporter` parent class calls your event functions if provided when an event was triggered and provides information on that event in a consistent format. You can always register your own listener to receive the raw data that was provided by the framework, e.g. instead of using the `onSuiteStart` method you can do:\n\n```js\nthis.on('suite:start', (raw) => {\n    // ...\n})\n```\n\nin your constructor function.\n\n## Configuration\n\nUser can pass in custom configurations for each reporter. Per default WebdriverIO populates the `outputDir` and `logLevel` option to the reporter, they can get overwritten too. For example, if the user has provided the following reporter options:\n\n```js\n// wdio.conf.js\nexports.config = {\n    // ...\n    reporters: ['dot', ['my-reporter', {\n        outputDir: '/some/path',\n        foo: 'bar'\n    }]]\n    // ...\n}\n```\n\nyour options in your reporter class are as follows:\n\n```js\nexport default class MyReporter extends Reporter {\n    constructor () {\n        super()\n        console.log(this.options)\n        /**\n         * outputs:\n         * {\n         *   outputDir: '/some/path',\n         *   logLevel: 'trace',\n         *   foo: 'bar'\n         * }\n         */\n    }\n}\n```\n\nYou can access all options via `this.options`. You can push logs to stdout or a log file depending of whether the `stdout` option is true or false. Please use the internal method `write` that is provided by the `Reporter` parent class in order to push out logs, e.g.\n\n```js\nclass MyReporter extends Reporter {\n    constructor (options) {\n        /**\n         * make dot reporter to write to output stream by default\n         */\n        options = Object.assign(options, { stdout: true })\n        super(options)\n    }\n\n    // ...\n    onTestPass (test) {\n        this.write(`test \"${test.title}\" passed`)\n    }\n    // ...\n}\n```\n\nThis will result the following output:\n\n```\n\"MyReporter\" Reporter:\ntest \"some test\" passed\ntest \"some other test\" passed\n\n\"spec\" Reporter:\n...\n```\n\nIf `stdout` is set to `false` WebdriverIO will automatically write to a filestream at a location where other logs are stored as well.\n\n## Synchronization\n\nIf your reporter needs to do some async computation after the test (e.g. upload logs to a server) you can overwrite the `isSynchronised` getter method to manage this. By default this property always returns true as most of the reporters don't require to do any async work. However in case you need to handle this overwrite the getter method with an custom implementation (e.g. [wdio-sumologic-reporter](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-sumologic-reporter)).\n\n```js\nclass MyReporter extends Reporter {\n    constructor (options) {\n        // ...\n    }\n\n    get isSynchronised (test) {\n        return this.unsyncedMessages.length === 0\n    }\n\n    // ...\n}\n```\n\nThe wdio testrunner will wait to kill the runner process until every reporter has the `isSynchronised` property set to `true`.\n\n## Events\n\nDuring a test run in WebdriverIO several events are thrown and can be captured by your event functions. The following events are propagated:\n\n### Test Events\n\nThese events are containing data about the test regardless of the framework it is running in.\n\n##### onSuiteStart\n\n```js\nSuiteStats {\n  type: 'suite',\n  start: '2018-02-09T13:30:40.177Z',\n  duration: 0,\n  uid: 'root suite2',\n  cid: '0-0',\n  title: 'root suite',\n  fullTitle: 'root suite',\n  tests: [],\n  hooks: [],\n  suites: [] } }\n```\n\n##### onSuiteEnd\n\n```js\nSuiteStats {\n  type: 'suite',\n  start: '2018-02-09T13:30:40.177Z',\n  duration: 1432,\n  uid: 'root suite2',\n  cid: '0-0',\n  title: 'root suite',\n  fullTitle: 'root suite',\n  tests: [ [TestStats] ],\n  hooks: [ [HookStats], [HookStats] ],\n  suites: [ [Object] ],\n  end: '2018-02-09T13:30:41.609Z' } }\n```\n\n##### onSuiteRetry\n\n(Cucumber only)\n\n```js\nSuiteStats {\n  start: 2024-11-13T06:33:21.499Z,\n  end: undefined,\n  type: 'scenario',\n  uid: '0',\n  cid: '0-0',\n  file: '/Users/christian.bromann/Sites/WebdriverIO/projects/webdriverio/examples/wdio/cucumber/features/my-feature.feature',\n  title: 'Get size of an element',\n  fullTitle: 'my-feature.feature:1:1: Get size of an element',\n  tags: [],\n  tests: [],\n  hooks: [],\n  suites: [],\n  parent: 'my-feature.feature:1:1',\n  retries: 1,\n  hooksAndTests: [],\n  description: '',\n  rule: undefined\n}\n```\n\n##### onHookStart\n\n```js\nHookStats {\n  type: 'hook',\n  start: '2018-02-09T13:30:40.181Z',\n  duration: 0,\n  uid: '\"before each\" hook4',\n  cid: '0-0',\n  title: '\"before each\" hook',\n  parent: 'root suite',\n```\n\n##### onHookEnd\n\n```js\nHookStats {\n  type: 'hook',\n  start: '2018-02-09T13:30:40.181Z',\n  duration: 1,\n  uid: '\"before each\" hook4',\n  cid: '0-0',\n  title: '\"before each\" hook',\n  parent: 'root suite',\n  end: '2018-02-09T13:30:40.182Z' } }\n```\n\n##### onTestStart\n\n```js\nTestStats {\n  type: 'test',\n  start: '2018-02-09T13:30:40.180Z',\n  duration: 0,\n  uid: 'passing test3',\n  cid: '0-0',\n  title: 'passing test',\n  fullTitle: 'passing test',\n  retries: 0,\n  state: 'pending' } }\n```\n\nCucumber tests come with an additional `argument` property containing data tables if used in feature files, e.g.:\n\n```js\nTestStats {\n  type: 'test',\n  start: '2019-07-08T08:44:56.666Z',\n  duration: 0,\n  uid: 'I add the following grocieries16',\n  cid: '0-0',\n  title: 'I add the following grocieries',\n  output: [],\n  argument: [{\n    rows: [{\n      cells: ['Item', 'Amount'],\n      locations: [{\n        line: 17,\n        column: 11\n      }, {\n        line: 17,\n        column: 24\n      }]\n    }, {\n      cells: ['Milk', '2'],\n      locations: [{\n        line: 18,\n        column: 11\n      }, {\n        line: 18,\n        column: 24\n      }]\n    }, {\n      cells: ['Butter', '1'],\n      locations: [{\n        line: 19,\n        column: 11\n      }, {\n        line: 19,\n        column: 24\n      }]\n    }, {\n        cells: ['Noodles', '1'],\n      locations: [{\n        line: 20,\n        column: 11\n      }, {\n        line: 20,\n        column: 24\n      }]\n    }, {\n      cells: ['Schocolate', '3'],\n      locations: [{\n        line: 21,\n        column: 11\n      }, {\n        line: 21,\n        column: 24\n      }]\n    }]\n  }],\n  state: 'pending'\n}\n```\n\n##### onTestSkip\n\n```js\nTestStats {\n  type: 'test',\n  start: '2018-02-09T14:01:04.573Z',\n  duration: 0,\n  uid: 'skipped test6',\n  cid: '0-0',\n  title: 'skipped test',\n  fullTitle: 'skipped test',\n  retries: 0,\n  state: 'skipped' }\n```\n\n##### onTestPass\n\n```js\nTestStats {\n  type: 'test',\n  start: '2018-02-09T14:11:28.075Z',\n  duration: 1503,\n  uid: 'passing test3',\n  cid: '0-0',\n  title: 'passing test',\n  fullTitle: 'passing test',\n  retries: 0,\n  state: 'passed',\n  end: '2018-02-09T14:11:29.578Z' } }\n```\n\n##### onTestRetry\n\n```js\nTestStats {\n  type: 'test',\n  start: 2020-09-23T07:54:34.601Z,\n  _duration: 2495,\n  uid: 'test-00-0',\n  cid: '0-0',\n  title: 'test fails and retries',\n  fullTitle: 'test fails and retries',\n  retries: 0,\n  state: 'failed',\n  end: 2020-09-23T07:54:37.096Z,\n  error:\n      { message: 'some error',\n        stack: `Error: some error\\n    at Context.it (/path/to/project/test/b.js:17:19)\\n\n  at /path/to/project/packages/wdio-sync/src/index.js:490:28\\n    at Promise (<anonymous>)\\\nn    at F (/path/to/project/node_modules/core-js/library/modules/_export.js:35:28)\\n    at\nContext.executeSync (/path/to/project/packages/wdio-sync/src/index.js:488:12)\\n    at /path/to/project/packages/wdio-sync/src/index.js:623:33`,\n        type: 'Error' } } }\n```\n\n##### onTestFail\n\n```js\nTestStats {\n     type: 'test',\n     start: '2018-02-09T14:11:29.581Z',\n     duration: 21,\n     uid: 'failing test8',\n     cid: '0-0',\n     title: 'failing test',\n     fullTitle: 'failing test',\n     retries: 0,\n     state: 'failed',\n     end: '2018-02-09T14:11:29.602Z',\n     error:\n      { message: 'some error',\n        stack: `Error: some error\\n    at Context.it (/path/to/project/test/b.js:17:19)\\n\n  at /path/to/project/packages/wdio-sync/src/index.js:490:28\\n    at Promise (<anonymous>)\\\nn    at F (/path/to/project/node_modules/core-js/library/modules/_export.js:35:28)\\n    at\nContext.executeSync (/path/to/project/packages/wdio-sync/src/index.js:488:12)\\n    at /path/to/project/packages/wdio-sync/src/index.js:623:33`,\n        type: 'Error' } } }\n```\n\n##### onTestEnd\n\n```js\nTestStats {\n  type: 'test',\n  start: '2018-02-09T14:11:28.075Z',\n  duration: 1503,\n  uid: 'passing test3',\n  cid: '0-0',\n  title: 'passing test',\n  fullTitle: 'passing test',\n  retries: 0,\n  state: 'passed',\n  end: '2018-02-09T14:11:29.578Z' } }\n```\n\n### Runner Events\n\nThese events contain information on the test runner.\n\n##### onRunnerStart\n\n```js\nRunnerStats {\n  type: 'runner',\n  start: '2018-02-09T14:30:19.871Z',\n  duration: 0,\n  cid: '0-0',\n  capabilities:\n   { acceptInsecureCerts: false,\n     browserName: 'firefox',\n     browserVersion: '59.0',\n     'moz:accessibilityChecks': false,\n     'moz:headless': false,\n     'moz:processID': 92113,\n     'moz:profile': '/var/folders/ns/8mj2mh0x27b_gsdddy1knnsm0000gn/T/rust_mozprofile.jlpfs632Becb',\n     'moz:webdriverClick': true,\n     pageLoadStrategy: 'normal',\n     platformName: 'darwin',\n     platformVersion: '17.3.0',\n     rotatable: false,\n     timeouts: { implicit: 0, pageLoad: 300000, script: 30000 } },\n  sanitizedCapabilities: 'firefox.59_0.darwin',\n  config: [Object],\n  specs: [ '/path/to/project/test/my.test.js' ] },\n  retry: 0\n```\n\n##### onRunnerEnd\n\n```js\nRunnerStats {\n  type: 'runner',\n  start: '2018-02-09T14:30:19.871Z',\n  duration: 1546,\n  uid: undefined,\n  cid: '0-0',\n  capabilities: [Object],\n  sanitizedCapabilities: 'firefox.59_0.darwin',\n  config: [Object],\n  specs: [ '/path/to/project/test/my.test.js' ],\n  failures: 1,\n  retries: 1,\n  end: '2018-02-09T14:30:21.417Z' } }\n```\n\n### Client Events\n\nClient events are triggered when certain interactions with the automation driver are happening.\n\n##### onBeforeCommand\n\n```js\n{ method: 'GET',\n  endpoint: '/session/:sessionId/element',\n  body: { using: 'css selector', value: 'img' }\n  cid: '0-0',\n  sessionId: '4d1707ae-820f-1645-8485-5a820b2a40da',\n  capabilities: [Object] }\n```\n\n##### onAfterCommand\n\n```js\n{ method: 'GET',\n  endpoint: '/session/:sessionId/element/fbf57b79-6521-7d49-b3b7-df91cf2c347a/rect',\n  body: {},\n  result: { value: { x: 75, y: 11, width: 160, height: 160 } },\n  cid: '0-0',\n  sessionId: '4d1707ae-820f-1645-8485-5a820b2a40da',\n  capabilities: [Object] }\n```\n","publish_time":1682021199157,"_cnpm_publish_time":1682021199157,"dist-tags":{"beta":"7.0.0-beta.4","latest":"10.2.0","next":"10.2.0-alpha.100.sha-b38abd894","v7":"7.40.0","v8":"8.43.0","v9":"9.33.1"}}