@test2doc/playwright 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,27 @@
1
1
  The Test2Doc is a project that generates documentation based on tests, helping you keep your technical documentation automatically in sync with your code.
2
2
 
3
3
  # Test2Doc Playwright Reporter
4
- The `@test2doc/playwright` package is a [Playwright](https://playwright.dev/) reporter that generates documentation in markdown. It is intended to work with [Docusaurus](https://docusaurus.io/).
4
+ The `@test2doc/playwright` package is a [Playwright](https://playwright.dev/) reporter that generates documentation in markdown. It generates markdown files compatible with [Docusaurus](https://docusaurus.io/).
5
5
 
6
6
  ## Installation & Setup
7
7
 
8
- ### Install the Reporter
8
+ ### Prerequisites
9
+
10
+ #### Playwright
9
11
  If you don't have Playwright currently installed, you can follow [Playwright's installation guide](https://playwright.dev/docs/intro#installing-playwright). (Don't forget to run `npx playwright install` to install browsers after Playwright itself!)
10
12
 
13
+ #### Docusaurus
14
+ This reporter generates markdown files for Docusaurus. If you don't have a Docusaurus app set up yet there is an install guide [here](https://docusaurus.io/docs/installation). If you have a monorepo I recommend using these [instructions](https://docusaurus.io/docs/installation#monorepos)
15
+
16
+ Else you can install the Docusaurus app within your current repo with:
17
+
18
+ ```sh
19
+ npx create-docusaurus@latest doc classic --typescript
20
+ ```
21
+
22
+ This will make a `doc` directory with your Docusaurus app.
23
+
24
+ ### Install the Reporter
11
25
  After installing Playwright you can add the `@test2doc/playwright` with your package manager of choice:
12
26
 
13
27
  ```sh
@@ -19,52 +33,67 @@ yarn add @test2doc/playwright --dev
19
33
  pnpm install @test2doc/playwright -D
20
34
  ```
21
35
 
22
- #### Configure Playwright
23
- Add the reporter to your `playwright.config.ts`
36
+ #### Configure Playwright to work with Test2Doc's Reporter
37
+ Create a new config to run Test2Doc. `playwright-test2doc.config.ts`
24
38
 
25
39
  ```ts
26
- // playwright.config.ts or playwright.config.js
27
- import { defineConfig, ... } from "@playwright/test"
28
-
29
- ...
40
+ // playwright-test2doc.config.ts
41
+ import { defineConfig, devices } from "@playwright/test"
30
42
 
43
+ /**
44
+ * Test2Doc Playwright Configuration
45
+ * This config is optimized for generating documentation from your tests.
46
+ */
31
47
  export default defineConfig({
32
- ...
48
+ // Test directory - adjust to match your project structure
49
+ testDir: './tests',
50
+
51
+ // Test2Doc Reporter Configuration
33
52
  reporter: [
34
- ...
35
- ["@test2doc/playwright", { outputDir: "./path/to/docs" }],
53
+ ['@test2doc/playwright', {
54
+ outputDir: './doc/docs' // Change this to your Docusaurus docs directory
55
+ }]
36
56
  ],
37
- ...
38
- })
39
- ```
40
-
41
- Replace `"./path/to/docs"` with a path to the `doc` directory of your Docusaurus app.
42
57
 
43
- #### Setup Docusaurus
44
- This reporter generates markdown files for Docusaurus. If you don't have a Docusaurus app set up yet there is an install guide [here](https://docusaurus.io/docs/installation). If you have a monorepo I recommend using these [instructions](https://docusaurus.io/docs/installation#monorepos)
45
-
46
- Else you can install the Docusaurus app within your current repo with:
58
+ // Optimized settings for doc generation
59
+ fullyParallel: false,
60
+ workers: 1, // Single worker for consistent output
61
+ retries: 0, // No retries needed for doc generation
62
+
63
+ // Use only one browser for faster doc generation
64
+ projects: [
65
+ {
66
+ name: 'chromium',
67
+ use: { ...devices['Desktop Chrome'] },
68
+ },
69
+ ],
47
70
 
48
- ```sh
49
- npx create-docusaurus@latest doc classic --typescript
71
+ // Optional: Import settings from your main config
72
+ // Uncomment and adjust the path if you want to inherit from your main config
73
+ // ...require('./playwright.config').default,
74
+ });
50
75
  ```
51
76
 
52
- This will make a `doc` directory with your Docusaurus app.
77
+ Replace `"./doc/docs"` with a path to the `doc` directory of your Docusaurus app.
53
78
 
54
- Then set the `outputDir` in the `playwright.config.ts` to `"./doc/docs"`
79
+ ##### Add script to run playwright to generate docs
55
80
 
56
- ```ts
57
- // playwright.config.ts
58
- export default defineConfig({
81
+ Also add a script to build the docs in your project's `package.json`
82
+
83
+ ```json
84
+ {
59
85
  ...
60
- reporter: [
86
+ "scripts": {
61
87
  ...
62
- ["@test2doc/playwright", { outputDir: "./doc/docs" }],
63
- ],
88
+ "docs:generate": "playwright test --config=playwright-test2doc.config.ts"
89
+ }
64
90
  ...
65
- })
91
+ }
66
92
  ```
67
93
 
94
+ ## Verify installation
95
+ To verify your setup works, run `npm run docs:generate` and check that markdown files appear in your `./doc/docs` directory.
96
+
68
97
  ## How it works
69
98
 
70
99
  After this setup, every time you run your Playwright tests, the `@test2doc/playwright` reporter will automatically generate a new markdown file in your specified Docusaurus docs directory for each top-level describe block found in your Playwright test files.
@@ -75,7 +104,47 @@ Docusaurus supports [markdown front matter](https://docusaurus.io/docs/api/plugi
75
104
  To add this metadata to the test2doc markdown files that are generated use the `withDocMeta` function in your top level describe block in your test.
76
105
 
77
106
  ```ts
78
- import {withDocMeta} from "@test2doc/playwright/DocHeader";
107
+ import { withDocMeta } from "@test2doc/playwright/DocMeta";
108
+
109
+ ...
110
+
111
+ describe(withDocMeta("Title of Page", {
112
+ title: "Title in Sidebar",
113
+ sidebar_position: 1,
114
+ ...
115
+ }), () => {
116
+ test("test block", () => {
117
+ ...
118
+ })
119
+ })
120
+ ```
121
+
122
+ ### Adding Docusaurus Category route
123
+ Docusaurus supports grouping docs by [category](https://docusaurus.io/docs/sidebar/autogenerated#category-item-metadata).
124
+
125
+ By using the `withDocCategory` function for a describe block's title, this will add the metadata to allow Test2Doc to generate a new directory and a `__category__.json` file. It will then place all subsequent describes and tests under this new route.
126
+
127
+ ```ts
128
+
129
+ import { withDocCategory, withDocMeta } from "@test2doc/playwright/DocMeta";
130
+
131
+ ...
79
132
 
80
- describe(withDocMeta("Title of Page", {title: "Title in Sidebar", sidebar_position: 1}))
81
- ```
133
+ describe(withDocCategory("Title of Category Route", {
134
+ label: "Category Sidebar Label",
135
+ position: 1,
136
+ className: "class-to-add-on-sidebar-label",
137
+ ...
138
+ }),
139
+ () => {
140
+ describe(withDocMeta("Title of Page in Category", {
141
+ title: "Title in Sidebar under Category",
142
+ sidebar_position: 1,
143
+ ...
144
+ }), () => {
145
+ test("test block", () => {
146
+ ...
147
+ })
148
+ })
149
+ })
150
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,MAAM,2BAA2B,CAAA;AAiBlC,UAAU,uBAAuB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID;;;GAGG;AACH,cAAM,gBAAiB,YAAW,QAAQ;IACxC,OAAO,CAAC,IAAI,CAAuC;IACnD,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,SAAS,CAAQ;gBAGvB,OAAO,GAAE,uBAER;IAKH,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;IASzC,OAAO,CAAC,YAAY;IAyBpB,WAAW,CAAC,IAAI,EAAE,QAAQ;IAM1B,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAYtE,OAAO,CAAC,kBAAkB;IAO1B,KAAK;IASL,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,cAAc;IAiCtB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,gBAAgB;CAuBzB;AAED,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,MAAM,2BAA2B,CAAA;AAiBlC,UAAU,uBAAuB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID;;;GAGG;AACH,cAAM,gBAAiB,YAAW,QAAQ;IACxC,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,SAAS,CAAQ;gBAGvB,OAAO,GAAE,uBAER;IAKH,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;IAUzC,OAAO,CAAC,YAAY;IAyBpB,WAAW,CAAC,IAAI,EAAE,QAAQ;IAM1B,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAYtE,OAAO,CAAC,kBAAkB;IAO1B,KAAK;IAYL,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,cAAc;IAiCtB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,gBAAgB;CAuBzB;AAED,eAAe,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ activateTest2Doc();
6
6
  * for tests in markdown and consumed by Docusaurus.
7
7
  */
8
8
  class Test2DocReporter {
9
- docs = { title: "", children: [] };
9
+ docs = [];
10
10
  docMap = new Map();
11
11
  outputDir;
12
12
  constructor(options = {
@@ -15,10 +15,11 @@ class Test2DocReporter {
15
15
  this.outputDir = options.outputDir || "./docs";
16
16
  }
17
17
  onBegin(_config, suite) {
18
- this.docs = { title: suite.title, children: [] };
18
+ this.docs = [];
19
19
  this.docMap.clear();
20
- this.docMap.set(suite.title, this.docs);
21
- this.docs = this.buildDocTree(suite.suites[0]?.suites[0]?.suites[0] ?? suite);
20
+ // this.docMap.set(suite.title, this.docs)
21
+ this.docs =
22
+ suite.suites[0]?.suites.flatMap(({ suites }) => suites.map((s) => this.buildDocTree(s))) || [];
22
23
  }
23
24
  buildDocTree(suite) {
24
25
  const docNode = {
@@ -64,11 +65,14 @@ class Test2DocReporter {
64
65
  .replace(/[^a-z0-9]+/g, "-");
65
66
  }
66
67
  onEnd() {
67
- const [title, metadata] = this.extractDocMetadata(this.docs.title);
68
- const markdownHeader = this.generateHeader(metadata);
69
- const markdown = markdownHeader + this.generateMarkdown({ ...this.docs, title }, 1);
70
- const filePath = `${this.outputDir}/${this.convertToKebabCase(title)}.md`;
71
- writeFileSync(filePath, markdown);
68
+ this.docs.forEach((doc) => {
69
+ const [title, metadata] = this.extractDocMetadata(doc.title);
70
+ console.log(`Generating documentation for: ${title}`, metadata);
71
+ const markdownHeader = this.generateHeader(metadata);
72
+ const markdown = markdownHeader + this.generateMarkdown({ ...doc, title }, 1);
73
+ const filePath = `${this.outputDir}/${this.convertToKebabCase(title)}.md`;
74
+ writeFileSync(filePath, markdown);
75
+ });
72
76
  }
73
77
  extractDocMetadata(docTitle) {
74
78
  const [_ignore, title, metadataJson] = docTitle.match(/^(.*?)\s*({.*})$/) ?? [];
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,gBAAgB,CAAA;AAmBzE,gBAAgB,EAAE,CAAA;AAElB;;;GAGG;AACH,MAAM,gBAAgB;IACZ,IAAI,GAAY,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;IAC3C,MAAM,GAAmC,IAAI,GAAG,EAAE,CAAA;IAClD,SAAS,CAAQ;IAEzB,YACE,UAAmC;QACjC,SAAS,EAAE,QAAQ;KACpB;QAED,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAA;IAChD,CAAC;IAED,OAAO,CAAC,OAAmB,EAAE,KAAY;QACvC,IAAI,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;QAChD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK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,gBAAgB,CAAC,OAAgB,EAAE,KAAa;QACtD,IAAI,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAEvD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACjC,QAAQ,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;gBACrD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;wBAC9B,QAAQ,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,CAAA;oBACjC,CAAC;oBACD,QAAQ,IAAI,IAAI,CAAA;gBAClB,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACrC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAED,eAAe,gBAAgB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@test2doc/playwright",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A reporter that generates docs based off playwright test files",
5
5
  "keywords": [
6
6
  "docs",
@@ -16,9 +16,9 @@
16
16
  "import": "./dist/index.js",
17
17
  "types": "./dist/index.d.ts"
18
18
  },
19
- "./DocHeader": {
20
- "import": "./dist/DocHeader.js",
21
- "types": "./dist/DocHeader.d.ts"
19
+ "./DocMeta": {
20
+ "import": "./dist/DocMeta.js",
21
+ "types": "./dist/DocMeta.d.ts"
22
22
  }
23
23
  },
24
24
  "main": "dist/index.js",
@@ -26,8 +26,8 @@
26
26
  "types": "dist/index.d.ts",
27
27
  "files": [
28
28
  "dist",
29
- "dist/DocHeader.js",
30
- "dist/DocHeader.d.ts"
29
+ "dist/DocMeta.js",
30
+ "dist/DocMeta.d.ts"
31
31
  ],
32
32
  "publishConfig": {
33
33
  "access": "public"
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "vitest": "^3.2.4",
40
- "@types/node": "^24.0.3"
40
+ "@types/node": "^24.0.4"
41
41
  },
42
42
  "scripts": {
43
43
  "clean": "rm -rf dist",