{"action":"created","comment":{"url":"https://api.github.com/repos/DevExpress/testcafe/pulls/comments/60724098","id":60724098,"diff_hunk":"@@ -0,0 +1,232 @@\n+---\n+layout: docs\n+title: Custom Reporter Plugin\n+permalink: /documentation/extending-testcafe/custom-reporter-plugin/\n+---\n+# Custom Reporter Plugin\n+\n+TestCafe has a number of [built-in reporters](../../../using-testcafe/common-concepts/reporters.md) to generate test reports in different formats.\n+You can also create a **custom reporter** that will output information in your own format and style.\n+For this purpose, you can use the [TestCafe reporter generator](https://github.com/DevExpress/generator-testcafe-reporter).\n+The generator will scaffold out a reporter plugin, so that you only need to write a few lines of code.\n+\n+For more information on how to implement the plugin, see the following sections.\n+\n+* [Generating Reporter Project](#generating-reporter-project)\n+* [Implementing Reporter](#implementing-reporter)\n+* [Building Reporter](#building-reporter)\n+* [Testing Reporter](#testing-reporter)\n+* [Previewing Report](#previewing-report)\n+* [Using Reporter Development Version](#using-reporter-development-version)\n+* [Publishing Reporter to NPM](#publishing-reporter-to-npm)\n+* [Reference](#reference)\n+\n+## Generating Reporter Project\n+\n+First, install [Yeoman](http://yeoman.io) and `generator-testcafe-reporter` using [npm](https://www.npmjs.com/).\n+\n+```bash\n+npm install -g yo\n+npm install -g generator-testcafe-reporter\n+```\n+\n+Create a new directory where the generator should place your scaffolded project files and go into it.\n+\n+```bash\n+mkdir my-reporter\n+cd my-reporter\n+```\n+\n+**Note:** It is recommended to name the directory as you would like to name the reporter project. When you run the generator, it will automatically suggest the reporter name that matches the reporter directory name. As for the reporter package name, it will consist of two parts - the `{testcafe-reporter-}` prefix and the name of the reporter itself:\n+\n+```text\n+{testcafe-reporter-my-reporter}\n+```\n+\n+Then run the reporter generator to create a new project:\n+\n+```bash\n+yo testcafe-reporter\n+```\n+\n+The generator will provide additional settings to customize your reporter.\n+Then Yeoman will automatically scaffold out your reporter, install the required dependencies, and pull in several useful Gulp tasks for your workflow.\n+\n+## Implementing Reporter\n+\n+Once the reporter has been scaffolded out, go to the reporter directory and open the `src/index.js` file.\n+\n+You have to implement four reporter methods.\n+\n+```js\n+reportTaskStart (/* startTime, userAgents, testCount */) {\n+    throw new Error('Not implemented');\n+},\n+\n+reportFixtureStart (/* name, path */) {\n+    throw new Error('Not implemented');\n+},\n+\n+reportTestDone (/* name, errs, durationMs, unstable, screenshotPath */) {\n+    throw new Error('Not implemented');\n+},\n+\n+reportTaskDone (/* endTime, passed */) {\n+    throw new Error('Not implemented');\n+}\n+```\n+\n+These methods should output the desired information at certain moments during test run.\n+\n+* **reportTaskStart** - fires when a test task is started, that is at the beginning of testing.\n+\n+* **reportFixtureStart** - fires each time a fixture is started.\n+\n+* **reportTestDone** - fires each time a test is finished.\n+\n+* **reportTaskDone** - fires when the entire task is finished, that is at the end of testing.\n+\n+All the required data is provided to these methods through their parameters.\n+\n+To output information, use [helper methods](helper-methods.md) and libraries.\n+TestCafe will mixin the helper methods to the reporter, so that you can access the helper methods by using `this`.\n+\n+In the `src/index.js` file, you can also enable or disable coloring a reporter output by using the `noColors` property. To color the output, use the [chalk](helper-methods.md#chalk) helper method.","path":"docs/articles/documentation/extending-testcafe/custom-reporter/index.md","position":94,"original_position":94,"commit_id":"973c2f562df7110bb87910836e049d9f38a2b239","original_commit_id":"973c2f562df7110bb87910836e049d9f38a2b239","user":{"login":"VasilyStrelyaev","id":11459924,"avatar_url":"https://avatars.githubusercontent.com/u/11459924?v=3","gravatar_id":"","url":"https://api.github.com/users/VasilyStrelyaev","html_url":"https://github.com/VasilyStrelyaev","followers_url":"https://api.github.com/users/VasilyStrelyaev/followers","following_url":"https://api.github.com/users/VasilyStrelyaev/following{/other_user}","gists_url":"https://api.github.com/users/VasilyStrelyaev/gists{/gist_id}","starred_url":"https://api.github.com/users/VasilyStrelyaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VasilyStrelyaev/subscriptions","organizations_url":"https://api.github.com/users/VasilyStrelyaev/orgs","repos_url":"https://api.github.com/users/VasilyStrelyaev/repos","events_url":"https://api.github.com/users/VasilyStrelyaev/events{/privacy}","received_events_url":"https://api.github.com/users/VasilyStrelyaev/received_events","type":"User","site_admin":false},"body":"you can say\r\n*enable or disable reporter output coloring*\r\nor\r\n*enable or disable coloring of the reporter output*\r\n","created_at":"2016-04-22T11:14:41Z","updated_at":"2016-04-22T11:14:41Z","html_url":"https://github.com/DevExpress/testcafe/pull/378#discussion_r60724098","pull_request_url":"https://api.github.com/repos/DevExpress/testcafe/pulls/378","_links":{"self":{"href":"https://api.github.com/repos/DevExpress/testcafe/pulls/comments/60724098"},"html":{"href":"https://github.com/DevExpress/testcafe/pull/378#discussion_r60724098"},"pull_request":{"href":"https://api.github.com/repos/DevExpress/testcafe/pulls/378"}}},"pull_request":{"url":"https://api.github.com/repos/DevExpress/testcafe/pulls/378","id":61093673,"html_url":"https://github.com/DevExpress/testcafe/pull/378","diff_url":"https://github.com/DevExpress/testcafe/pull/378.diff","patch_url":"https://github.com/DevExpress/testcafe/pull/378.patch","issue_url":"https://api.github.com/repos/DevExpress/testcafe/issues/378","number":378,"state":"open","locked":false,"title":"Docs Custom Reporter","user":{"login":"MargaritaLoseva","id":12034505,"avatar_url":"https://avatars.githubusercontent.com/u/12034505?v=3","gravatar_id":"","url":"https://api.github.com/users/MargaritaLoseva","html_url":"https://github.com/MargaritaLoseva","followers_url":"https://api.github.com/users/MargaritaLoseva/followers","following_url":"https://api.github.com/users/MargaritaLoseva/following{/other_user}","gists_url":"https://api.github.com/users/MargaritaLoseva/gists{/gist_id}","starred_url":"https://api.github.com/users/MargaritaLoseva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MargaritaLoseva/subscriptions","organizations_url":"https://api.github.com/users/MargaritaLoseva/orgs","repos_url":"https://api.github.com/users/MargaritaLoseva/repos","events_url":"https://api.github.com/users/MargaritaLoseva/events{/privacy}","received_events_url":"https://api.github.com/users/MargaritaLoseva/received_events","type":"User","site_admin":false},"body":"/cc @inikulin @VasilyStrelyaev \r\n\r\nFixes #288 \r\n","created_at":"2016-02-29T15:23:50Z","updated_at":"2016-04-22T11:14:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1318ec0ec90b3568e14fbc9bc031ca1b276fb697","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DevExpress/testcafe/pulls/378/commits","review_comments_url":"https://api.github.com/repos/DevExpress/testcafe/pulls/378/comments","review_comment_url":"https://api.github.com/repos/DevExpress/testcafe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DevExpress/testcafe/issues/378/comments","statuses_url":"https://api.github.com/repos/DevExpress/testcafe/statuses/973c2f562df7110bb87910836e049d9f38a2b239","head":{"label":"MargaritaLoseva:CustomReporter","ref":"CustomReporter","sha":"973c2f562df7110bb87910836e049d9f38a2b239","user":{"login":"MargaritaLoseva","id":12034505,"avatar_url":"https://avatars.githubusercontent.com/u/12034505?v=3","gravatar_id":"","url":"https://api.github.com/users/MargaritaLoseva","html_url":"https://github.com/MargaritaLoseva","followers_url":"https://api.github.com/users/MargaritaLoseva/followers","following_url":"https://api.github.com/users/MargaritaLoseva/following{/other_user}","gists_url":"https://api.github.com/users/MargaritaLoseva/gists{/gist_id}","starred_url":"https://api.github.com/users/MargaritaLoseva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MargaritaLoseva/subscriptions","organizations_url":"https://api.github.com/users/MargaritaLoseva/orgs","repos_url":"https://api.github.com/users/MargaritaLoseva/repos","events_url":"https://api.github.com/users/MargaritaLoseva/events{/privacy}","received_events_url":"https://api.github.com/users/MargaritaLoseva/received_events","type":"User","site_admin":false},"repo":{"id":50342524,"name":"testcafe","full_name":"MargaritaLoseva/testcafe","owner":{"login":"MargaritaLoseva","id":12034505,"avatar_url":"https://avatars.githubusercontent.com/u/12034505?v=3","gravatar_id":"","url":"https://api.github.com/users/MargaritaLoseva","html_url":"https://github.com/MargaritaLoseva","followers_url":"https://api.github.com/users/MargaritaLoseva/followers","following_url":"https://api.github.com/users/MargaritaLoseva/following{/other_user}","gists_url":"https://api.github.com/users/MargaritaLoseva/gists{/gist_id}","starred_url":"https://api.github.com/users/MargaritaLoseva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MargaritaLoseva/subscriptions","organizations_url":"https://api.github.com/users/MargaritaLoseva/orgs","repos_url":"https://api.github.com/users/MargaritaLoseva/repos","events_url":"https://api.github.com/users/MargaritaLoseva/events{/privacy}","received_events_url":"https://api.github.com/users/MargaritaLoseva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MargaritaLoseva/testcafe","description":"","fork":true,"url":"https://api.github.com/repos/MargaritaLoseva/testcafe","forks_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/forks","keys_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/teams","hooks_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/hooks","issue_events_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/issues/events{/number}","events_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/events","assignees_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/assignees{/user}","branches_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/branches{/branch}","tags_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/tags","blobs_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/git/refs{/sha}","trees_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/statuses/{sha}","languages_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/languages","stargazers_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/stargazers","contributors_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/contributors","subscribers_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/subscribers","subscription_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/subscription","commits_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/commits{/sha}","git_commits_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/git/commits{/sha}","comments_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/comments{/number}","issue_comment_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/issues/comments{/number}","contents_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/contents/{+path}","compare_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/merges","archive_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/downloads","issues_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/issues{/number}","pulls_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/pulls{/number}","milestones_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/milestones{/number}","notifications_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/labels{/name}","releases_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/releases{/id}","deployments_url":"https://api.github.com/repos/MargaritaLoseva/testcafe/deployments","created_at":"2016-01-25T10:12:58Z","updated_at":"2016-01-25T10:13:00Z","pushed_at":"2016-04-22T10:06:16Z","git_url":"git://github.com/MargaritaLoseva/testcafe.git","ssh_url":"git@github.com:MargaritaLoseva/testcafe.git","clone_url":"https://github.com/MargaritaLoseva/testcafe.git","svn_url":"https://github.com/MargaritaLoseva/testcafe","homepage":null,"size":25052,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DevExpress:master","ref":"master","sha":"029b50efeda927bddfe64591d922cf2887a78018","user":{"login":"DevExpress","id":4243232,"avatar_url":"https://avatars.githubusercontent.com/u/4243232?v=3","gravatar_id":"","url":"https://api.github.com/users/DevExpress","html_url":"https://github.com/DevExpress","followers_url":"https://api.github.com/users/DevExpress/followers","following_url":"https://api.github.com/users/DevExpress/following{/other_user}","gists_url":"https://api.github.com/users/DevExpress/gists{/gist_id}","starred_url":"https://api.github.com/users/DevExpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevExpress/subscriptions","organizations_url":"https://api.github.com/users/DevExpress/orgs","repos_url":"https://api.github.com/users/DevExpress/repos","events_url":"https://api.github.com/users/DevExpress/events{/privacy}","received_events_url":"https://api.github.com/users/DevExpress/received_events","type":"Organization","site_admin":false},"repo":{"id":34262857,"name":"testcafe","full_name":"DevExpress/testcafe","owner":{"login":"DevExpress","id":4243232,"avatar_url":"https://avatars.githubusercontent.com/u/4243232?v=3","gravatar_id":"","url":"https://api.github.com/users/DevExpress","html_url":"https://github.com/DevExpress","followers_url":"https://api.github.com/users/DevExpress/followers","following_url":"https://api.github.com/users/DevExpress/following{/other_user}","gists_url":"https://api.github.com/users/DevExpress/gists{/gist_id}","starred_url":"https://api.github.com/users/DevExpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevExpress/subscriptions","organizations_url":"https://api.github.com/users/DevExpress/orgs","repos_url":"https://api.github.com/users/DevExpress/repos","events_url":"https://api.github.com/users/DevExpress/events{/privacy}","received_events_url":"https://api.github.com/users/DevExpress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DevExpress/testcafe","description":"","fork":false,"url":"https://api.github.com/repos/DevExpress/testcafe","forks_url":"https://api.github.com/repos/DevExpress/testcafe/forks","keys_url":"https://api.github.com/repos/DevExpress/testcafe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DevExpress/testcafe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DevExpress/testcafe/teams","hooks_url":"https://api.github.com/repos/DevExpress/testcafe/hooks","issue_events_url":"https://api.github.com/repos/DevExpress/testcafe/issues/events{/number}","events_url":"https://api.github.com/repos/DevExpress/testcafe/events","assignees_url":"https://api.github.com/repos/DevExpress/testcafe/assignees{/user}","branches_url":"https://api.github.com/repos/DevExpress/testcafe/branches{/branch}","tags_url":"https://api.github.com/repos/DevExpress/testcafe/tags","blobs_url":"https://api.github.com/repos/DevExpress/testcafe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DevExpress/testcafe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DevExpress/testcafe/git/refs{/sha}","trees_url":"https://api.github.com/repos/DevExpress/testcafe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DevExpress/testcafe/statuses/{sha}","languages_url":"https://api.github.com/repos/DevExpress/testcafe/languages","stargazers_url":"https://api.github.com/repos/DevExpress/testcafe/stargazers","contributors_url":"https://api.github.com/repos/DevExpress/testcafe/contributors","subscribers_url":"https://api.github.com/repos/DevExpress/testcafe/subscribers","subscription_url":"https://api.github.com/repos/DevExpress/testcafe/subscription","commits_url":"https://api.github.com/repos/DevExpress/testcafe/commits{/sha}","git_commits_url":"https://api.github.com/repos/DevExpress/testcafe/git/commits{/sha}","comments_url":"https://api.github.com/repos/DevExpress/testcafe/comments{/number}","issue_comment_url":"https://api.github.com/repos/DevExpress/testcafe/issues/comments{/number}","contents_url":"https://api.github.com/repos/DevExpress/testcafe/contents/{+path}","compare_url":"https://api.github.com/repos/DevExpress/testcafe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DevExpress/testcafe/merges","archive_url":"https://api.github.com/repos/DevExpress/testcafe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DevExpress/testcafe/downloads","issues_url":"https://api.github.com/repos/DevExpress/testcafe/issues{/number}","pulls_url":"https://api.github.com/repos/DevExpress/testcafe/pulls{/number}","milestones_url":"https://api.github.com/repos/DevExpress/testcafe/milestones{/number}","notifications_url":"https://api.github.com/repos/DevExpress/testcafe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DevExpress/testcafe/labels{/name}","releases_url":"https://api.github.com/repos/DevExpress/testcafe/releases{/id}","deployments_url":"https://api.github.com/repos/DevExpress/testcafe/deployments","created_at":"2015-04-20T13:43:28Z","updated_at":"2016-04-18T10:59:27Z","pushed_at":"2016-04-22T10:45:20Z","git_url":"git://github.com/DevExpress/testcafe.git","ssh_url":"git@github.com:DevExpress/testcafe.git","clone_url":"https://github.com/DevExpress/testcafe.git","svn_url":"https://github.com/DevExpress/testcafe","homepage":null,"size":25277,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":57,"forks":13,"open_issues":57,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DevExpress/testcafe/pulls/378"},"html":{"href":"https://github.com/DevExpress/testcafe/pull/378"},"issue":{"href":"https://api.github.com/repos/DevExpress/testcafe/issues/378"},"comments":{"href":"https://api.github.com/repos/DevExpress/testcafe/issues/378/comments"},"review_comments":{"href":"https://api.github.com/repos/DevExpress/testcafe/pulls/378/comments"},"review_comment":{"href":"https://api.github.com/repos/DevExpress/testcafe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DevExpress/testcafe/pulls/378/commits"},"statuses":{"href":"https://api.github.com/repos/DevExpress/testcafe/statuses/973c2f562df7110bb87910836e049d9f38a2b239"}}}}