{"id":24753867,"url":"https://github.com/codeceptjs/allure-legacy","last_synced_at":"2025-03-23T05:12:45.044Z","repository":{"id":65895349,"uuid":"600905414","full_name":"codeceptjs/allure-legacy","owner":"codeceptjs","description":"Allure plugin for CodeceptJS","archived":false,"fork":false,"pushed_at":"2023-02-15T12:19:12.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T04:05:43.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeceptjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-12T23:37:06.000Z","updated_at":"2023-02-15T00:39:30.000Z","dependencies_parsed_at":"2023-07-06T17:01:18.822Z","dependency_job_id":null,"html_url":"https://github.com/codeceptjs/allure-legacy","commit_stats":{"total_commits":7,"total_committers":3,"mean_commits":"2.3333333333333335","dds":0.2857142857142857,"last_synced_commit":"8c31bd2d0736487edaa7d92a813562b2571cef49"},"previous_names":["codeceptjs/allure-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeceptjs%2Fallure-legacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeceptjs%2Fallure-legacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeceptjs%2Fallure-legacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeceptjs%2Fallure-legacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeceptjs","download_url":"https://codeload.github.com/codeceptjs/allure-legacy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056908,"owners_count":20553856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-28T11:36:37.115Z","updated_at":"2025-03-23T05:12:45.014Z","avatar_url":"https://github.com/codeceptjs.png","language":"JavaScript","readme":"# Allure Plugin\n\nAllure plugin for CodeceptJS via allure-commons v1\n\n\u003e **Warning**\n\u003e  This plugin was deprecated in CodeceptJS as to allure-commons v1 was not maintained anymore. Documentation and source code was moved into this repository. At this moment we don't plan to migrate it to Allure v2 but community can create their own implementations \n\nEnables Allure reporter.\n\n#### Usage\n\nTo start please install `allure-commandline` package (which requires Java 8)\n\n    npm install -g allure-commandline --save-dev\n\nAdd this plugin to config file:\n\n```js\nplugins: {\n  allure: {\n    enabled: true,\n    require: '@codeceptjs/allure-legacy',\n  }\n}\n```\n\nBy default, allure reports are saved to `output` directory.\nLaunch Allure server and see the report like on a screenshot above:\n\n    allure serve output\n\n#### Configuration\n\n-   `outputDir` - a directory where allure reports should be stored. Standard output directory is set by default.\n-   `enableScreenshotDiffPlugin` - a boolean flag for add screenshot diff to report.\n     To attach, tou need to attach three files to the report - \"diff.png\", \"actual.png\", \"expected.png\".\n     See [Allure Screenshot Plugin][5]\n\n#### Public API\n\nThere are few public API methods which can be accessed from other plugins.\n\n```js\nconst allure = codeceptjs.container.plugins('allure');\n```\n\n`allure` object has following methods:\n\n-   `addAttachment(name, buffer, type)` - add an attachment to current test / suite\n-   `addLabel(name, value)` - adds a label to current test\n-   `addParameter(kind, name, value)` - adds a parameter to current test\n-   `createStep(name, stepFunc)` - create a step, stepFunc could consist an attachment\n    Example of usage:\n\n```js\n    allure.createStep('New created step', () =\u003e {\n      allure.addAttachment(\n        'Request params',\n        '{\"clientId\":123, \"name\":\"Tom\", \"age\":29}',\n        'application/json'\n      );\n    });\n```\n\n![Created Step Image][6]\n\n-   `addScreenDiff(name, expectedImg, actualImg, diffImg)` - add a special screen diff block to the current test case\n    image must be a string representing the contents of the expected image file encoded in base64\n    Example of usage:\n\n```js\nconst expectedImg = fs.readFileSync('expectedImg.png', { encoding: 'base64' });\n...\nallure.addScreenDiff('Screen Diff', expectedImg, actualImg, diffImg);\n```\n\n![Overlay][7]\n![Diff][8]\n\n-   `severity(value)` - adds severity label\n-   `epic(value)` - adds epic label\n-   `feature(value)` - adds feature label\n-   `story(value)` - adds story label\n-   `issue(value)` - adds issue label\n-   `setDescription(description, type)` - sets a description\n\n\n\n\n## addAttachment\n\nAdd an attachment to the current test case\n\n### Parameters\n\n-   `name` **[string][1]** Name of the attachment\n-   `buffer` **[Buffer][2]** Buffer of the attachment\n-   `type` **[string][1]** MIME type of the attachment\n\n## addLabel\n\nAdds a label with the given name and value to the current test in the Allure report\n\n### Parameters\n\n-   `name` **[string][1]** name of the label to add\n-   `value` **[string][1]** value of the label to add\n\n## addParameter\n\nAdds a parameter with the given kind, name, and value to the current test in the Allure report\n\n### Parameters\n\n-   `kind` **[string][1]** kind of the parameter to add\n-   `name` **[string][1]** name of the parameter to add\n-   `value` **[string][1]** value of the parameter to add\n\n## addScreenDiff\n\nAdd a special screen diff block to the current test case\n\n### Parameters\n\n-   `name` **[string][1]** Name of the screen diff block\n-   `expectedImg` **[string][1]** string representing the contents of the expected image file encoded in base64\n-   `actualImg` **[string][1]** string representing the contents of the actual image file encoded in base64\n-   `diffImg` **[string][1]** string representing the contents of the diff image file encoded in base64.\n    Could be generated by image comparison lib like \"pixelmatch\" or alternative\n\n## createStep\n\nA method for creating a step in a test case.\n\n### Parameters\n\n-   `name` **[string][1]** The name of the step.\n-   `stepFunc` **[Function][3]** The function that should be executed for this step. (optional, default `()=\u003e{}`)\n\nReturns **any** The result of the step function.\n\n## setDescription\n\nSet description for the current test case\n\n### Parameters\n\n-   `description` **[string][1]** Description for the test case\n-   `type` **[string][1]** MIME type of the description (optional, default `'text/plain'`)\n\n## allure\n\nAllure reporter\n\n![][4]\n\n\n### Parameters\n\n-   `config`  \n\n## allure\n\nCreates an instance of the allure reporter\n\n### Parameters\n\n-   `config` **Config** Configuration for the allure reporter (optional, default `{outputDir:global.output_dir}`)\n\nReturns **[Object][9]** Instance of the allure reporter\n\n\n[5]: https://github.com/allure-framework/allure2/blob/master/plugins/screen-diff-plugin/README.md\n\n[6]: https://user-images.githubusercontent.com/63167966/139339384-e6e70a62-3638-406d-a224-f32473071428.png\n\n[7]: https://user-images.githubusercontent.com/63167966/215404458-9a325668-819e-4289-9b42-5807c49ebddb.png\n\n[8]: https://user-images.githubusercontent.com/63167966/215404645-73b09da0-9e6d-4352-a123-80c22f7014cd.png\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeceptjs%2Fallure-legacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeceptjs%2Fallure-legacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeceptjs%2Fallure-legacy/lists"}