ortoni-report 1.0.5 → 1.0.7
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/dist/ortoni-report.js +5 -5
- package/dist/ortoni-report.mjs +5 -5
- package/package.json +1 -1
- package/readme.md +80 -0
package/dist/ortoni-report.js
CHANGED
|
@@ -43,7 +43,7 @@ var OrtoniReport = class {
|
|
|
43
43
|
}
|
|
44
44
|
onBegin(config, suite) {
|
|
45
45
|
this.results = [];
|
|
46
|
-
const screenshotsDir = import_path.default.join(
|
|
46
|
+
const screenshotsDir = import_path.default.join(process.cwd(), "screenshots");
|
|
47
47
|
if (!import_fs.default.existsSync(screenshotsDir)) {
|
|
48
48
|
import_fs.default.mkdirSync(screenshotsDir);
|
|
49
49
|
}
|
|
@@ -71,7 +71,7 @@ var OrtoniReport = class {
|
|
|
71
71
|
filePath: test.titlePath()[2]
|
|
72
72
|
};
|
|
73
73
|
if (result.attachments) {
|
|
74
|
-
const screenshotsDir = import_path.default.join(
|
|
74
|
+
const screenshotsDir = import_path.default.join(process.cwd(), "screenshots\\" + test.id);
|
|
75
75
|
if (!import_fs.default.existsSync(screenshotsDir)) {
|
|
76
76
|
import_fs.default.mkdirSync(screenshotsDir);
|
|
77
77
|
}
|
|
@@ -79,7 +79,7 @@ var OrtoniReport = class {
|
|
|
79
79
|
if (screenshot && screenshot.path) {
|
|
80
80
|
const screenshotContent = import_fs.default.readFileSync(screenshot.path, "base64");
|
|
81
81
|
const screenshotFileName = `screenshots/${test.id}/${import_path.default.basename(screenshot.path)}`;
|
|
82
|
-
import_fs.default.writeFileSync(import_path.default.join(
|
|
82
|
+
import_fs.default.writeFileSync(import_path.default.join(process.cwd(), screenshotFileName), screenshotContent, "base64");
|
|
83
83
|
testResult.screenshotPath = screenshotFileName;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -109,12 +109,12 @@ var OrtoniReport = class {
|
|
|
109
109
|
return suiteName.split(" - ");
|
|
110
110
|
});
|
|
111
111
|
const html = this.generateHTML();
|
|
112
|
-
const outputPath = import_path.default.join(
|
|
112
|
+
const outputPath = import_path.default.join(process.cwd(), "ortoni-report.html");
|
|
113
113
|
import_fs.default.writeFileSync(outputPath, html);
|
|
114
114
|
console.log(`Ortoni HTML report generated at ${outputPath}`);
|
|
115
115
|
}
|
|
116
116
|
generateHTML() {
|
|
117
|
-
const templateSource = import_fs.default.readFileSync(import_path.default.join(
|
|
117
|
+
const templateSource = import_fs.default.readFileSync(import_path.default.join(process.cwd(), "report-template.hbs"), "utf-8");
|
|
118
118
|
const template = import_handlebars.default.compile(templateSource);
|
|
119
119
|
const data = {
|
|
120
120
|
suiteName: this.suiteName,
|
package/dist/ortoni-report.mjs
CHANGED
|
@@ -9,7 +9,7 @@ var OrtoniReport = class {
|
|
|
9
9
|
}
|
|
10
10
|
onBegin(config, suite) {
|
|
11
11
|
this.results = [];
|
|
12
|
-
const screenshotsDir = path.join(
|
|
12
|
+
const screenshotsDir = path.join(process.cwd(), "screenshots");
|
|
13
13
|
if (!fs.existsSync(screenshotsDir)) {
|
|
14
14
|
fs.mkdirSync(screenshotsDir);
|
|
15
15
|
}
|
|
@@ -37,7 +37,7 @@ var OrtoniReport = class {
|
|
|
37
37
|
filePath: test.titlePath()[2]
|
|
38
38
|
};
|
|
39
39
|
if (result.attachments) {
|
|
40
|
-
const screenshotsDir = path.join(
|
|
40
|
+
const screenshotsDir = path.join(process.cwd(), "screenshots\\" + test.id);
|
|
41
41
|
if (!fs.existsSync(screenshotsDir)) {
|
|
42
42
|
fs.mkdirSync(screenshotsDir);
|
|
43
43
|
}
|
|
@@ -45,7 +45,7 @@ var OrtoniReport = class {
|
|
|
45
45
|
if (screenshot && screenshot.path) {
|
|
46
46
|
const screenshotContent = fs.readFileSync(screenshot.path, "base64");
|
|
47
47
|
const screenshotFileName = `screenshots/${test.id}/${path.basename(screenshot.path)}`;
|
|
48
|
-
fs.writeFileSync(path.join(
|
|
48
|
+
fs.writeFileSync(path.join(process.cwd(), screenshotFileName), screenshotContent, "base64");
|
|
49
49
|
testResult.screenshotPath = screenshotFileName;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -75,12 +75,12 @@ var OrtoniReport = class {
|
|
|
75
75
|
return suiteName.split(" - ");
|
|
76
76
|
});
|
|
77
77
|
const html = this.generateHTML();
|
|
78
|
-
const outputPath = path.join(
|
|
78
|
+
const outputPath = path.join(process.cwd(), "ortoni-report.html");
|
|
79
79
|
fs.writeFileSync(outputPath, html);
|
|
80
80
|
console.log(`Ortoni HTML report generated at ${outputPath}`);
|
|
81
81
|
}
|
|
82
82
|
generateHTML() {
|
|
83
|
-
const templateSource = fs.readFileSync(path.join(
|
|
83
|
+
const templateSource = fs.readFileSync(path.join(process.cwd(), "report-template.hbs"), "utf-8");
|
|
84
84
|
const template = Handlebars.compile(templateSource);
|
|
85
85
|
const data = {
|
|
86
86
|
suiteName: this.suiteName,
|
package/package.json
CHANGED
package/readme.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Release Notes: OrtoniReport v1.0.5
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
We are excited to announce the release of OrtoniReport v1.0.0, a powerful and customizable HTML report generator for Playwright tests. This release includes key features that enhance the reporting capabilities and make it easier to visualize and organize test results.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
### Enhanced Grouping and Organization
|
|
13
|
+
- **Hierarchical Grouping:** Test results are now grouped hierarchically by file name, suite name, and project name, allowing for a clear and organized view of your test structure.
|
|
14
|
+
- **Detailed Breakdown:** Each suite displays a sub-category for project names, with individual test cases listed under their respective projects.
|
|
15
|
+
|
|
16
|
+
### Configurable Report Generation
|
|
17
|
+
- **Flexible Configuration:** The reporter can be easily configured within your Playwright configuration file. Example:
|
|
18
|
+
```JS/TS
|
|
19
|
+
reporter: [
|
|
20
|
+
['ortoni-report'],
|
|
21
|
+
['dot']
|
|
22
|
+
],
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Screenshot Handling
|
|
26
|
+
- **Screenshot Storage:** Screenshots are now saved in a structured directory within the root of your project, ensuring that visual evidence is easily accessible.
|
|
27
|
+
- **Automatic Directory Creation:** The reporter automatically creates necessary directories for storing screenshots.
|
|
28
|
+
|
|
29
|
+
### Comprehensive Test Details
|
|
30
|
+
- **Rich Test Information:** Each test result includes the test title, status, duration, errors, steps, logs, and screenshot paths.
|
|
31
|
+
- **Color-coded Status:** Test statuses are color-coded (green for passed, red for failed, yellow for skipped) for quick visual identification.
|
|
32
|
+
|
|
33
|
+
### Handlebars Template Integration
|
|
34
|
+
- **Customizable Reports:** The HTML report is generated using Handlebars templates, allowing for easy customization and styling.
|
|
35
|
+
- **JSON Helper:** A custom Handlebars helper for JSON stringification is included to handle complex data structures.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
To install OrtoniReport, add it to your project using npm:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install ortoni-report --save-dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
Configure OrtoniReport in your `playwright.config.ts`:
|
|
48
|
+
|
|
49
|
+
``` javascript/typescript
|
|
50
|
+
import { defineConfig } from '@playwright/test';
|
|
51
|
+
import OrtoniReport from 'ortoni-report';
|
|
52
|
+
|
|
53
|
+
export default defineConfig({
|
|
54
|
+
reporter: [
|
|
55
|
+
['ortoni-report'],
|
|
56
|
+
['dot']
|
|
57
|
+
],
|
|
58
|
+
// Other Playwright configurations
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Known Issues
|
|
63
|
+
|
|
64
|
+
- **Compatibility:** Ensure that your Node.js environment supports ES6 modules, as OrtoniReport uses modern JavaScript features.
|
|
65
|
+
|
|
66
|
+
## Future Plans
|
|
67
|
+
|
|
68
|
+
- **Additional Customization Options:** More options for customizing the appearance and structure of the HTML report.
|
|
69
|
+
- **Integration with CI/CD:** Enhanced support for continuous integration and deployment environments.
|
|
70
|
+
- **Advanced Filtering:** Additional filtering options to allow users to focus on specific subsets of test results.
|
|
71
|
+
|
|
72
|
+
## Feedback and Contributions
|
|
73
|
+
|
|
74
|
+
We welcome feedback and contributions from the community. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on our GitHub repository.
|
|
75
|
+
|
|
76
|
+
Thank you for using OrtoniReport! We hope it significantly enhances your Playwright testing experience.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
**LetCode with Koushik**
|