@stanterprise/playwright-reporter 0.0.8 → 0.0.9

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.
@@ -5,15 +5,16 @@ const events_1 = require("@stanterprise/protobuf/testsystem/v1/events");
5
5
  const grpcClient_1 = require("../client/grpcClient");
6
6
  const entities_1 = require("@stanterprise/protobuf/testsystem/v1/entities");
7
7
  const utils_1 = require("../utils");
8
+ const common_1 = require("@stanterprise/protobuf/testsystem/v1/common");
8
9
  function handleOnBeginEvent(config, suite, name, runId, client, options) {
9
10
  // Report root suite and all child suites recursively
10
- const request = new events_1.MapTestRunEventRequest({
11
+ const request = new events_1.ReportRunStartEventRequest({
11
12
  run_id: runId,
12
13
  name: name,
13
14
  test_suites: mapSuites(suite, runId),
14
15
  total_tests: suite.allTests().length,
15
16
  });
16
- (0, grpcClient_1.reportUnary)(options, client, "/testsystem.v1.observer.TestEventCollector/MapTestRun", request, options.grpcTimeout).catch((e) => {
17
+ (0, grpcClient_1.reportUnary)(options, client, "/testsystem.v1.observer.TestEventCollector/ReportRunStart", request, options.grpcTimeout).catch((e) => {
17
18
  const details = e instanceof Error ? `${e.message}` : String(e);
18
19
  console.warn(`onBegin. gRPC disabled for the remainder of the run. Address=${options.grpcAddress}. Details: ${details}`);
19
20
  });
@@ -44,7 +45,7 @@ function mapSingleSuite(suite, runId) {
44
45
  type = entities_1.SuiteType.SUBSUITE;
45
46
  break;
46
47
  case "file":
47
- type = entities_1.SuiteType.SUBSUITE;
48
+ type = entities_1.SuiteType.FILE;
48
49
  break;
49
50
  case "project":
50
51
  type = entities_1.SuiteType.PROJECT;
@@ -55,14 +56,24 @@ function mapSingleSuite(suite, runId) {
55
56
  name: suite.title,
56
57
  run_id: runId,
57
58
  parent_suite_id: parentSuiteId,
59
+ status: common_1.TestStatus.NOT_RUN,
58
60
  test_cases: suite.tests.map((test) => new entities_1.TestCaseRun({
59
61
  id: test.id,
60
62
  name: test.title,
61
63
  run_id: runId,
64
+ test_suite_id: suiteId,
65
+ tags: test.tags,
66
+ location: test.location
67
+ ? `${test.location.file}:${test.location.line}:${test.location.column}`
68
+ : undefined,
69
+ status: common_1.TestStatus.NOT_RUN,
70
+ retry_count: test.retries,
71
+ retry_index: 0,
62
72
  })),
63
73
  test_case_ids: suite.tests.map((test) => test.id),
64
74
  type: type,
65
- // start_time: createTimestamp(startTime),
66
- // metadata: metadata,
75
+ location: suite.location
76
+ ? `${suite.location.file}:${suite.location.line}:${suite.location.column}`
77
+ : undefined,
67
78
  });
68
79
  }
@@ -6,6 +6,7 @@ const events_1 = require("@stanterprise/protobuf/testsystem/v1/events");
6
6
  const utils_1 = require("../utils");
7
7
  const grpcClient_1 = require("../client/grpcClient");
8
8
  const utils_2 = require("../utils");
9
+ const common_1 = require("@stanterprise/protobuf/testsystem/v1/common");
9
10
  function handleOnStepBeginEvent(test, result, step, runId, client, options) {
10
11
  // Build metadata from step annotations
11
12
  const metadata = new Map();
@@ -23,13 +24,14 @@ function handleOnStepBeginEvent(test, result, step, runId, client, options) {
23
24
  step: new entities_1.StepRun({
24
25
  id: stepId,
25
26
  run_id: runId,
26
- test_case_run_id: test.id,
27
+ test_case_id: test.id,
27
28
  title: step.title,
29
+ status: common_1.TestStatus.RUNNING,
28
30
  type: step.category,
29
31
  start_time: (0, utils_1.createTimestamp)(step.startTime),
30
32
  location: step.location
31
33
  ? `${step.location.file}:${step.location.line}:${step.location.column}`
32
- : "",
34
+ : undefined,
33
35
  metadata: metadata,
34
36
  parent_step_id: step.parent
35
37
  ? (0, utils_2.generateStepId)(step.parent, test)
@@ -24,7 +24,7 @@ function handleOnStepEndEvent(test, result, step, runId, client, options) {
24
24
  step: new entities_1.StepRun({
25
25
  id: stepId,
26
26
  run_id: runId,
27
- test_case_run_id: test.id,
27
+ test_case_id: test.id,
28
28
  title: step.title,
29
29
  type: step.category,
30
30
  start_time: (0, utils_1.createTimestamp)(step.startTime),
@@ -5,6 +5,7 @@ const entities_1 = require("@stanterprise/protobuf/testsystem/v1/entities");
5
5
  const events_1 = require("@stanterprise/protobuf/testsystem/v1/events");
6
6
  const utils_1 = require("../utils");
7
7
  const grpcClient_1 = require("../client/grpcClient");
8
+ const common_1 = require("@stanterprise/protobuf/testsystem/v1/common");
8
9
  function handleOnTestBeginEvent(test, result, runId, client, options) {
9
10
  // Build and send the TestBegin event via generic unary call.
10
11
  const request = new events_1.TestBeginEventRequest({
@@ -12,7 +13,13 @@ function handleOnTestBeginEvent(test, result, runId, client, options) {
12
13
  id: test.id,
13
14
  name: test.title,
14
15
  run_id: runId,
15
- test_suite_run_id: (0, utils_1.generateSuiteId)(test.parent),
16
+ retry_index: result.retry,
17
+ retry_count: test.retries,
18
+ location: test.location
19
+ ? `${test.location.file}:${test.location.line}:${test.location.column}`
20
+ : undefined,
21
+ status: common_1.TestStatus.RUNNING,
22
+ test_suite_id: (0, utils_1.generateSuiteId)(test.parent),
16
23
  start_time: (0, utils_1.createTimestamp)(result.startTime),
17
24
  tags: test.tags,
18
25
  }),
@@ -35,7 +35,7 @@ function handleOnTestEndEvent(test, result, runId, client, options) {
35
35
  id: test.id,
36
36
  name: test.title,
37
37
  run_id: runId,
38
- test_suite_run_id: suiteId,
38
+ test_suite_id: suiteId,
39
39
  status: testStatus,
40
40
  start_time: (0, utils_1.createTimestamp)(result.startTime),
41
41
  attachments: attachments,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stanterprise/playwright-reporter",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
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.0.18"
56
+ "@stanterprise/protobuf": "^0.0.19"
57
57
  }
58
58
  }