{"name":"wdio-reporter","version":"5.0.0-alpha.4","description":"A WebdriverIO utility to help reporting all events","author":{"name":"Christian Bromann","email":"christian@saucelabs.com"},"homepage":"https://github.com/webdriverio/webdriverio/packages/wdio-reporter","license":"MIT","main":"./build/index","engines":{"node":">= 4.8.5"},"scripts":{"build":"run-s clean compile","clean":"rm -rf ./build","compile":"babel src/ -d build/","postversion":"npm run build && git tag -d $(git tag -l)","test":"run-s test:*","test:eslint":"eslint src test","test:unit":"jest"},"repository":{"type":"git","url":"git://github.com/webdriverio/webdriverio.git"},"keywords":["webdriver","wdio","wdio-reporter"],"bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"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 WDIOReporter from 'wdio-reporter'\n\nexport default MyCustomeReporter extends WDIOReporter {\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 WDIOReporter 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 `logDir` 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        logDir: '/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 WDIOReporter {\n    constructor () {\n        super()\n        console.log(this.options)\n        /**\n         * outputs:\n         * {\n         *   logDir: '/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 `WDIOReporter` parent class in order to push out logs, e.g.\n\n```js\nclass MyReporter extends WDIOReporter {\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## 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##### 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  parentUid: 'root suite2' } }\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  parentUid: 'root suite2',\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  state: 'pending' } }\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  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  state: 'passed',\n  end: '2018-02-09T14:11:29.578Z' } }\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     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  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```\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  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","readmeFilename":"README.md","_id":"wdio-reporter@5.0.0-alpha.4","_npmVersion":"6.1.0","_nodeVersion":"8.11.2","_npmUser":{"name":"christian-bromann","email":"christian@saucelabs.com"},"dist":{"integrity":"sha512-XAbNURGeW9f/nP4Gfg3mWWDGqEv0Ak7nYDd2IT2ZIso2HxKv2K2fWjZBqYUT6f4cT+KQybfwe1iwVqHF+e7vNg==","shasum":"201f4874f3f55fe3fc0d5992f8f678f1159fad6e","tarball":"http://registry-npm.ywwl.com/wdio-reporter/download/wdio-reporter-5.0.0-alpha.4.tgz","fileCount":9,"unpackedSize":27806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbL9R9CRA9TVsSAnZWagAApx4P+wYzD0fcVbLz4K/G7A5b\n5wKv/ZbQSEJOWIwo2WMtEyG/LHcMjJNFNDn3YKq010reXJFGOqd9uW0CaAxi\nqDGm2WgFOFfqXJjed2DIiZKGAGcGA5+l40W5eqFjt1lbidK1LOLuAw7pirE3\npj4s7W6+dv7JwzYDjy/ERe2Pkzrc+/ITuHJgMFzwA+oVVMtjGDveGxr5S6XJ\nLJltXrzDkaavjaESU8dyuwHrHV5EOKc2oNBdnQwZJxNchnvHLT4XAqVkk9NJ\nPeecYG1byr3x7ESRi2z88yMGq6qvYVnpdmoNL0pdG6Q2xoZT0BFl0F/AMO5j\nqutG0QIkOiiXul233oF34W6b9SwsSeFMBLD8QdbX278kQ3JtslqoECoo8fxu\nIKMQUl/+TPcVsNHEP0QAuU3cZ7Fvl5C2upogD6PGOlhtMfneTBMLKgoKgqhm\nJaBmeo+vqh88uZSwFcG0yarvpxuMR1izOlk1dzASGZcne9Yu3r6+FUjeZIFi\nKdyPip3fPzpocuKy6uts+Dfo2ZwDUhLit7lTPqh1QiSu0htL5BxkmBj8276H\nRFyNEbm2F0n3Ey+fuYUDzuP/NIVSLgT5HoDdieT4T0xDShCWB7C7GHo9yxAB\n0EUBFGxGLfkZQ9PgwnCDH3Prhe1rBRsQWUC15lCSCGWcuEjblaCbXd5s7Ftw\nZKEh\r\n=TRal\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQmPdCKVQoKUeCTeFuyxGeYV7+JRELMfJWrZMoDldWfQIgCmOx29zJqf8zZOP/LEbwxYnCnQIxuCg5lHrVNV1iXiw="}],"size":6304,"noattachment":false,"key":"/wdio-reporter/-/wdio-reporter-5.0.0-alpha.4.tgz"},"maintainers":[{"name":"christian-bromann","email":"christian@saucelabs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wdio-reporter_5.0.0-alpha.4_1529861245213_0.33501182801034735"},"_hasShrinkwrap":false,"publish_time":1529861245277,"_cnpm_publish_time":1529861245277,"dist-tags":{"alpha":"5.0.0-alpha.14","beta":"5.0.0-beta.0","latest":"5.0.0-alpha.7","next":"5.0.0-beta.3"}}