Skip to content

Commit 2668b8a

Browse files
authored
docs: move html-reporter docs to a separate section and update them (#92)
* docs: move html-reporter docs to a separate section and update them * docs: move html-reporter config examples to partials
1 parent 060784b commit 2668b8a

21 files changed

+574
-361
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import Tabs from "@theme/Tabs";
2+
import TabItem from "@theme/TabItem";
3+
4+
<Tabs>
5+
<TabItem value="Testplane" label="Testplane">
6+
```javascript title="testplane.config.ts"
7+
export = {
8+
// ...
9+
plugins: {
10+
'html-reporter/testplane': {
11+
enabled: true,
12+
path: 'html-report',
13+
},
14+
},
15+
};
16+
```
17+
</TabItem>
18+
19+
<TabItem value="Playwright" label="Playwright">
20+
```javascript title="playwright.config.ts"
21+
// playwright.config.ts
22+
export default defineConfig({
23+
// ...
24+
reporter: [
25+
['html-reporter/playwright', {
26+
enabled: true,
27+
defaultView: 'failed',
28+
path: 'html-report',
29+
}],
30+
],
31+
});
32+
```
33+
</TabItem>
34+
35+
<TabItem value="Jest" label="Jest">
36+
```javascript title="jest.config.ts"
37+
const config = {
38+
// ...
39+
reporters: [
40+
['html-reporter/jest', {
41+
path: 'html-report',
42+
}]
43+
],
44+
};
45+
```
46+
</TabItem>
47+
48+
</Tabs>

docs/html-reporter/html-reporter-api.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Html-Reporter API
1+
---
2+
sidebar_class_name: hidden
3+
---
4+
5+
# HTML Reporter Object
26

37
## Overview {#overview}
48

docs/html-reporter/html-reporter-commands.mdx

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
# Html-Reporter Commands
1+
import Admonition from "@theme/Admonition";
2+
3+
# CLI
24

35
## Overview {#overview}
46

5-
The `html-reporter` plugin adds the following commands to Testplane:
7+
HTML Reporter has the following commands:
68

79
- [gui](#gui)—to run Testplane in GUI mode;
10+
- [merge-reports](#merge-reports)—to merge multiple reports into one.
811
- [remove-unused-screens](#remove-unused-screens)—to remove reference screenshots that are not used in tests;
9-
- [merge-reports](#merge-reports)—to merge Testplane's separate reports into one general report.
12+
13+
When using HTML Reporter with Testplane, you can also use commands through Testplane, for example: `npx testplane gui`.
14+
15+
When using with other tools, you need to specify the tool name in the tool argument, for example: `npx html-reporter gui --tool playwright`.
1016

1117
## gui
1218

19+
<Admonition type="info" title="Command availability">
20+
This command is only available when using HTML Reporter with Testplane and Playwright.
21+
</Admonition>
22+
1323
Use the `gui` command to launch Testplane in GUI mode.
1424

1525
GUI mode allows you to:
@@ -22,11 +32,50 @@ GUI mode allows you to:
2232
### Usage {#gui_usage}
2333

2434
```bash
25-
npx testplane gui
35+
npx html-reporter gui
36+
```
37+
38+
## merge-reports
39+
40+
<Admonition type="info" title="Command availability">
41+
This command is only available when using HTML Reporter with Testplane and Playwright.
42+
</Admonition>
43+
44+
Use the `merge-reports` command to merge multiple reports into one.
45+
46+
The command accepts paths to report directories, database files, or `databaseUrls.json` files.
47+
48+
It creates a new html-report in the destination folder with data from all passed reports.
49+
50+
- When merging local reports—all data, including SQLite databases and screenshots, are copied to the destination directory.
51+
- When merging reports by link (for example, if `databaseUrls.json` files with links to reports in S3 are passed as input)—a report with links to the original reports in `databaseUrls.json` will be created in the destination directory, without downloading and copying all nested resources. When working with the report, this will not be noticeable, but you need to keep in mind that the original reports must remain accessible, as the merged report gets data from them.
52+
53+
### Usage {#merge_reports_usage}
54+
55+
The `merge-reports` command supports the following required option:
56+
57+
<table>
58+
<thead>
59+
<tr><td>**Option**</td><td>**Description**</td></tr>
60+
</thead>
61+
<tbody>
62+
<tr><td>-d, --destination &lt;folder></td><td>The path to the folder where you want to save the final report.</td></tr>
63+
64+
</tbody>
65+
</table>
66+
67+
Usage example:
68+
69+
```bash
70+
npx html-reporter merge-reports report-dir/ path-to-database.db path-to-databaseUrls.json -d dest-report
2671
```
2772

2873
## remove-unused-screens
2974

75+
<Admonition type="info" title="Command availability">
76+
This command is only available when using HTML Reporter with Testplane.
77+
</Admonition>
78+
3079
Use the `remove-unused-screens` command to remove the reference screenshots that are not used in tests.
3180

3281
### How does it work?
@@ -82,29 +131,3 @@ Getting the reference information about the command:
82131
```bash
83132
npx testplane remove-unused-screens --help
84133
```
85-
86-
## merge-reports
87-
88-
Use the `merge-reports` command to merge Testplane's separate reports into one general report.
89-
90-
The command accepts paths to database files or to `databaseUrls.json` files from other html-reports. It creates a new html-report in the destination folder with a single file `databaseUrls.json`, which will contain a link to the database file or to the files `databaseUrls.json` from the input parameters. Database files are not copied to the destination folder at the same time.
91-
92-
### Usage {#merge_reports_usage}
93-
94-
The `merge-reports` command supports the following required option:
95-
96-
<table>
97-
<thead>
98-
<tr><td>**Option**</td><td>**Description**</td></tr>
99-
</thead>
100-
<tbody>
101-
<tr><td>-d, --destination &lt;folder></td><td>The path to the folder where you want to save the final report.</td></tr>
102-
103-
</tbody>
104-
</table>
105-
106-
Usage example:
107-
108-
```bash
109-
npx testplane merge-reports path-to-database.db path-to-databaseUrls.json -d dest-report
110-
```

docs/html-reporter/html-reporter-custom-gui.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_class_name: hidden
3+
---
4+
15
import Admonition from "@theme/Admonition";
26

37
# Html-Reporter Customizing GUI

docs/html-reporter/html-reporter-events.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Html-Reporter Events
1+
---
2+
sidebar_class_name: hidden
3+
---
4+
5+
# HTML Reporter Events
26

37
## Overview {#overview}
48

docs/html-reporter/html-reporter-plugins.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Html-Reporter Plugins
1+
# HTML Reporter Plugins
22

33
## Overview {#overview}
44

0 commit comments

Comments
 (0)