@stanterprise/playwright-reporter 0.1.1 → 0.1.2
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.
|
@@ -9,6 +9,7 @@ const utils_2 = require("../utils");
|
|
|
9
9
|
function handleOnStepEndEvent(test, result, step, runId, client, options, queue) {
|
|
10
10
|
// Map step error to status
|
|
11
11
|
const stepStatus = (0, utils_1.mapStepStatus)(!!step.error);
|
|
12
|
+
const attachments = (0, utils_1.processAttachments)(result, options.maxAttachmentSize || 10485760);
|
|
12
13
|
// Build metadata from step annotations
|
|
13
14
|
const metadata = (0, utils_1.buildStepMetadata)(step);
|
|
14
15
|
const stepId = (0, utils_2.generateStepId)(step, test);
|
|
@@ -52,6 +53,7 @@ function handleOnStepEndEvent(test, result, step, runId, client, options, queue)
|
|
|
52
53
|
: undefined,
|
|
53
54
|
worker_index: result.workerIndex.toString(),
|
|
54
55
|
retry_index: result.retry,
|
|
56
|
+
attachments: attachments,
|
|
55
57
|
}),
|
|
56
58
|
});
|
|
57
59
|
// Fire-and-forget to avoid slowing tests
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility functions for processing test attachments
|
|
3
3
|
*/
|
|
4
|
-
import type { TestResult } from "@playwright/test/reporter";
|
|
4
|
+
import type { TestResult, TestStep } from "@playwright/test/reporter";
|
|
5
5
|
import { common } from "@stanterprise/protobuf";
|
|
6
6
|
declare const Attachment: typeof common.v1.common.Attachment;
|
|
7
7
|
/**
|
|
8
8
|
* Process Playwright test attachments into protobuf Attachment objects
|
|
9
|
-
* @param result Test result containing attachments
|
|
9
|
+
* @param result Test result or test step containing attachments
|
|
10
10
|
* @param maxAttachmentSize Maximum size for attachment content (default 1MB, reduced from 10MB)
|
|
11
11
|
*/
|
|
12
|
-
export declare function processAttachments(result: TestResult, maxAttachmentSize?: number): InstanceType<typeof Attachment>[];
|
|
12
|
+
export declare function processAttachments(result: TestResult | TestStep, maxAttachmentSize?: number): InstanceType<typeof Attachment>[];
|
|
13
13
|
/**
|
|
14
14
|
* Extract error information from test results
|
|
15
15
|
*/
|
|
@@ -10,11 +10,10 @@ const Attachment = protobuf_1.common.v1.common.Attachment;
|
|
|
10
10
|
const BYTES_PER_MB = 1048576;
|
|
11
11
|
/**
|
|
12
12
|
* Process Playwright test attachments into protobuf Attachment objects
|
|
13
|
-
* @param result Test result containing attachments
|
|
13
|
+
* @param result Test result or test step containing attachments
|
|
14
14
|
* @param maxAttachmentSize Maximum size for attachment content (default 1MB, reduced from 10MB)
|
|
15
15
|
*/
|
|
16
|
-
function processAttachments(result, maxAttachmentSize = 1048576
|
|
17
|
-
) {
|
|
16
|
+
function processAttachments(result, maxAttachmentSize = 1048576) {
|
|
18
17
|
const attachments = [];
|
|
19
18
|
if (!result.attachments || result.attachments.length === 0) {
|
|
20
19
|
return attachments;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanterprise/playwright-reporter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Custom Playwright test reporter that sends test results to Stanterprise via gRPC",
|
|
5
5
|
"homepage": "https://github.com/stanterprise/stanterprise-playwright-reporter#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"@grpc/grpc-js": "^1.14.1",
|
|
54
54
|
"@protobuf-ts/grpc-transport": "^2.11.1",
|
|
55
55
|
"@protobuf-ts/grpcweb-transport": "^2.11.1",
|
|
56
|
-
"@stanterprise/protobuf": "^0.1.
|
|
56
|
+
"@stanterprise/protobuf": "^0.1.2"
|
|
57
57
|
}
|
|
58
58
|
}
|