{"id":15233854,"url":"https://github.com/royk/playwright-feature-reporter","last_synced_at":"2025-10-10T05:37:10.305Z","repository":{"id":257070011,"uuid":"857453136","full_name":"royk/playwright-feature-reporter","owner":"royk","description":"Custom Playwright reporter that generates a Markdown file documenting app features based on test cases","archived":false,"fork":false,"pushed_at":"2024-10-21T19:53:36.000Z","size":494,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-22T15:18:02.864Z","etag":null,"topics":["automated-testing","bdd","playwright","reporter","reporting","test-driven-documentation","test-driven-documents","testing"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/royk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-14T17:42:19.000Z","updated_at":"2024-10-21T19:53:40.000Z","dependencies_parsed_at":"2024-09-14T18:03:49.079Z","dependency_job_id":"ac33ac91-1f31-4133-a4ca-4afad97dba44","html_url":"https://github.com/royk/playwright-feature-reporter","commit_stats":{"total_commits":134,"total_committers":2,"mean_commits":67.0,"dds":0.05970149253731338,"last_synced_commit":"0fc6603320a82a8d45aa072c284e4753a1b9dc5c"},"previous_names":["royk/playwright-feature-reporter"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royk%2Fplaywright-feature-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royk%2Fplaywright-feature-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royk%2Fplaywright-feature-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royk%2Fplaywright-feature-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/royk","download_url":"https://codeload.github.com/royk/playwright-feature-reporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"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":["automated-testing","bdd","playwright","reporter","reporting","test-driven-documentation","test-driven-documents","testing"],"created_at":"2024-09-29T06:08:30.916Z","updated_at":"2025-10-10T05:37:10.287Z","avatar_url":"https://github.com/royk.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playwright-feature-reporter\nA custom Playwright reporter designed to automatically generate or populate Markdown documentation for your application based on its test suites \u0026 cases.\n\nBased on [x-feature-reporter](https://github.com/royk/x-feature-reporter).\n\nThe below Features and To-Do sections were auto-generated from this reporter's test cases.\n\n## Installation\n\n```\nnpm i -D playwright-feature-reporter\n```\n\n\u003c!-- playwright-feature-reporter--start --\u003e\n## Features\n### Markdown generation\n - ✅ By default, multiple project don't create duplicate entries. Their features are merged\n - ✅ Describe blocks appear as headings. Nested describe blocks are nested headings\n - ✅ Tests appear as list items representing features. Each feature is visually marked as Passing ✅, Failing ❌ or Skipped 🚧\n - ✅ Tests can be annotated with test-types. Behavioral tests appear as features. Unannotated tests are assumed to be behavioral.\n - ✅ Describe blocks containing only non-behavioral tests are not shown in the report\n - ✅ Embed the report in an existing file between placeholders\n - ✅ Omit the closing placeholder if it's the last content in the file\n - ✅ Same headings from across suites are shown only once\n - ✅ Features can nest under other features\n - ✅ Features can nest multiple levels deep\n### Configuration\n - ✅ oldResultsFile can be provided to create a diff\n - ✅ outputFormat can be set to 'json'\n - ✅ A link to a full test report will be included when the 'fullReportLink' option is provided\n - ✅ Projects are reported separately as headers when the option 'reportProjects' is true\n\n[Test report](playwright-report/index.html)\n\u003c!-- playwright-feature-reporter--end --\u003e\n\n## Usage\n\n### Basic usage\nInclude as a reporter in your `playwright.config.ts`. eg:\n\n```typescript\nimport { defineConfig } from '@playwright/test';\n\nexport default defineConfig({\n  reporter: [\n    ['playwright-feature-reporter', { \n      outputFile: './README.md',\n      fullReportLink: 'https://raw.githack.com/your-repo/playwright-report/index.html'\n    }]\n  ]\n});\n```\n\n### Using a custom adapter\n\nYou can provide a custom adapter class that implements the `XAdapter` interface from `x-feature-reporter`:\n\n```typescript\nimport { defineConfig } from '@playwright/test';\nimport { MyCustomAdapter } from 'my-custom-adapter-package';\n\nexport default defineConfig({\n  reporter: [\n    ['playwright-feature-reporter', { \n      adapter: MyCustomAdapter,\n      adapterOptions: {\n        // adapter-specific options\n      }\n    }]\n  ]\n});\n```\n\nThe adapter class must implement the `XAdapter` interface from `x-feature-reporter`:\n\n```typescript\ninterface XAdapter {\n  generateReport(suite: XTestSuite): void;\n}\n```\n\nThe adapter will be instantiated by the reporter with the provided `adapterOptions`.\n\n### Combining with other reporters\nThis example takes advantage of the html reporter to attach a link to the full report:\n\n```\nexport default defineConfig({\n  reporter: [\n    ['list'],\n    ['html'],\n    ['playwright-feature-reporter', {  outputFile: '../FEATURES.md', fullReportLink: 'playwright-report/index.html' }]\n  ],\n```\n### Annotating tests\n\nYou can annotate tests with the following annotations:\n\n- `test-type`: Used to annotate the type of test. Only tests with a test-type of `behavior` will be reported. Tests without the test-type annotation will be assumed to be `behavior` tests.\n\nExample:\n```\ntest('Example of a test with a test-type annotation', \n  {annotation: [{type: 'test-type', description: 'behavior'}]}, () =\u003e {\n});\n```\n\nYou can also similarly annotate a describe block. All tests within the describe block will inherit the annotation.\n\n```\ntest.describe('Compatibility tests', \n  {annotation: [{type: 'test-type', description: 'compatibility'}]}, () =\u003e {\n    test('this test will be annotated with \"compatibility\"', () =\u003e {\n    });\n});\n```\n\n### Indentations\n\nNesting level of headers is determined by the nesting level of the describe blocks:\n\n```\ntest.describe('Main heading', () =\u003e {\n  test.describe('Sub heading', () =\u003e {\n    test('Feature under sub heading', () =\u003e {\n    });\n  });\n});\n```\n\nTests can be nested under other tests by prefixing them with `- ` (dash and space). The amount of `-` characters determines the nesting level.\nThe dashes and space will be trimmed from the feature name.\n\n```\ntest.describe('Main heading', () =\u003e {\n  test('Feature ', () =\u003e {\n  });\n  test('- Sub feature', () =\u003e {\n  });\n  test('-- Sub sub feature', () =\u003e {\n  });\n});\n```\n\n### Appending to an existing file\nIf you want to append the results to an existing file, include the following prefix in the file:\n\n```\n\u003c!-- playwright-feature-reporter--start --\u003e\n```\nYou can additionally include a closing placeholder:\n\n```\n\u003c!-- playwright-feature-reporter--end --\u003e\n```\n\nFor example:\n\n```\n# Features\n\u003c!-- playwright-feature-reporter--start --\u003e\n\u003c\u003c your features will be rendered here \u003e\u003e\n```\n## Configuration\n\n### Output file\nThe output file is defined with the `outputFile` option.\n\n### Report projects\nBy default, projects are not reported. This is to avoid duplicate entries in the report (where every test is reported each time per project).\n\nIf you want the projects to be reported, set the `reportProjects` option to true. Each project will be reported as a header and its features will be nested under it.\n\n### Full report link\nYou can include a link to a full test report with the `fullReportLink` option. This will include the link at the bottom of the generated report.\n\nExample:\n```\n['playwright-feature-reporter', { outputFile: './README.md', fullReportLink: 'playwright-report/index.html' }]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyk%2Fplaywright-feature-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyk%2Fplaywright-feature-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyk%2Fplaywright-feature-reporter/lists"}