@9l/playwright 0.6.0-beta → 0.6.0-beta.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.
@@ -1,7 +1,7 @@
1
1
  export declare const protocolVersion = "9l.engine/1";
2
2
  export declare const maxFrameBytes: number;
3
3
  export declare const maxEvents = 10000;
4
- export declare const capabilities: readonly ["steps", "artifact-metadata", "terminal-outcomes"];
4
+ export declare const capabilities: readonly ["steps", "artifact-metadata", "terminal-outcomes", "declared-outcomes"];
5
5
  export declare const targetVersion = "9l.target/1";
6
6
  export declare const targetStepFile: string;
7
7
  export declare function selectedTarget(env?: NodeJS.ProcessEnv): {
package/dist/protocol.js CHANGED
@@ -11,7 +11,7 @@ const node_path_1 = require("node:path");
11
11
  exports.protocolVersion = '9l.engine/1';
12
12
  exports.maxFrameBytes = 16 * 1024;
13
13
  exports.maxEvents = 10000;
14
- exports.capabilities = ['steps', 'artifact-metadata', 'terminal-outcomes'];
14
+ exports.capabilities = ['steps', 'artifact-metadata', 'terminal-outcomes', 'declared-outcomes'];
15
15
  exports.targetVersion = '9l.target/1';
16
16
  // Typed target steps carry this module's own location. The reporter counts only
17
17
  // those, so a user step titled "9l target ..." stays an ordinary step. Code in the
@@ -6,6 +6,7 @@ export default class EngineReporter implements Reporter {
6
6
  private seq;
7
7
  private stepSeq;
8
8
  private suite?;
9
+ private declared;
9
10
  private terminal;
10
11
  private overflow;
11
12
  printsToStdio(): boolean;
package/dist/reporter.js CHANGED
@@ -21,6 +21,12 @@ class EngineReporter {
21
21
  seq = 0;
22
22
  stepSeq = 0;
23
23
  suite;
24
+ // The expected status of each test before any attempt ran. Playwright
25
+ // updates test.expectedStatus only when an attempt ends, so a test_begin
26
+ // frame carries the declaration (test.fail('title', ...) or a suite-level
27
+ // modifier) and test_end the final value; Go reads a difference as a
28
+ // modifier that ran during the attempt, in the body or in an after hook.
29
+ declared = new Map();
24
30
  terminal = false;
25
31
  overflow = false;
26
32
  printsToStdio() { return true; }
@@ -43,6 +49,8 @@ class EngineReporter {
43
49
  }
44
50
  onBegin(_config, suite) {
45
51
  this.suite = suite;
52
+ for (const test of suite.allTests())
53
+ this.declared.set(test.id, test.expectedStatus);
46
54
  this.emit('hello', { capabilities: this.target ? [...protocol_1.capabilities, protocol_1.targetVersion] : protocol_1.capabilities, totalTests: suite.allTests().length, ...(this.target ? { targetVersion: protocol_1.targetVersion } : {}) });
47
55
  if (this.target) {
48
56
  for (const test of suite.allTests()) {
@@ -55,7 +63,7 @@ class EngineReporter {
55
63
  }
56
64
  }
57
65
  onTestBegin(test, result) {
58
- this.emit('test_begin', { testId: this.testId(test), retry: result.retry });
66
+ this.emit('test_begin', { testId: this.testId(test), retry: result.retry, expectedStatus: this.declared.get(test.id) ?? test.expectedStatus });
59
67
  }
60
68
  onStepEnd(test, result, step) {
61
69
  // expect.poll, toPass and custom matchers report the assertions they run,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@9l/playwright",
3
- "version": "0.6.0-beta",
3
+ "version": "0.6.0-beta.1",
4
4
  "description": "Playwright fixtures and the versioned 9lives Go engine bridge",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/Quality-Max/9lives-runner#local-playwright-sdk",
@@ -24,7 +24,7 @@
24
24
  "engines": {"node": ">=22"},
25
25
  "9l": {
26
26
  "protocol": "9l.engine/1",
27
- "capabilities": ["steps", "artifact-metadata", "terminal-outcomes"],
27
+ "capabilities": ["steps", "artifact-metadata", "terminal-outcomes", "declared-outcomes"],
28
28
  "faults": ["abort", "http-500", "empty-json", "http-401", "http-403", "http-429", "malformed-json", "redirect-cross-origin", "delay"]
29
29
  },
30
30
  "publishConfig": {"access": "public"}