@serenity-js/core 3.32.5 → 3.33.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.
- package/CHANGELOG.md +12 -0
- package/lib/events/SceneTagged.d.ts +1 -1
- package/lib/events/SceneTagged.d.ts.map +1 -1
- package/lib/events/SceneTagged.js +1 -1
- package/lib/events/SceneTagged.js.map +1 -1
- package/lib/instance.d.ts +2 -4
- package/lib/instance.d.ts.map +1 -1
- package/lib/instance.js +2 -4
- package/lib/instance.js.map +1 -1
- package/lib/model/tags/Tag.d.ts +0 -2
- package/lib/model/tags/Tag.d.ts.map +1 -1
- package/lib/model/tags/Tag.js +0 -42
- package/lib/model/tags/Tag.js.map +1 -1
- package/lib/model/tags/Tags.d.ts +4 -1
- package/lib/model/tags/Tags.d.ts.map +1 -1
- package/lib/model/tags/Tags.js +39 -4
- package/lib/model/tags/Tags.js.map +1 -1
- package/package.json +2 -2
- package/src/events/SceneTagged.ts +2 -2
- package/src/instance.ts +2 -4
- package/src/model/tags/Tag.ts +1 -16
- package/src/model/tags/Tags.ts +50 -3
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.33.1](https://github.com/serenity-js/serenity-js/compare/v3.33.0...v3.33.1) (2025-07-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **core:** refactored Tag deserialiser to simplify the import graph ([ec2c333](https://github.com/serenity-js/serenity-js/commit/ec2c333ed4127d898319d0d9932d09cf545e4508))
|
|
12
|
+
* **core:** support for deserialising ProjectTags ([47f650a](https://github.com/serenity-js/serenity-js/commit/47f650a026bbe812eff98dbe89658baa99371d0d))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [3.32.5](https://github.com/serenity-js/serenity-js/compare/v3.32.4...v3.32.5) (2025-07-28)
|
|
7
19
|
|
|
8
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneTagged.d.ts","sourceRoot":"","sources":["../../src/events/SceneTagged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"SceneTagged.d.ts","sourceRoot":"","sources":["../../src/events/SceneTagged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,KAAK,GAAG,EAAQ,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;aASpB,OAAO,EAAE,aAAa;aACtB,GAAG,EAAE,GAAG;IAT5B,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,WAAW;gBAQvB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,GAAG,EACxB,SAAS,CAAC,EAAE,SAAS;CAM5B"}
|
|
@@ -12,7 +12,7 @@ class SceneTagged extends DomainEvent_1.DomainEvent {
|
|
|
12
12
|
sceneId;
|
|
13
13
|
tag;
|
|
14
14
|
static fromJSON(o) {
|
|
15
|
-
return new SceneTagged(model_1.CorrelationId.fromJSON(o.sceneId), model_1.
|
|
15
|
+
return new SceneTagged(model_1.CorrelationId.fromJSON(o.sceneId), model_1.Tags.fromJSON(o.tag), screenplay_1.Timestamp.fromJSON(o.timestamp));
|
|
16
16
|
}
|
|
17
17
|
constructor(sceneId, tag, timestamp) {
|
|
18
18
|
super(timestamp);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneTagged.js","sourceRoot":"","sources":["../../src/events/SceneTagged.ts"],"names":[],"mappings":";;;AACA,2CAA+C;AAE/C,
|
|
1
|
+
{"version":3,"file":"SceneTagged.js","sourceRoot":"","sources":["../../src/events/SceneTagged.ts"],"names":[],"mappings":";;;AACA,2CAA+C;AAE/C,oCAAyD;AACzD,8CAA0C;AAC1C,+CAA4C;AAE5C;;GAEG;AACH,MAAa,WAAY,SAAQ,yBAAW;IASpB;IACA;IATpB,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,WAAW,CAClB,qBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAiB,CAAC,EAC3C,YAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAiB,CAAC,EAClC,sBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAC5C,CAAC;IACN,CAAC;IACD,YACoB,OAAsB,EACtB,GAAQ,EACxB,SAAqB;QAErB,KAAK,CAAC,SAAS,CAAC,CAAC;QAJD,YAAO,GAAP,OAAO,CAAe;QACtB,QAAG,GAAH,GAAG,CAAK;QAIxB,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACxC,IAAA,mBAAM,EAAC,KAAK,EAAE,GAAG,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;IACpC,CAAC;CACJ;AAjBD,kCAiBC"}
|
package/lib/instance.d.ts
CHANGED
|
@@ -9,10 +9,8 @@ import type { Cast } from './stage';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const serenity: Serenity;
|
|
11
11
|
/**
|
|
12
|
-
* Configures Serenity/JS. Every call to this function
|
|
13
|
-
*
|
|
14
|
-
* so this function should be called exactly once
|
|
15
|
-
* in your test suite.
|
|
12
|
+
* Configures Serenity/JS. Every call to this function replaces the previous configuration provided,
|
|
13
|
+
* so this function should be called exactly once in your test suite.
|
|
16
14
|
*
|
|
17
15
|
* This function is an alias for [`Serenity.configure`](https://serenity-js.org/api/core/class/Serenity/#configure).
|
|
18
16
|
*
|
package/lib/instance.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAsB,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAsB,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAEtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAEzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAE/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mBAAmB,IAAI,KAAK,CAE3C"}
|
package/lib/instance.js
CHANGED
|
@@ -15,10 +15,8 @@ const clock = new screenplay_1.Clock();
|
|
|
15
15
|
*/
|
|
16
16
|
exports.serenity = new Serenity_1.Serenity(clock);
|
|
17
17
|
/**
|
|
18
|
-
* Configures Serenity/JS. Every call to this function
|
|
19
|
-
*
|
|
20
|
-
* so this function should be called exactly once
|
|
21
|
-
* in your test suite.
|
|
18
|
+
* Configures Serenity/JS. Every call to this function replaces the previous configuration provided,
|
|
19
|
+
* so this function should be called exactly once in your test suite.
|
|
22
20
|
*
|
|
23
21
|
* This function is an alias for [`Serenity.configure`](https://serenity-js.org/api/core/class/Serenity/#configure).
|
|
24
22
|
*
|
package/lib/instance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":";;;AA6BA,8BAEC;AA6GD,wBAEC;AAqFD,kCAEC;AAoCD,kDAEC;AAzQD,6CAAqC;AACrC,yCAAsC;AAGtC,MAAM,KAAK,GAAG,IAAI,kBAAK,EAAE,CAAC;AAE1B;;;;GAIG;AACU,QAAA,QAAQ,GAAG,IAAI,mBAAQ,CAAC,KAAK,CAAC,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,SAAgB,SAAS,CAAC,MAAsB;IAC5C,gBAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AACH,SAAgB,MAAM,CAAC,MAAY;IAC/B,gBAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,SAAgB,WAAW,CAAC,IAAY;IACpC,OAAO,gBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,mBAAmB;IAC/B,OAAO,gBAAQ,CAAC,sBAAsB,EAAE,CAAC;AAC7C,CAAC"}
|
package/lib/model/tags/Tag.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { JSONObject } from 'tiny-types';
|
|
2
1
|
import { TinyType } from 'tiny-types';
|
|
3
2
|
/**
|
|
4
3
|
* @access public
|
|
@@ -7,7 +6,6 @@ export declare abstract class Tag extends TinyType {
|
|
|
7
6
|
readonly name: string;
|
|
8
7
|
readonly type: string;
|
|
9
8
|
static humanReadable(tagConstructor: new (name: string) => Tag, tagName: string): Tag;
|
|
10
|
-
static fromJSON(o: JSONObject): Tag;
|
|
11
9
|
protected constructor(name: string, type: string);
|
|
12
10
|
toJSON(): {
|
|
13
11
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tag.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,QAAQ,EAAE,MAAM,YAAY,CAAC;AAElF;;GAEG;AACH,8BAAsB,GAAI,SAAQ,QAAQ;aAcA,IAAI,EAAE,MAAM;aAAkB,IAAI,EAAE,MAAM;IAbhF,MAAM,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG;IAarF,SAAS,aAA6B,IAAI,EAAE,MAAM,EAAkB,IAAI,EAAE,MAAM;IAOhF,MAAM,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;CAG3C"}
|
package/lib/model/tags/Tag.js
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.Tag = void 0;
|
|
37
4
|
const tiny_types_1 = require("tiny-types");
|
|
38
|
-
const TagTypes = __importStar(require("./index"));
|
|
39
5
|
/**
|
|
40
6
|
* @access public
|
|
41
7
|
*/
|
|
@@ -52,14 +18,6 @@ class Tag extends tiny_types_1.TinyType {
|
|
|
52
18
|
.replaceAll(/[\s_]+/g, ' ');
|
|
53
19
|
return new tagConstructor(name.charAt(0).toUpperCase() + name.slice(1));
|
|
54
20
|
}
|
|
55
|
-
static fromJSON(o) {
|
|
56
|
-
const type = (0, tiny_types_1.ensure)('serialised tag type', o.type, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)());
|
|
57
|
-
const found = Object.keys(TagTypes).find(t => TagTypes[t].Type === type) || TagTypes.ArbitraryTag.name;
|
|
58
|
-
if (Object.prototype.hasOwnProperty.call(TagTypes[found], 'fromJSON')) {
|
|
59
|
-
return TagTypes[found].fromJSON(o);
|
|
60
|
-
}
|
|
61
|
-
return new TagTypes[found](o.name);
|
|
62
|
-
}
|
|
63
21
|
constructor(name, type) {
|
|
64
22
|
super();
|
|
65
23
|
this.name = name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/model/tags/Tag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/model/tags/Tag.ts"],"names":[],"mappings":";;;AAAA,2CAAkF;AAElF;;GAEG;AACH,MAAsB,GAAI,SAAQ,qBAAQ;IAcA;IAA8B;IAbpE,MAAM,CAAC,aAAa,CAAC,cAAyC,EAAE,OAAe;QAC3E,8MAA8M;QAC9M,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;aACvB,IAAI,EAAE;aACN,KAAK,CAAC,8DAA8D,CAAC;aACrE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;aAClE,IAAI,CAAC,GAAG,CAAC;aACT,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAC9B;QAED,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,YAAsC,IAAY,EAAkB,IAAY;QAC5E,KAAK,EAAE,CAAC;QAD0B,SAAI,GAAJ,IAAI,CAAQ;QAAkB,SAAI,GAAJ,IAAI,CAAQ;QAG5E,IAAA,mBAAM,EAAC,UAAU,EAAE,IAAI,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,EAAC,QAAQ,EAAE,IAAA,0BAAa,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,IAAA,mBAAM,EAAC,UAAU,EAAE,IAAI,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,EAAC,QAAQ,EAAE,IAAA,0BAAa,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,MAAM;QACF,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC;IAC5D,CAAC;CACJ;AAxBD,kBAwBC"}
|
package/lib/model/tags/Tags.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JSONObject } from 'tiny-types';
|
|
2
|
+
import type { Tag } from './Tag';
|
|
2
3
|
/**
|
|
3
4
|
* @package
|
|
4
5
|
*/
|
|
5
6
|
export declare class Tags {
|
|
7
|
+
private static readonly supportedTypes;
|
|
6
8
|
private static Pattern;
|
|
7
9
|
private static matchTags;
|
|
10
|
+
static fromJSON(o: JSONObject): Tag;
|
|
8
11
|
static from(text: string): Tag[];
|
|
9
12
|
static stripFrom(text: string): string;
|
|
10
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,YAAY,CAAC;AAYxD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAWjC;;GAEG;AACH,qBAAa,IAAI;IACb,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAWM;IAE5C,OAAO,CAAC,MAAM,CAAC,OAAO,CAA2B;IAEjD,OAAO,CAAC,MAAM,CAAC,SAAS;IAaxB,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,GAAG;WAgBrB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE;WAOzB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAOhD"}
|
package/lib/model/tags/Tags.js
CHANGED
|
@@ -2,11 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Tags = void 0;
|
|
4
4
|
const tiny_types_1 = require("tiny-types");
|
|
5
|
-
const
|
|
5
|
+
const ArbitraryTag_1 = require("./ArbitraryTag");
|
|
6
|
+
const BrowserTag_1 = require("./BrowserTag");
|
|
7
|
+
const CapabilityTag_1 = require("./CapabilityTag");
|
|
8
|
+
const ExecutionRetriedTag_1 = require("./ExecutionRetriedTag");
|
|
9
|
+
const FeatureTag_1 = require("./FeatureTag");
|
|
10
|
+
const IssueTag_1 = require("./IssueTag");
|
|
11
|
+
const ManualTag_1 = require("./ManualTag");
|
|
12
|
+
const PlatformTag_1 = require("./PlatformTag");
|
|
13
|
+
const ProjectTag_1 = require("./ProjectTag");
|
|
14
|
+
const ThemeTag_1 = require("./ThemeTag");
|
|
15
|
+
function hasCustomDeserialiser(tagType) {
|
|
16
|
+
return Object.prototype.hasOwnProperty.call(tagType, 'fromJSON');
|
|
17
|
+
}
|
|
6
18
|
/**
|
|
7
19
|
* @package
|
|
8
20
|
*/
|
|
9
21
|
class Tags {
|
|
22
|
+
static supportedTypes = new Map([
|
|
23
|
+
ArbitraryTag_1.ArbitraryTag,
|
|
24
|
+
BrowserTag_1.BrowserTag,
|
|
25
|
+
CapabilityTag_1.CapabilityTag,
|
|
26
|
+
ExecutionRetriedTag_1.ExecutionRetriedTag,
|
|
27
|
+
FeatureTag_1.FeatureTag,
|
|
28
|
+
IssueTag_1.IssueTag,
|
|
29
|
+
ManualTag_1.ManualTag,
|
|
30
|
+
PlatformTag_1.PlatformTag,
|
|
31
|
+
ProjectTag_1.ProjectTag,
|
|
32
|
+
ThemeTag_1.ThemeTag,
|
|
33
|
+
].map(tagType => [tagType.Type, tagType]));
|
|
10
34
|
static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
|
|
11
35
|
static matchTags(tagText) {
|
|
12
36
|
if (tagText === '') {
|
|
@@ -14,9 +38,20 @@ class Tags {
|
|
|
14
38
|
}
|
|
15
39
|
const [, tagType, value] = Tags.Pattern.exec(tagText);
|
|
16
40
|
return (0, tiny_types_1.match)(tagType.toLowerCase())
|
|
17
|
-
.when('manual', _ => [new
|
|
18
|
-
.when(/^issues?$/, _ => value.split(',').map(value => new
|
|
19
|
-
.else(value => [new
|
|
41
|
+
.when('manual', _ => [new ManualTag_1.ManualTag()])
|
|
42
|
+
.when(/^issues?$/, _ => value.split(',').map(value => new IssueTag_1.IssueTag(value.trim())))
|
|
43
|
+
.else(value => [new ArbitraryTag_1.ArbitraryTag(value.trim())]);
|
|
44
|
+
}
|
|
45
|
+
static fromJSON(o) {
|
|
46
|
+
const type = (0, tiny_types_1.ensure)('serialised tag type', o.type, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)());
|
|
47
|
+
if (!this.supportedTypes.has(type)) {
|
|
48
|
+
return new ArbitraryTag_1.ArbitraryTag(o.name);
|
|
49
|
+
}
|
|
50
|
+
const found = this.supportedTypes.get(type);
|
|
51
|
+
if (hasCustomDeserialiser(found)) {
|
|
52
|
+
return found.fromJSON(o);
|
|
53
|
+
}
|
|
54
|
+
return new found(o.name);
|
|
20
55
|
}
|
|
21
56
|
static from(text) {
|
|
22
57
|
const tags = text.split(/\s+/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.33.1",
|
|
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",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": "^18.12 || ^20 || ^22"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "11bbc2bb3f6d4d5fade2b7881b36e5259973901a"
|
|
79
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSONObject } from 'tiny-types';
|
|
2
2
|
import { ensure, isDefined } from 'tiny-types';
|
|
3
3
|
|
|
4
|
-
import { CorrelationId, Tag } from '../model';
|
|
4
|
+
import { CorrelationId, type Tag, Tags } from '../model';
|
|
5
5
|
import { Timestamp } from '../screenplay';
|
|
6
6
|
import { DomainEvent } from './DomainEvent';
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ export class SceneTagged extends DomainEvent {
|
|
|
12
12
|
static fromJSON(o: JSONObject): SceneTagged {
|
|
13
13
|
return new SceneTagged(
|
|
14
14
|
CorrelationId.fromJSON(o.sceneId as string),
|
|
15
|
-
|
|
15
|
+
Tags.fromJSON(o.tag as JSONObject),
|
|
16
16
|
Timestamp.fromJSON(o.timestamp as string),
|
|
17
17
|
);
|
|
18
18
|
}
|
package/src/instance.ts
CHANGED
|
@@ -14,10 +14,8 @@ const clock = new Clock();
|
|
|
14
14
|
export const serenity = new Serenity(clock);
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Configures Serenity/JS. Every call to this function
|
|
18
|
-
*
|
|
19
|
-
* so this function should be called exactly once
|
|
20
|
-
* in your test suite.
|
|
17
|
+
* Configures Serenity/JS. Every call to this function replaces the previous configuration provided,
|
|
18
|
+
* so this function should be called exactly once in your test suite.
|
|
21
19
|
*
|
|
22
20
|
* This function is an alias for [`Serenity.configure`](https://serenity-js.org/api/core/class/Serenity/#configure).
|
|
23
21
|
*
|
package/src/model/tags/Tag.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ensure, isDefined, isGreaterThan, isString, property, TinyType } from 'tiny-types';
|
|
3
|
-
|
|
4
|
-
import * as TagTypes from './index';
|
|
1
|
+
import { ensure, isDefined, isGreaterThan, property, TinyType } from 'tiny-types';
|
|
5
2
|
|
|
6
3
|
/**
|
|
7
4
|
* @access public
|
|
@@ -20,18 +17,6 @@ export abstract class Tag extends TinyType {
|
|
|
20
17
|
return new tagConstructor(name.charAt(0).toUpperCase() + name.slice(1));
|
|
21
18
|
}
|
|
22
19
|
|
|
23
|
-
static fromJSON(o: JSONObject): Tag {
|
|
24
|
-
const type: string = ensure('serialised tag type', o.type, isDefined(), isString()) as string;
|
|
25
|
-
|
|
26
|
-
const found = Object.keys(TagTypes).find(t => TagTypes[t].Type === type) || TagTypes.ArbitraryTag.name;
|
|
27
|
-
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(TagTypes[found], 'fromJSON')) {
|
|
29
|
-
return TagTypes[found].fromJSON(o);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return new TagTypes[found](o.name);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
20
|
protected constructor(public readonly name: string, public readonly type: string) {
|
|
36
21
|
super();
|
|
37
22
|
|
package/src/model/tags/Tags.ts
CHANGED
|
@@ -1,12 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { JSONObject, JSONValue } from 'tiny-types';
|
|
2
|
+
import { ensure, isDefined, isString, match } from 'tiny-types';
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
4
|
+
import { ArbitraryTag } from './ArbitraryTag';
|
|
5
|
+
import { BrowserTag } from './BrowserTag';
|
|
6
|
+
import { CapabilityTag } from './CapabilityTag';
|
|
7
|
+
import { ExecutionRetriedTag } from './ExecutionRetriedTag';
|
|
8
|
+
import { FeatureTag } from './FeatureTag';
|
|
9
|
+
import { IssueTag } from './IssueTag';
|
|
10
|
+
import { ManualTag } from './ManualTag';
|
|
11
|
+
import { PlatformTag } from './PlatformTag';
|
|
12
|
+
import { ProjectTag } from './ProjectTag';
|
|
13
|
+
import type { Tag } from './Tag';
|
|
14
|
+
import { ThemeTag } from './ThemeTag';
|
|
15
|
+
|
|
16
|
+
interface Deserialiser<Return_Type> {
|
|
17
|
+
fromJSON(o: JSONValue): Return_Type;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function hasCustomDeserialiser(tagType: any): tagType is Deserialiser<Tag> {
|
|
21
|
+
return Object.prototype.hasOwnProperty.call(tagType, 'fromJSON');
|
|
22
|
+
}
|
|
5
23
|
|
|
6
24
|
/**
|
|
7
25
|
* @package
|
|
8
26
|
*/
|
|
9
27
|
export class Tags {
|
|
28
|
+
private static readonly supportedTypes: Map<string, Deserialiser<Tag> | { new (name: string): Tag }> = new Map([
|
|
29
|
+
ArbitraryTag,
|
|
30
|
+
BrowserTag,
|
|
31
|
+
CapabilityTag,
|
|
32
|
+
ExecutionRetriedTag,
|
|
33
|
+
FeatureTag,
|
|
34
|
+
IssueTag,
|
|
35
|
+
ManualTag,
|
|
36
|
+
PlatformTag,
|
|
37
|
+
ProjectTag,
|
|
38
|
+
ThemeTag,
|
|
39
|
+
].map(tagType => [ tagType.Type, tagType ]))
|
|
40
|
+
|
|
10
41
|
private static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
|
|
11
42
|
|
|
12
43
|
private static matchTags(tagText: string): Tag[] {
|
|
@@ -22,6 +53,22 @@ export class Tags {
|
|
|
22
53
|
.else(value => [ new ArbitraryTag(value.trim()) ]);
|
|
23
54
|
}
|
|
24
55
|
|
|
56
|
+
static fromJSON(o: JSONObject): Tag {
|
|
57
|
+
const type: string = ensure('serialised tag type', o.type, isDefined(), isString()) as string;
|
|
58
|
+
|
|
59
|
+
if (! this.supportedTypes.has(type)) {
|
|
60
|
+
return new ArbitraryTag(o.name as string);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const found = this.supportedTypes.get(type);
|
|
64
|
+
|
|
65
|
+
if (hasCustomDeserialiser(found)) {
|
|
66
|
+
return found.fromJSON(o);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return new found(o.name as string);
|
|
70
|
+
}
|
|
71
|
+
|
|
25
72
|
public static from(text: string): Tag[] {
|
|
26
73
|
const tags = text.split(/\s+/)
|
|
27
74
|
.filter(word => word.startsWith('@'))
|