@serenity-js/core 3.16.1 → 3.17.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,25 @@
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.17.0](https://github.com/serenity-js/serenity-js/compare/v3.16.2...v3.17.0) (2024-02-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **playwright-test:** fix lint issue, refactors and add integration tests to custom tags reporting ([0f055c7](https://github.com/serenity-js/serenity-js/commit/0f055c7f4e0a9f6d29ef20c615c2055baebf85ec))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.16.2](https://github.com/serenity-js/serenity-js/compare/v3.16.1...v3.16.2) (2024-02-05)
18
+
19
+ **Note:** Version bump only for package @serenity-js/core
20
+
21
+
22
+
23
+
24
+
6
25
  ## [3.16.1](https://github.com/serenity-js/serenity-js/compare/v3.16.0...v3.16.1) (2024-02-03)
7
26
 
8
27
 
@@ -1,7 +1,7 @@
1
- import { Ability } from '../screenplay';
2
- import type { Stage } from '../stage';
1
+ import { Ability } from '../screenplay/abilities/Ability';
2
+ import type { Stage } from '../stage/Stage';
3
3
  import type { ErrorOptions } from './ErrorOptions';
4
- import type { RuntimeError } from './model';
4
+ import type { RuntimeError } from './model/RuntimeError';
5
5
  /**
6
6
  * An {@apilink Ability} that enables an {@apilink Actor} to create a Serenity/JS {@apilink RuntimeError}
7
7
  * from within a custom {@apilink Interaction}.
@@ -1 +1 @@
1
- {"version":3,"file":"RaiseErrors.d.ts","sourceRoot":"","sources":["../../src/errors/RaiseErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAAa,WAAY,SAAQ,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,KAAK;IAIzC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,EAAE;CAGpG"}
1
+ {"version":3,"file":"RaiseErrors.d.ts","sourceRoot":"","sources":["../../src/errors/RaiseErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAAa,WAAY,SAAQ,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,KAAK;IAIzC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,EAAE;CAGpG"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RaiseErrors = void 0;
4
- const screenplay_1 = require("../screenplay");
4
+ const Ability_1 = require("../screenplay/abilities/Ability");
5
5
  /**
6
6
  * An {@apilink Ability} that enables an {@apilink Actor} to create a Serenity/JS {@apilink RuntimeError}
7
7
  * from within a custom {@apilink Interaction}.
@@ -49,7 +49,7 @@ const screenplay_1 = require("../screenplay");
49
49
  *
50
50
  * @group Errors
51
51
  */
52
- class RaiseErrors extends screenplay_1.Ability {
52
+ class RaiseErrors extends Ability_1.Ability {
53
53
  stage;
54
54
  constructor(stage) {
55
55
  super();
@@ -1 +1 @@
1
- {"version":3,"file":"RaiseErrors.js","sourceRoot":"","sources":["../../src/errors/RaiseErrors.ts"],"names":[],"mappings":";;;AAAA,8CAAwC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,WAAY,SAAQ,oBAAO;IACP;IAA7B,YAA6B,KAAY;QACrC,KAAK,EAAE,CAAC;QADiB,UAAK,GAAL,KAAK,CAAO;IAEzC,CAAC;IAED,MAAM,CAA0B,SAAqC,EAAE,OAAqB;QACxF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACJ;AARD,kCAQC"}
1
+ {"version":3,"file":"RaiseErrors.js","sourceRoot":"","sources":["../../src/errors/RaiseErrors.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAK1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,WAAY,SAAQ,iBAAO;IACP;IAA7B,YAA6B,KAAY;QACrC,KAAK,EAAE,CAAC;QADiB,UAAK,GAAL,KAAK,CAAO;IAEzC,CAAC;IAED,MAAM,CAA0B,SAAqC,EAAE,OAAqB;QACxF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACJ;AARD,kCAQC"}
@@ -4,6 +4,7 @@ import type { Tag } from './';
4
4
  */
5
5
  export declare class Tags {
6
6
  private static Pattern;
7
+ private static matchTags;
7
8
  static from(text: string): Tag[];
8
9
  }
9
10
  //# sourceMappingURL=Tags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAG9B;;GAEG;AACH,qBAAa,IAAI;IACb,OAAO,CAAC,MAAM,CAAC,OAAO,CAA4B;WAEpC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE;CAS1C"}
1
+ {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAG9B;;GAEG;AACH,qBAAa,IAAI;IACb,OAAO,CAAC,MAAM,CAAC,OAAO,CAA2B;IAEjD,OAAO,CAAC,MAAM,CAAC,SAAS;WAWV,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE;CAM1C"}
@@ -8,14 +8,22 @@ const _1 = require("./");
8
8
  */
9
9
  class Tags {
10
10
  static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
11
- static from(text) {
12
- const [, type, value] = Tags.Pattern.exec(text);
11
+ static matchTags(tagText) {
12
+ if (tagText === '')
13
+ return [];
14
+ const [, type, value] = Tags.Pattern.exec(tagText);
13
15
  return (0, tiny_types_1.match)(type.toLowerCase())
14
16
  .when('manual', _ => [new _1.ManualTag()])
15
17
  // todo: map as arbitrary tag if value === ''; look up ticket id
16
18
  .when(/^issues?$/, _ => value.split(',').map(value => new _1.IssueTag(value.trim())))
17
19
  .else(value => [new _1.ArbitraryTag(value.trim())]);
18
20
  }
21
+ static from(text) {
22
+ const tags = text.split(/\s+/)
23
+ .filter(word => word.startsWith('@'))
24
+ .flatMap(tag => Tags.matchTags(tag));
25
+ return tags ?? Tags.matchTags(text);
26
+ }
19
27
  }
20
28
  exports.Tags = Tags;
21
29
  //# sourceMappingURL=Tags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;AAGnC,yBAAuD;AAEvD;;GAEG;AACH,MAAa,IAAI;IACL,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAE;IAE3C,MAAM,CAAC,IAAI,CAAC,IAAY;QAC3B,MAAM,CAAE,AAAD,EAAG,IAAI,EAAE,KAAK,CAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElD,OAAO,IAAA,kBAAK,EAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;aAClC,IAAI,CAAC,QAAQ,EAAM,CAAC,CAAC,EAAE,CAAC,CAAE,IAAI,YAAS,EAAE,CAAE,CAAC;YAC7C,gEAAgE;aAC/D,IAAI,CAAC,WAAW,EAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,WAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;aAClF,IAAI,CAAC,KAAK,CAAW,EAAE,CAAC,CAAE,IAAI,eAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAE,CAAC,CAAC;IACrE,CAAC;;AAXL,oBAYC"}
1
+ {"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;AAGnC,yBAAuD;AAEvD;;GAEG;AACH,MAAa,IAAI;IACL,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAC;IAEzC,MAAM,CAAC,SAAS,CAAC,OAAe;QACpC,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC;QAC9B,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEnD,OAAO,IAAA,kBAAK,EAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;aAClC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,YAAS,EAAE,CAAC,CAAC;YACvC,gEAAgE;aAC/D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,WAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;aACjF,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,eAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACxD,CAAC;IAEM,MAAM,CAAC,IAAI,CAAC,IAAY;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;aACzB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACpC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;;AAnBL,oBAoBC"}
@@ -23,7 +23,7 @@ export declare class Masked {
23
23
  *
24
24
  * await actorCalled('John')
25
25
  * .attemptsTo(
26
- * Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInput())
26
+ * Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
27
27
  * );
28
28
  * ```
29
29
  *
@@ -25,7 +25,7 @@ class Masked {
25
25
  *
26
26
  * await actorCalled('John')
27
27
  * .attemptsTo(
28
- * Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInput())
28
+ * Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
29
29
  * );
30
30
  * ```
31
31
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/core",
3
- "version": "3.16.1",
3
+ "version": "3.17.0",
4
4
  "description": "Serenity/JS Screenplay, reporting engine and core interfaces.",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -40,7 +40,7 @@
40
40
  "fast-glob": "3.3.2",
41
41
  "filenamify": "4.3.0",
42
42
  "graceful-fs": "4.2.11",
43
- "semver": "7.5.4",
43
+ "semver": "7.6.0",
44
44
  "tiny-types": "1.21.0",
45
45
  "upath": "2.0.1",
46
46
  "validate-npm-package-name": "5.0.0"
@@ -55,7 +55,7 @@
55
55
  "assertion-error-formatter": "3.0.0",
56
56
  "c8": "9.1.0",
57
57
  "memfs": "4.6.0",
58
- "mocha": "10.2.0",
58
+ "mocha": "10.3.0",
59
59
  "mocha-multi": "1.1.7",
60
60
  "ts-node": "10.9.2",
61
61
  "typescript": "5.2.2"
@@ -71,5 +71,5 @@
71
71
  "engines": {
72
72
  "node": "^16.13 || ^18.12 || ^20"
73
73
  },
74
- "gitHead": "1b1f01b834dc110b6edce2e50297136b4ad6959b"
74
+ "gitHead": "a60f6d1cb17807240f32f6c7cb1014df52f26c16"
75
75
  }
@@ -1,7 +1,7 @@
1
- import { Ability } from '../screenplay';
2
- import type { Stage } from '../stage';
1
+ import { Ability } from '../screenplay/abilities/Ability';
2
+ import type { Stage } from '../stage/Stage';
3
3
  import type { ErrorOptions } from './ErrorOptions';
4
- import type { RuntimeError } from './model';
4
+ import type { RuntimeError } from './model/RuntimeError';
5
5
 
6
6
  /**
7
7
  * An {@apilink Ability} that enables an {@apilink Actor} to create a Serenity/JS {@apilink RuntimeError}
@@ -7,15 +7,23 @@ import { ArbitraryTag, IssueTag, ManualTag } from './';
7
7
  * @package
8
8
  */
9
9
  export class Tags {
10
- private static Pattern = /^@([\w-]+)[\s:]?(.*)/i ;
10
+ private static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
11
11
 
12
- public static from(text: string): Tag[] {
13
- const [ , type, value ] = Tags.Pattern.exec(text);
12
+ private static matchTags(tagText: string): Tag[] {
13
+ if (tagText === '') return [];
14
+ const [, type, value] = Tags.Pattern.exec(tagText);
14
15
 
15
16
  return match<Tag[]>(type.toLowerCase())
16
- .when('manual', _ => [ new ManualTag() ])
17
+ .when('manual', _ => [new ManualTag()])
17
18
  // todo: map as arbitrary tag if value === ''; look up ticket id
18
- .when(/^issues?$/, _ => value.split(',').map(value => new IssueTag(value.trim())))
19
- .else(value => [ new ArbitraryTag(value.trim()) ]);
19
+ .when(/^issues?$/, _ => value.split(',').map(value => new IssueTag(value.trim())))
20
+ .else(value => [new ArbitraryTag(value.trim())])
21
+ }
22
+
23
+ public static from(text: string): Tag[] {
24
+ const tags = text.split(/\s+/)
25
+ .filter(word => word.startsWith('@'))
26
+ .flatMap(tag => Tags.matchTags(tag));
27
+ return tags ?? Tags.matchTags(text);
20
28
  }
21
29
  }
@@ -25,7 +25,7 @@ export class Masked {
25
25
  *
26
26
  * await actorCalled('John')
27
27
  * .attemptsTo(
28
- * Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInput())
28
+ * Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
29
29
  * );
30
30
  * ```
31
31
  *