@ciach/playwright-private-reporter 0.1.1

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.
Files changed (105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -0
  3. package/dist/cjs/bin/generate-report.d.ts +3 -0
  4. package/dist/cjs/bin/generate-report.d.ts.map +1 -0
  5. package/dist/cjs/bin/generate-report.js +6 -0
  6. package/dist/cjs/bin/generate-report.js.map +1 -0
  7. package/dist/cjs/cli/generateReport.d.ts +11 -0
  8. package/dist/cjs/cli/generateReport.d.ts.map +1 -0
  9. package/dist/cjs/cli/generateReport.js +56 -0
  10. package/dist/cjs/cli/generateReport.js.map +1 -0
  11. package/dist/cjs/config/withPrivateReporter.d.ts +4 -0
  12. package/dist/cjs/config/withPrivateReporter.d.ts.map +1 -0
  13. package/dist/cjs/config/withPrivateReporter.js +41 -0
  14. package/dist/cjs/config/withPrivateReporter.js.map +1 -0
  15. package/dist/cjs/history/diffRuns.d.ts +3 -0
  16. package/dist/cjs/history/diffRuns.d.ts.map +1 -0
  17. package/dist/cjs/history/diffRuns.js +16 -0
  18. package/dist/cjs/history/diffRuns.js.map +1 -0
  19. package/dist/cjs/history/loadPrevious.d.ts +4 -0
  20. package/dist/cjs/history/loadPrevious.d.ts.map +1 -0
  21. package/dist/cjs/history/loadPrevious.js +24 -0
  22. package/dist/cjs/history/loadPrevious.js.map +1 -0
  23. package/dist/cjs/index.d.ts +9 -0
  24. package/dist/cjs/index.d.ts.map +1 -0
  25. package/dist/cjs/index.js +21 -0
  26. package/dist/cjs/index.js.map +1 -0
  27. package/dist/cjs/package.json +1 -0
  28. package/dist/cjs/reporter/PrivateReporter.d.ts +16 -0
  29. package/dist/cjs/reporter/PrivateReporter.d.ts.map +1 -0
  30. package/dist/cjs/reporter/PrivateReporter.js +109 -0
  31. package/dist/cjs/reporter/PrivateReporter.js.map +1 -0
  32. package/dist/cjs/reporter/attachments.d.ts +9 -0
  33. package/dist/cjs/reporter/attachments.d.ts.map +1 -0
  34. package/dist/cjs/reporter/attachments.js +15 -0
  35. package/dist/cjs/reporter/attachments.js.map +1 -0
  36. package/dist/cjs/reporter/fingerprint.d.ts +12 -0
  37. package/dist/cjs/reporter/fingerprint.d.ts.map +1 -0
  38. package/dist/cjs/reporter/fingerprint.js +37 -0
  39. package/dist/cjs/reporter/fingerprint.js.map +1 -0
  40. package/dist/cjs/reporter/summary.d.ts +25 -0
  41. package/dist/cjs/reporter/summary.d.ts.map +1 -0
  42. package/dist/cjs/reporter/summary.js +105 -0
  43. package/dist/cjs/reporter/summary.js.map +1 -0
  44. package/dist/cjs/templates/summary.html.d.ts +3 -0
  45. package/dist/cjs/templates/summary.html.d.ts.map +1 -0
  46. package/dist/cjs/templates/summary.html.js +64 -0
  47. package/dist/cjs/templates/summary.html.js.map +1 -0
  48. package/dist/cjs/types/schema.d.ts +96 -0
  49. package/dist/cjs/types/schema.d.ts.map +1 -0
  50. package/dist/cjs/types/schema.js +3 -0
  51. package/dist/cjs/types/schema.js.map +1 -0
  52. package/dist/esm/bin/generate-report.d.ts +3 -0
  53. package/dist/esm/bin/generate-report.d.ts.map +1 -0
  54. package/dist/esm/bin/generate-report.js +4 -0
  55. package/dist/esm/bin/generate-report.js.map +1 -0
  56. package/dist/esm/cli/generateReport.d.ts +11 -0
  57. package/dist/esm/cli/generateReport.d.ts.map +1 -0
  58. package/dist/esm/cli/generateReport.js +54 -0
  59. package/dist/esm/cli/generateReport.js.map +1 -0
  60. package/dist/esm/config/withPrivateReporter.d.ts +4 -0
  61. package/dist/esm/config/withPrivateReporter.d.ts.map +1 -0
  62. package/dist/esm/config/withPrivateReporter.js +38 -0
  63. package/dist/esm/config/withPrivateReporter.js.map +1 -0
  64. package/dist/esm/history/diffRuns.d.ts +3 -0
  65. package/dist/esm/history/diffRuns.d.ts.map +1 -0
  66. package/dist/esm/history/diffRuns.js +13 -0
  67. package/dist/esm/history/diffRuns.js.map +1 -0
  68. package/dist/esm/history/loadPrevious.d.ts +4 -0
  69. package/dist/esm/history/loadPrevious.d.ts.map +1 -0
  70. package/dist/esm/history/loadPrevious.js +20 -0
  71. package/dist/esm/history/loadPrevious.js.map +1 -0
  72. package/dist/esm/index.d.ts +9 -0
  73. package/dist/esm/index.d.ts.map +1 -0
  74. package/dist/esm/index.js +8 -0
  75. package/dist/esm/index.js.map +1 -0
  76. package/dist/esm/package.json +1 -0
  77. package/dist/esm/reporter/PrivateReporter.d.ts +16 -0
  78. package/dist/esm/reporter/PrivateReporter.d.ts.map +1 -0
  79. package/dist/esm/reporter/PrivateReporter.js +105 -0
  80. package/dist/esm/reporter/PrivateReporter.js.map +1 -0
  81. package/dist/esm/reporter/attachments.d.ts +9 -0
  82. package/dist/esm/reporter/attachments.d.ts.map +1 -0
  83. package/dist/esm/reporter/attachments.js +11 -0
  84. package/dist/esm/reporter/attachments.js.map +1 -0
  85. package/dist/esm/reporter/fingerprint.d.ts +12 -0
  86. package/dist/esm/reporter/fingerprint.d.ts.map +1 -0
  87. package/dist/esm/reporter/fingerprint.js +32 -0
  88. package/dist/esm/reporter/fingerprint.js.map +1 -0
  89. package/dist/esm/reporter/summary.d.ts +25 -0
  90. package/dist/esm/reporter/summary.d.ts.map +1 -0
  91. package/dist/esm/reporter/summary.js +99 -0
  92. package/dist/esm/reporter/summary.js.map +1 -0
  93. package/dist/esm/templates/summary.html.d.ts +3 -0
  94. package/dist/esm/templates/summary.html.d.ts.map +1 -0
  95. package/dist/esm/templates/summary.html.js +61 -0
  96. package/dist/esm/templates/summary.html.js.map +1 -0
  97. package/dist/esm/types/schema.d.ts +96 -0
  98. package/dist/esm/types/schema.d.ts.map +1 -0
  99. package/dist/esm/types/schema.js +2 -0
  100. package/dist/esm/types/schema.js.map +1 -0
  101. package/examples/Jenkinsfile +82 -0
  102. package/examples/playwright.config.ts +19 -0
  103. package/package.json +78 -0
  104. package/schemas/failures.schema.json +82 -0
  105. package/schemas/run.schema.json +98 -0
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@ciach/playwright-private-reporter",
3
+ "version": "0.1.1",
4
+ "description": "Jenkins-first Playwright reporting utilities.",
5
+ "license": "MIT",
6
+ "author": "ciach",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ciach/literate-octo-computing-machine.git",
10
+ "directory": "packages/playwright-private-reporter"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/ciach/literate-octo-computing-machine/issues"
14
+ },
15
+ "homepage": "https://github.com/ciach/literate-octo-computing-machine/tree/main/packages/playwright-private-reporter#readme",
16
+ "keywords": [
17
+ "playwright",
18
+ "reporter",
19
+ "jenkins",
20
+ "testing",
21
+ "ci"
22
+ ],
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "type": "module",
27
+ "main": "dist/cjs/index.js",
28
+ "types": "dist/cjs/index.d.ts",
29
+ "bin": {
30
+ "playwright-private-reporter-generate": "./dist/cjs/bin/generate-report.js"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "import": {
35
+ "types": "./dist/esm/index.d.ts",
36
+ "default": "./dist/esm/index.js"
37
+ },
38
+ "require": {
39
+ "types": "./dist/cjs/index.d.ts",
40
+ "default": "./dist/cjs/index.js"
41
+ }
42
+ },
43
+ "./cli": {
44
+ "import": {
45
+ "types": "./dist/esm/cli/generateReport.d.ts",
46
+ "default": "./dist/esm/cli/generateReport.js"
47
+ },
48
+ "require": {
49
+ "types": "./dist/cjs/cli/generateReport.d.ts",
50
+ "default": "./dist/cjs/cli/generateReport.js"
51
+ }
52
+ },
53
+ "./package.json": "./package.json"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "files": [
59
+ "dist",
60
+ "schemas",
61
+ "examples",
62
+ "LICENSE"
63
+ ],
64
+ "scripts": {
65
+ "build": "npm run build:cjs && npm run build:esm && npm run fix:cjs-package",
66
+ "build:cjs": "tsc -p tsconfig.cjs.json",
67
+ "build:esm": "tsc -p tsconfig.esm.json",
68
+ "fix:cjs-package": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json && echo '{\"type\":\"module\"}' > dist/esm/package.json",
69
+ "prepack": "npm test",
70
+ "test": "npm run build && node --test tests/*.test.mjs"
71
+ },
72
+ "peerDependencies": {
73
+ "@playwright/test": ">=1.45.0"
74
+ },
75
+ "devDependencies": {
76
+ "typescript": "^5.8.2"
77
+ }
78
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://your-org.example/schemas/playwright-private-reporter/failures.schema.json",
4
+ "title": "Private Reporter Failures Summary",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "projectName", "generatedAt", "groups"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "1.0" },
9
+ "projectName": { "type": "string" },
10
+ "generatedAt": { "type": "string", "format": "date-time" },
11
+ "groups": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["fingerprint", "title", "normalizedMessage", "testFile", "status", "countInRun", "tests", "exampleAttachments"],
16
+ "properties": {
17
+ "fingerprint": { "type": "string" },
18
+ "title": { "type": "string" },
19
+ "normalizedMessage": { "type": "string" },
20
+ "firstMeaningfulStack": { "type": "string" },
21
+ "testFile": { "type": "string" },
22
+ "projectName": { "type": "string" },
23
+ "status": { "enum": ["failed", "timedOut", "interrupted", "flaky"] },
24
+ "countInRun": { "type": "integer", "minimum": 1 },
25
+ "tests": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "required": ["id", "titlePath", "retry", "status", "attachments"],
30
+ "properties": {
31
+ "id": { "type": "string" },
32
+ "titlePath": { "type": "array", "items": { "type": "string" } },
33
+ "location": { "type": "string" },
34
+ "retry": { "type": "integer", "minimum": 0 },
35
+ "status": { "enum": ["failed", "timedOut", "interrupted", "flaky"] },
36
+ "attachments": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "required": ["name"],
41
+ "properties": {
42
+ "name": { "type": "string" },
43
+ "contentType": { "type": "string" },
44
+ "path": { "type": "string" }
45
+ },
46
+ "additionalProperties": false
47
+ }
48
+ }
49
+ },
50
+ "additionalProperties": false
51
+ }
52
+ },
53
+ "exampleAttachments": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "required": ["name"],
58
+ "properties": {
59
+ "name": { "type": "string" },
60
+ "contentType": { "type": "string" },
61
+ "path": { "type": "string" }
62
+ },
63
+ "additionalProperties": false
64
+ }
65
+ },
66
+ "history": {
67
+ "type": "object",
68
+ "required": ["state"],
69
+ "properties": {
70
+ "firstSeen": { "type": "string" },
71
+ "lastSeen": { "type": "string" },
72
+ "state": { "enum": ["new", "still-failing", "fixed", "unknown"] }
73
+ },
74
+ "additionalProperties": false
75
+ }
76
+ },
77
+ "additionalProperties": false
78
+ }
79
+ }
80
+ },
81
+ "additionalProperties": false
82
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://your-org.example/schemas/playwright-private-reporter/run.schema.json",
4
+ "title": "Private Reporter Run Summary",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "projectName", "generatedAt", "run", "counts", "projects", "history", "artifacts", "failures"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "1.0" },
9
+ "projectName": { "type": "string" },
10
+ "generatedAt": { "type": "string", "format": "date-time" },
11
+ "run": {
12
+ "type": "object",
13
+ "required": ["status"],
14
+ "properties": {
15
+ "status": { "enum": ["passed", "failed", "partial"] },
16
+ "buildId": { "type": "string" },
17
+ "buildUrl": { "type": "string" },
18
+ "branch": { "type": "string" },
19
+ "commit": { "type": "string" }
20
+ },
21
+ "additionalProperties": false
22
+ },
23
+ "counts": {
24
+ "type": "object",
25
+ "required": ["passed", "failed", "skipped", "flaky", "timedOut", "interrupted"],
26
+ "properties": {
27
+ "passed": { "type": "integer", "minimum": 0 },
28
+ "failed": { "type": "integer", "minimum": 0 },
29
+ "skipped": { "type": "integer", "minimum": 0 },
30
+ "flaky": { "type": "integer", "minimum": 0 },
31
+ "timedOut": { "type": "integer", "minimum": 0 },
32
+ "interrupted": { "type": "integer", "minimum": 0 }
33
+ },
34
+ "additionalProperties": false
35
+ },
36
+ "projects": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "required": ["name", "counts"],
41
+ "properties": {
42
+ "name": { "type": "string" },
43
+ "counts": { "$ref": "#/$defs/counts" }
44
+ },
45
+ "additionalProperties": false
46
+ }
47
+ },
48
+ "history": {
49
+ "type": "object",
50
+ "required": ["enabled", "newFailures", "fixedFailures", "stillFailing"],
51
+ "properties": {
52
+ "enabled": { "type": "boolean" },
53
+ "previousBuildId": { "type": "string" },
54
+ "newFailures": { "type": "integer", "minimum": 0 },
55
+ "fixedFailures": { "type": "integer", "minimum": 0 },
56
+ "stillFailing": { "type": "integer", "minimum": 0 }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ "artifacts": {
61
+ "type": "object",
62
+ "required": ["blobReportDir", "playwrightHtmlDir", "testResultsDir", "junitPath", "internalReportDir"],
63
+ "properties": {
64
+ "blobReportDir": { "type": "string" },
65
+ "playwrightHtmlDir": { "type": "string" },
66
+ "testResultsDir": { "type": "string" },
67
+ "junitPath": { "type": "string" },
68
+ "internalReportDir": { "type": "string" }
69
+ },
70
+ "additionalProperties": false
71
+ },
72
+ "failures": {
73
+ "type": "object",
74
+ "required": ["totalGroups"],
75
+ "properties": {
76
+ "totalGroups": { "type": "integer", "minimum": 0 },
77
+ "topFingerprint": { "type": "string" }
78
+ },
79
+ "additionalProperties": false
80
+ }
81
+ },
82
+ "$defs": {
83
+ "counts": {
84
+ "type": "object",
85
+ "required": ["passed", "failed", "skipped", "flaky", "timedOut", "interrupted"],
86
+ "properties": {
87
+ "passed": { "type": "integer", "minimum": 0 },
88
+ "failed": { "type": "integer", "minimum": 0 },
89
+ "skipped": { "type": "integer", "minimum": 0 },
90
+ "flaky": { "type": "integer", "minimum": 0 },
91
+ "timedOut": { "type": "integer", "minimum": 0 },
92
+ "interrupted": { "type": "integer", "minimum": 0 }
93
+ },
94
+ "additionalProperties": false
95
+ }
96
+ },
97
+ "additionalProperties": false
98
+ }