@serenity-js/core 3.37.2 → 3.38.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.38.0](https://github.com/serenity-js/serenity-js/compare/v3.37.2...v3.38.0) (2026-01-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * **core:** event SceneFinishes includes the outcome of the test scenario ([37cc14e](https://github.com/serenity-js/serenity-js/commit/37cc14ee48a746592e0b9e9f430a2416b150db3e)), closes [#3005](https://github.com/serenity-js/serenity-js/issues/3005)
12
+ * **webdriverio:** support afterTest hooks ([a79c83c](https://github.com/serenity-js/serenity-js/commit/a79c83cf0d2b975f9d7831dbf8cbe6dc1cc4935d)), closes [#3005](https://github.com/serenity-js/serenity-js/issues/3005)
13
+
14
+
15
+
16
+
17
+
6
18
  ## [3.37.2](https://github.com/serenity-js/serenity-js/compare/v3.37.1...v3.37.2) (2026-01-23)
7
19
 
8
20
 
@@ -1,5 +1,5 @@
1
1
  import type { JSONObject } from 'tiny-types';
2
- import { CorrelationId } from '../model';
2
+ import { CorrelationId, Outcome } from '../model';
3
3
  import { Timestamp } from '../screenplay';
4
4
  import { DomainEvent } from './DomainEvent';
5
5
  /**
@@ -7,11 +7,16 @@ import { DomainEvent } from './DomainEvent';
7
7
  * Triggers any clean-up operations that might be required, such as discarding of
8
8
  * the [discardable](https://serenity-js.org/api/core/interface/Discardable/) abilities.
9
9
  *
10
+ * The `outcome` property contains the test outcome determined so far, before any cleanup operations.
11
+ * This allows stage crew members like the WebdriverIO notifier to invoke hooks with the test result
12
+ * before `waitForNextCue()` is called.
13
+ *
10
14
  * @group Events
11
15
  */
12
16
  export declare class SceneFinishes extends DomainEvent {
13
17
  readonly sceneId: CorrelationId;
18
+ readonly outcome: Outcome;
14
19
  static fromJSON(o: JSONObject): SceneFinishes;
15
- constructor(sceneId: CorrelationId, timestamp?: Timestamp);
20
+ constructor(sceneId: CorrelationId, outcome: Outcome, timestamp?: Timestamp);
16
21
  }
17
22
  //# sourceMappingURL=SceneFinishes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SceneFinishes.d.ts","sourceRoot":"","sources":["../../src/events/SceneFinishes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,WAAW;aAStB,OAAO,EAAE,aAAa;IAR1C,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa;gBAQzB,OAAO,EAAE,aAAa,EACtC,SAAS,CAAC,EAAE,SAAS;CAK5B"}
1
+ {"version":3,"file":"SceneFinishes.d.ts","sourceRoot":"","sources":["../../src/events/SceneFinishes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,OAAO,EAAE,aAAa,EAAuB,OAAO,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,WAAW;aAYtB,OAAO,EAAE,aAAa;aACtB,OAAO,EAAE,OAAO;IAZpC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa;gBAWzB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChC,SAAS,CAAC,EAAE,SAAS;CAM5B"}
@@ -10,17 +10,26 @@ const DomainEvent_1 = require("./DomainEvent");
10
10
  * Triggers any clean-up operations that might be required, such as discarding of
11
11
  * the [discardable](https://serenity-js.org/api/core/interface/Discardable/) abilities.
12
12
  *
13
+ * The `outcome` property contains the test outcome determined so far, before any cleanup operations.
14
+ * This allows stage crew members like the WebdriverIO notifier to invoke hooks with the test result
15
+ * before `waitForNextCue()` is called.
16
+ *
13
17
  * @group Events
14
18
  */
15
19
  class SceneFinishes extends DomainEvent_1.DomainEvent {
16
20
  sceneId;
21
+ outcome;
17
22
  static fromJSON(o) {
18
- return new SceneFinishes(model_1.CorrelationId.fromJSON(o.sceneId), screenplay_1.Timestamp.fromJSON(o.timestamp));
23
+ return new SceneFinishes(model_1.CorrelationId.fromJSON(o.sceneId), o.outcome
24
+ ? model_1.Outcome.fromJSON(o.outcome)
25
+ : new model_1.ExecutionSuccessful(), screenplay_1.Timestamp.fromJSON(o.timestamp));
19
26
  }
20
- constructor(sceneId, timestamp) {
27
+ constructor(sceneId, outcome, timestamp) {
21
28
  super(timestamp);
22
29
  this.sceneId = sceneId;
30
+ this.outcome = outcome;
23
31
  (0, tiny_types_1.ensure)('sceneId', sceneId, (0, tiny_types_1.isDefined)());
32
+ (0, tiny_types_1.ensure)('outcome', outcome, (0, tiny_types_1.isDefined)());
24
33
  }
25
34
  }
26
35
  exports.SceneFinishes = SceneFinishes;
@@ -1 +1 @@
1
- {"version":3,"file":"SceneFinishes.js","sourceRoot":"","sources":["../../src/events/SceneFinishes.ts"],"names":[],"mappings":";;;AACA,2CAA+C;AAE/C,oCAAyC;AACzC,8CAA0C;AAC1C,+CAA4C;AAE5C;;;;;;GAMG;AACH,MAAa,aAAc,SAAQ,yBAAW;IAStB;IARpB,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,aAAa,CACpB,qBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAiB,CAAC,EAC3C,sBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAC5C,CAAC;IACN,CAAC;IAED,YACoB,OAAsB,EACtC,SAAqB;QAErB,KAAK,CAAC,SAAS,CAAC,CAAC;QAHD,YAAO,GAAP,OAAO,CAAe;QAItC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;IAC5C,CAAC;CACJ;AAfD,sCAeC"}
1
+ {"version":3,"file":"SceneFinishes.js","sourceRoot":"","sources":["../../src/events/SceneFinishes.ts"],"names":[],"mappings":";;;AACA,2CAA+C;AAG/C,oCAAuE;AACvE,8CAA0C;AAC1C,+CAA4C;AAE5C;;;;;;;;;;GAUG;AACH,MAAa,aAAc,SAAQ,yBAAW;IAYtB;IACA;IAZpB,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,aAAa,CACpB,qBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAiB,CAAC,EAC3C,CAAC,CAAC,OAAO;YACL,CAAC,CAAC,eAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAA4B,CAAC;YAClD,CAAC,CAAC,IAAI,2BAAmB,EAAE,EAC/B,sBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAC5C,CAAC;IACN,CAAC;IAED,YACoB,OAAsB,EACtB,OAAgB,EAChC,SAAqB;QAErB,KAAK,CAAC,SAAS,CAAC,CAAC;QAJD,YAAO,GAAP,OAAO,CAAe;QACtB,YAAO,GAAP,OAAO,CAAS;QAIhC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACxC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;IAC5C,CAAC;CACJ;AApBD,sCAoBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/core",
3
- "version": "3.37.2",
3
+ "version": "3.38.0",
4
4
  "description": "The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -74,5 +74,5 @@
74
74
  "engines": {
75
75
  "node": "^20 || ^22 || ^24"
76
76
  },
77
- "gitHead": "5544cfdbfd7f3c4d3bb4e492b5d2f233eb5e3a79"
77
+ "gitHead": "d86152afd35fb815038b3a153e8c53a0b023e4b3"
78
78
  }
@@ -1,7 +1,8 @@
1
1
  import type { JSONObject } from 'tiny-types';
2
2
  import { ensure, isDefined } from 'tiny-types';
3
3
 
4
- import { CorrelationId } from '../model';
4
+ import type { SerialisedOutcome } from '../model';
5
+ import { CorrelationId, ExecutionSuccessful, Outcome } from '../model';
5
6
  import { Timestamp } from '../screenplay';
6
7
  import { DomainEvent } from './DomainEvent';
7
8
 
@@ -10,21 +11,30 @@ import { DomainEvent } from './DomainEvent';
10
11
  * Triggers any clean-up operations that might be required, such as discarding of
11
12
  * the [discardable](https://serenity-js.org/api/core/interface/Discardable/) abilities.
12
13
  *
14
+ * The `outcome` property contains the test outcome determined so far, before any cleanup operations.
15
+ * This allows stage crew members like the WebdriverIO notifier to invoke hooks with the test result
16
+ * before `waitForNextCue()` is called.
17
+ *
13
18
  * @group Events
14
19
  */
15
20
  export class SceneFinishes extends DomainEvent {
16
21
  static fromJSON(o: JSONObject): SceneFinishes {
17
22
  return new SceneFinishes(
18
23
  CorrelationId.fromJSON(o.sceneId as string),
24
+ o.outcome
25
+ ? Outcome.fromJSON(o.outcome as SerialisedOutcome)
26
+ : new ExecutionSuccessful(),
19
27
  Timestamp.fromJSON(o.timestamp as string),
20
28
  );
21
29
  }
22
30
 
23
31
  constructor(
24
32
  public readonly sceneId: CorrelationId,
33
+ public readonly outcome: Outcome,
25
34
  timestamp?: Timestamp,
26
35
  ) {
27
36
  super(timestamp);
28
37
  ensure('sceneId', sceneId, isDefined());
38
+ ensure('outcome', outcome, isDefined());
29
39
  }
30
40
  }