@serenity-js/web 3.0.0-rc.42 → 3.0.0-rc.44

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +6 -1
  3. package/lib/screenplay/abilities/BrowseTheWeb.d.ts +2 -2
  4. package/lib/screenplay/abilities/BrowseTheWeb.js +2 -2
  5. package/lib/screenplay/interactions/Clear.d.ts +1 -1
  6. package/lib/screenplay/interactions/Clear.js +1 -1
  7. package/lib/screenplay/interactions/Click.d.ts +1 -1
  8. package/lib/screenplay/interactions/Click.js +1 -1
  9. package/lib/screenplay/interactions/DoubleClick.d.ts +1 -1
  10. package/lib/screenplay/interactions/DoubleClick.js +1 -1
  11. package/lib/screenplay/interactions/Enter.d.ts +1 -1
  12. package/lib/screenplay/interactions/Enter.js +1 -1
  13. package/lib/screenplay/interactions/ExecuteScript.d.ts +2 -2
  14. package/lib/screenplay/interactions/ExecuteScript.js +2 -2
  15. package/lib/screenplay/interactions/Hover.d.ts +1 -1
  16. package/lib/screenplay/interactions/Hover.js +1 -1
  17. package/lib/screenplay/interactions/Navigate.d.ts +1 -1
  18. package/lib/screenplay/interactions/Navigate.js +1 -1
  19. package/lib/screenplay/interactions/PageElementInteraction.d.ts +1 -1
  20. package/lib/screenplay/interactions/PageElementInteraction.js +1 -1
  21. package/lib/screenplay/interactions/Press.d.ts +1 -1
  22. package/lib/screenplay/interactions/Press.js +1 -1
  23. package/lib/screenplay/interactions/RightClick.d.ts +1 -1
  24. package/lib/screenplay/interactions/RightClick.js +1 -1
  25. package/lib/screenplay/interactions/Scroll.d.ts +1 -1
  26. package/lib/screenplay/interactions/Scroll.js +1 -1
  27. package/lib/screenplay/interactions/Select.d.ts +1 -1
  28. package/lib/screenplay/interactions/Select.js +1 -1
  29. package/lib/screenplay/interactions/Switch.d.ts +1 -1
  30. package/lib/screenplay/interactions/Switch.js +1 -1
  31. package/lib/screenplay/interactions/TakeScreenshot.d.ts +1 -1
  32. package/lib/screenplay/interactions/TakeScreenshot.js +1 -1
  33. package/lib/scripts/isVisible.js +3 -3
  34. package/lib/scripts/isVisible.js.map +1 -1
  35. package/package.json +8 -7
  36. package/src/screenplay/abilities/BrowseTheWeb.ts +2 -2
  37. package/src/screenplay/interactions/Clear.ts +1 -1
  38. package/src/screenplay/interactions/Click.ts +1 -1
  39. package/src/screenplay/interactions/DoubleClick.ts +1 -1
  40. package/src/screenplay/interactions/Enter.ts +1 -1
  41. package/src/screenplay/interactions/ExecuteScript.ts +2 -2
  42. package/src/screenplay/interactions/Hover.ts +1 -1
  43. package/src/screenplay/interactions/Navigate.ts +1 -1
  44. package/src/screenplay/interactions/PageElementInteraction.ts +1 -1
  45. package/src/screenplay/interactions/Press.ts +1 -1
  46. package/src/screenplay/interactions/RightClick.ts +1 -1
  47. package/src/screenplay/interactions/Scroll.ts +1 -1
  48. package/src/screenplay/interactions/Select.ts +1 -1
  49. package/src/screenplay/interactions/Switch.ts +1 -1
  50. package/src/screenplay/interactions/TakeScreenshot.ts +1 -1
  51. package/src/scripts/isVisible.ts +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
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.0.0-rc.44](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.43...v3.0.0-rc.44) (2023-03-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** support for NPM 9 ([0493474](https://github.com/serenity-js/serenity-js/commit/0493474a1e28b86b1b60f69ec0d591c1a3265425))
12
+ * **deps:** update dependency tiny-types to ^1.19.1 ([ce335eb](https://github.com/serenity-js/serenity-js/commit/ce335ebca434d1fd0e6e809a65a0882fd10a311a))
13
+
14
+
15
+
16
+
17
+
18
+ # [3.0.0-rc.43](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.42...v3.0.0-rc.43) (2023-03-10)
19
+
20
+ **Note:** Version bump only for package @serenity-js/web
21
+
22
+
23
+
24
+
25
+
6
26
  # [3.0.0-rc.42](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.41...v3.0.0-rc.42) (2023-02-12)
7
27
 
8
28
  **Note:** Version bump only for package @serenity-js/web
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Serenity/JS
2
2
 
3
+ [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
4
+ [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
5
+ [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
6
+ [![Support Serenity/JS on GitHub](https://img.shields.io/badge/Support-@serenity--js-703EC8?logo=github)](https://matrix.to/#/#serenity-js:gitter.im)
7
+
3
8
  [Serenity/JS](https://serenity-js.org) is a framework designed to make acceptance and regression testing
4
9
  of modern full-stack applications faster, more collaborative and easier to scale.
5
10
 
@@ -10,7 +15,7 @@ and [API docs](https://serenity-js.org/modules/), and follow [@SerenityJS](https
10
15
 
11
16
  To learn more about Serenity/JS, check out the video below, read the [tutorial](https://serenity-js.org/handbook/thinking-in-serenity-js/index.html), review the [examples](https://github.com/serenity-js/serenity-js/tree/main/examples), and create your own test suite with [Serenity/JS template projects](https://github.com/serenity-js).
12
17
 
13
- If you have any questions, join us on [Serenity/JS Community Chat](https://gitter.im/serenity-js/Lobby).
18
+ If you have any questions, join us on the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im).
14
19
 
15
20
  [![Full-Stack Acceptance Testing with Serenity/JS and the Screenplay Pattern](https://img.youtube.com/vi/djPMf-n93Rw/0.jpg)](https://www.youtube.com/watch?v=djPMf-n93Rw)
16
21
 
@@ -16,7 +16,7 @@ import { BrowserCapabilities, BrowsingSession, Page } from '../models';
16
16
  * ## Giving the actors an ability to `BrowseTheWeb`
17
17
  *
18
18
  * To give an {@apilink Actor|actor} an ability to `BrowseTheWeb`, provide the **integration tool-specific implementation**
19
- * via {@apilink Actor.whoCan} in {@apilink Cast.prepare}, or via {@apilink Cast.whereEveryoneCan}.
19
+ * via {@apilink Actor.whoCan} in {@apilink Cast.prepare}, or via {@apilink Cast.where}.
20
20
  *
21
21
  * ```ts
22
22
  * import { beforeEach } from 'mocha'
@@ -71,7 +71,7 @@ import { BrowserCapabilities, BrowsingSession, Page } from '../models';
71
71
  *
72
72
  * - {@apilink Ability}
73
73
  * - {@apilink Actor.whoCan}
74
- * - {@apilink Cast.whereEveryoneCan}
74
+ * - {@apilink Cast.where}
75
75
  * - {@apilink Cast.prepare}
76
76
  *
77
77
  * @group Abilities
@@ -18,7 +18,7 @@ const core_1 = require("@serenity-js/core");
18
18
  * ## Giving the actors an ability to `BrowseTheWeb`
19
19
  *
20
20
  * To give an {@apilink Actor|actor} an ability to `BrowseTheWeb`, provide the **integration tool-specific implementation**
21
- * via {@apilink Actor.whoCan} in {@apilink Cast.prepare}, or via {@apilink Cast.whereEveryoneCan}.
21
+ * via {@apilink Actor.whoCan} in {@apilink Cast.prepare}, or via {@apilink Cast.where}.
22
22
  *
23
23
  * ```ts
24
24
  * import { beforeEach } from 'mocha'
@@ -73,7 +73,7 @@ const core_1 = require("@serenity-js/core");
73
73
  *
74
74
  * - {@apilink Ability}
75
75
  * - {@apilink Actor.whoCan}
76
- * - {@apilink Cast.whereEveryoneCan}
76
+ * - {@apilink Cast.where}
77
77
  * - {@apilink Cast.prepare}
78
78
  *
79
79
  * @group Abilities
@@ -50,7 +50,7 @@ import { PageElementInteraction } from './PageElementInteraction';
50
50
  * - {@apilink Value}
51
51
  * - {@apilink PageElement}
52
52
  *
53
- * @group Interactions
53
+ * @group Activities
54
54
  */
55
55
  export declare class Clear extends PageElementInteraction {
56
56
  private readonly field;
@@ -52,7 +52,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
52
52
  * - {@apilink Value}
53
53
  * - {@apilink PageElement}
54
54
  *
55
- * @group Interactions
55
+ * @group Activities
56
56
  */
57
57
  class Clear extends PageElementInteraction_1.PageElementInteraction {
58
58
  /**
@@ -44,7 +44,7 @@ import { PageElementInteraction } from './PageElementInteraction';
44
44
  * - {@apilink BrowseTheWeb}
45
45
  * - {@apilink PageElement}
46
46
  *
47
- * @group Interactions
47
+ * @group Activities
48
48
  */
49
49
  export declare class Click extends PageElementInteraction {
50
50
  private readonly element;
@@ -46,7 +46,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
46
46
  * - {@apilink BrowseTheWeb}
47
47
  * - {@apilink PageElement}
48
48
  *
49
- * @group Interactions
49
+ * @group Activities
50
50
  */
51
51
  class Click extends PageElementInteraction_1.PageElementInteraction {
52
52
  /**
@@ -67,7 +67,7 @@ import { PageElementInteraction } from './PageElementInteraction';
67
67
  * - {@apilink BrowseTheWeb}
68
68
  * - {@apilink PageElement}
69
69
  *
70
- * @group Interactions
70
+ * @group Activities
71
71
  */
72
72
  export declare class DoubleClick extends PageElementInteraction {
73
73
  private readonly pageElement;
@@ -69,7 +69,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
69
69
  * - {@apilink BrowseTheWeb}
70
70
  * - {@apilink PageElement}
71
71
  *
72
- * @group Interactions
72
+ * @group Activities
73
73
  */
74
74
  class DoubleClick extends PageElementInteraction_1.PageElementInteraction {
75
75
  /**
@@ -41,7 +41,7 @@ import { PageElementInteraction } from './PageElementInteraction';
41
41
  * - {@apilink BrowseTheWeb}
42
42
  * - {@apilink PageElement}
43
43
  *
44
- * @group Interactions
44
+ * @group Activities
45
45
  */
46
46
  export declare class Enter extends PageElementInteraction {
47
47
  private readonly values;
@@ -44,7 +44,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
44
44
  * - {@apilink BrowseTheWeb}
45
45
  * - {@apilink PageElement}
46
46
  *
47
- * @group Interactions
47
+ * @group Activities
48
48
  */
49
49
  class Enter extends PageElementInteraction_1.PageElementInteraction {
50
50
  /**
@@ -8,7 +8,7 @@ import { Answerable, AnswersQuestions, CollectsArtifacts, Interaction, UsesAbili
8
8
  * - {@apilink BrowseTheWeb}
9
9
  * - {@apilink LastScriptExecution.result}
10
10
  *
11
- * @group Interactions
11
+ * @group Activities
12
12
  */
13
13
  export declare class ExecuteScript {
14
14
  /**
@@ -179,7 +179,7 @@ export declare class ExecuteScript {
179
179
  * ## Learn more
180
180
  * - {@apilink ExecuteScript}
181
181
  *
182
- * @group Interactions
182
+ * @group Activities
183
183
  */
184
184
  export declare abstract class ExecuteScriptWithArguments extends Interaction {
185
185
  protected readonly script: string | Function;
@@ -14,7 +14,7 @@ const abilities_1 = require("../abilities");
14
14
  * - {@apilink BrowseTheWeb}
15
15
  * - {@apilink LastScriptExecution.result}
16
16
  *
17
- * @group Interactions
17
+ * @group Activities
18
18
  */
19
19
  class ExecuteScript {
20
20
  /**
@@ -192,7 +192,7 @@ exports.ExecuteScript = ExecuteScript;
192
192
  * ## Learn more
193
193
  * - {@apilink ExecuteScript}
194
194
  *
195
- * @group Interactions
195
+ * @group Activities
196
196
  */
197
197
  class ExecuteScriptWithArguments extends core_1.Interaction {
198
198
  constructor(description, script, // eslint-disable-line @typescript-eslint/ban-types
@@ -48,7 +48,7 @@ import { PageElementInteraction } from './PageElementInteraction';
48
48
  * - {@apilink BrowseTheWeb}
49
49
  * - {@apilink PageElement}
50
50
  *
51
- * @group Interactions
51
+ * @group Activities
52
52
  */
53
53
  export declare class Hover extends PageElementInteraction {
54
54
  private readonly element;
@@ -50,7 +50,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
50
50
  * - {@apilink BrowseTheWeb}
51
51
  * - {@apilink PageElement}
52
52
  *
53
- * @group Interactions
53
+ * @group Activities
54
54
  */
55
55
  class Hover extends PageElementInteraction_1.PageElementInteraction {
56
56
  /**
@@ -8,7 +8,7 @@ import { Answerable, Interaction } from '@serenity-js/core';
8
8
  *
9
9
  * - {@apilink BrowseTheWeb}
10
10
  *
11
- * @group Interactions
11
+ * @group Activities
12
12
  */
13
13
  export declare class Navigate {
14
14
  /**
@@ -12,7 +12,7 @@ const abilities_1 = require("../abilities");
12
12
  *
13
13
  * - {@apilink BrowseTheWeb}
14
14
  *
15
- * @group Interactions
15
+ * @group Activities
16
16
  */
17
17
  class Navigate {
18
18
  /**
@@ -7,7 +7,7 @@ import { PageElement } from '../models';
7
7
  * **Note:** The recommended way to implement custom interactions
8
8
  * in your code is to use the {@apilink Interaction.where} factory method.
9
9
  *
10
- * @group Interactions
10
+ * @group Activities
11
11
  */
12
12
  export declare abstract class PageElementInteraction extends Interaction {
13
13
  protected constructor(description: string, location?: FileSystemLocation);
@@ -8,7 +8,7 @@ const core_1 = require("@serenity-js/core");
8
8
  * **Note:** The recommended way to implement custom interactions
9
9
  * in your code is to use the {@apilink Interaction.where} factory method.
10
10
  *
11
- * @group Interactions
11
+ * @group Activities
12
12
  */
13
13
  class PageElementInteraction extends core_1.Interaction {
14
14
  constructor(description, location = core_1.Interaction.callerLocation(4)) {
@@ -53,7 +53,7 @@ import { PageElementInteraction } from './PageElementInteraction';
53
53
  * - {@apilink BrowseTheWeb}
54
54
  * - {@apilink PageElement}
55
55
  *
56
- * @group Interactions
56
+ * @group Activities
57
57
  */
58
58
  export declare class Press extends PageElementInteraction {
59
59
  private readonly keys;
@@ -58,7 +58,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
58
58
  * - {@apilink BrowseTheWeb}
59
59
  * - {@apilink PageElement}
60
60
  *
61
- * @group Interactions
61
+ * @group Activities
62
62
  */
63
63
  class Press extends PageElementInteraction_1.PageElementInteraction {
64
64
  /**
@@ -63,7 +63,7 @@ import { PageElementInteraction } from './PageElementInteraction';
63
63
  * - {@apilink BrowseTheWeb}
64
64
  * - {@apilink PageElement}
65
65
  *
66
- * @group Interactions
66
+ * @group Activities
67
67
  */
68
68
  export declare class RightClick extends PageElementInteraction {
69
69
  private readonly pageElement;
@@ -65,7 +65,7 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
65
65
  * - {@apilink BrowseTheWeb}
66
66
  * - {@apilink PageElement}
67
67
  *
68
- * @group Interactions
68
+ * @group Activities
69
69
  */
70
70
  class RightClick extends PageElementInteraction_1.PageElementInteraction {
71
71
  /**
@@ -45,7 +45,7 @@ import { PageElement } from '../models';
45
45
  * - {@apilink BrowseTheWeb}
46
46
  * - {@apilink PageElement}
47
47
  *
48
- * @group Interactions
48
+ * @group Activities
49
49
  */
50
50
  export declare class Scroll extends Interaction {
51
51
  private readonly element;
@@ -47,7 +47,7 @@ const core_1 = require("@serenity-js/core");
47
47
  * - {@apilink BrowseTheWeb}
48
48
  * - {@apilink PageElement}
49
49
  *
50
- * @group Interactions
50
+ * @group Activities
51
51
  */
52
52
  class Scroll extends core_1.Interaction {
53
53
  /**
@@ -9,7 +9,7 @@ import { PageElement } from '../models';
9
9
  * ## Learn more
10
10
  * - {@apilink Selected}
11
11
  *
12
- * @group Interactions
12
+ * @group Activities
13
13
  */
14
14
  export declare class Select {
15
15
  /**
@@ -14,7 +14,7 @@ const models_1 = require("../models");
14
14
  * ## Learn more
15
15
  * - {@apilink Selected}
16
16
  *
17
- * @group Interactions
17
+ * @group Activities
18
18
  */
19
19
  class Select {
20
20
  /**
@@ -96,7 +96,7 @@ import { Switchable } from '../models';
96
96
  * - {@apilink Switchable}
97
97
  * - {@apilink SwitchableOrigin}
98
98
  *
99
- * @group Interactions
99
+ * @group Activities
100
100
  */
101
101
  export declare class Switch extends Interaction {
102
102
  private readonly switchable;
@@ -98,7 +98,7 @@ const core_1 = require("@serenity-js/core");
98
98
  * - {@apilink Switchable}
99
99
  * - {@apilink SwitchableOrigin}
100
100
  *
101
- * @group Interactions
101
+ * @group Activities
102
102
  */
103
103
  class Switch extends core_1.Interaction {
104
104
  /**
@@ -25,7 +25,7 @@ import { Answerable, AnswersQuestions, CollectsArtifacts, Interaction, UsesAbili
25
25
  * - {@apilink Artifact}
26
26
  * - {@apilink ArtifactArchiver}
27
27
  *
28
- * @group Interactions
28
+ * @group Activities
29
29
  */
30
30
  export declare class TakeScreenshot extends Interaction {
31
31
  private readonly name;
@@ -30,7 +30,7 @@ const abilities_1 = require("../abilities");
30
30
  * - {@apilink Artifact}
31
31
  * - {@apilink ArtifactArchiver}
32
32
  *
33
- * @group Interactions
33
+ * @group Activities
34
34
  */
35
35
  class TakeScreenshot extends core_1.Interaction {
36
36
  /**
@@ -31,14 +31,14 @@ function isVisible(domNode) {
31
31
  // applicable if element's text is multiline.
32
32
  function getOverlappingRects(element, context) {
33
33
  context = context || document;
34
- const elems = [];
34
+ const elements = [];
35
35
  const rects = element.getClientRects();
36
36
  // webdriver clicks on center of the first element's rect (line of text), it might change in future
37
37
  const rect = rects[0];
38
38
  const x = rect.left + (rect.width / 2);
39
39
  const y = rect.top + (rect.height / 2);
40
- elems.push(context.elementFromPoint(x, y));
41
- return elems;
40
+ elements.push(context.elementFromPoint(x, y));
41
+ return elements;
42
42
  }
43
43
  // get overlapping elements
44
44
  function getOverlappingElements(element, context) {
@@ -1 +1 @@
1
- {"version":3,"file":"isVisible.js","sourceRoot":"","sources":["../../src/scripts/isVisible.ts"],"names":[],"mappings":";;;AAAA,4EAA4E;AAC5E,0BAA0B;AAC1B,SAAgB,SAAS,CAAC,OAAoB;IAE1C,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,KAAK,CAAC,OAAO,KAAK,GAAG,EAAE;QACvB,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE;QAC/B,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM,EAAE;QAC1B,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,CAAC,OAAO,CAAC,qBAAqB,IAAI,CAAC,OAAO,CAAC,cAAc,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,UAAU,CAAC,gBAAgB,CAAA;QAC7D,CAAC,CAAC,CAAA;QAEF,0DAA0D;QAC1D,IAAI,uBAAuB,GAAkB,EAAE,CAAA;QAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAsB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACpD,MAAM,aAAa,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA;YAC/C,uBAAuB,GAAG,uBAAuB,CAAC,MAAM,CACpD,sBAAsB,CAAC,OAAO,EAAG,aAA6B,CAAC,UAAiB,CAAQ,CAC3F,CAAA;SACJ;QACD,gCAAgC;QAChC,uBAAuB,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;YAC3E,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;QAEF,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC,EAAE;YACtC,OAAO,KAAK,CAAA;SACf;QAED,OAAO,yBAAyB,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAA;IACtE,CAAC;IAED,OAAO,yBAAyB,CAAC,sBAAsB,CAAC,OAAO,CAAyB,EAAE,OAAO,CAAC,CAAA;AACtG,CAAC;AA9GD,8BA8GC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/web",
3
- "version": "3.0.0-rc.42",
3
+ "version": "3.0.0-rc.44",
4
4
  "description": "Serenity/JS Screenplay Pattern APIs for the Web",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -27,7 +27,7 @@
27
27
  "web"
28
28
  ],
29
29
  "scripts": {
30
- "clean": "rimraf '../../target/coverage/web'",
30
+ "clean": "rimraf target",
31
31
  "test": "nyc mocha --config ../../.mocharc.yml 'spec/**/*.spec.*'",
32
32
  "compile": "rimraf lib && tsc --project tsconfig.build.json"
33
33
  },
@@ -41,21 +41,22 @@
41
41
  },
42
42
  "engines": {
43
43
  "node": "^14 || ^16 || ^18",
44
- "npm": "^6 || ^7 || ^8"
44
+ "npm": "^6 || ^7 || ^8 || ^9"
45
45
  },
46
46
  "dependencies": {
47
- "@serenity-js/assertions": "3.0.0-rc.42",
48
- "@serenity-js/core": "3.0.0-rc.42",
49
- "tiny-types": "^1.19.0"
47
+ "@serenity-js/assertions": "3.0.0-rc.44",
48
+ "@serenity-js/core": "3.0.0-rc.44",
49
+ "tiny-types": "^1.19.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@integration/testing-tools": "3.0.0",
53
53
  "@types/chai": "^4.3.4",
54
54
  "@types/mocha": "^10.0.1",
55
55
  "mocha": "^10.2.0",
56
+ "mocha-multi": "^1.1.7",
56
57
  "nyc": "15.1.0",
57
58
  "ts-node": "^10.9.1",
58
59
  "typescript": "^4.9.5"
59
60
  },
60
- "gitHead": "ebe1ca57bb98f09bc4554f32e87f44a0dbce2c22"
61
+ "gitHead": "be0c603085f922841e8050f1c50103b7eef7fdc0"
61
62
  }
@@ -18,7 +18,7 @@ import { BrowserCapabilities, BrowsingSession, Page } from '../models';
18
18
  * ## Giving the actors an ability to `BrowseTheWeb`
19
19
  *
20
20
  * To give an {@apilink Actor|actor} an ability to `BrowseTheWeb`, provide the **integration tool-specific implementation**
21
- * via {@apilink Actor.whoCan} in {@apilink Cast.prepare}, or via {@apilink Cast.whereEveryoneCan}.
21
+ * via {@apilink Actor.whoCan} in {@apilink Cast.prepare}, or via {@apilink Cast.where}.
22
22
  *
23
23
  * ```ts
24
24
  * import { beforeEach } from 'mocha'
@@ -73,7 +73,7 @@ import { BrowserCapabilities, BrowsingSession, Page } from '../models';
73
73
  *
74
74
  * - {@apilink Ability}
75
75
  * - {@apilink Actor.whoCan}
76
- * - {@apilink Cast.whereEveryoneCan}
76
+ * - {@apilink Cast.where}
77
77
  * - {@apilink Cast.prepare}
78
78
  *
79
79
  * @group Abilities
@@ -52,7 +52,7 @@ import { PageElementInteraction } from './PageElementInteraction';
52
52
  * - {@apilink Value}
53
53
  * - {@apilink PageElement}
54
54
  *
55
- * @group Interactions
55
+ * @group Activities
56
56
  */
57
57
  export class Clear extends PageElementInteraction {
58
58
 
@@ -46,7 +46,7 @@ import { PageElementInteraction } from './PageElementInteraction';
46
46
  * - {@apilink BrowseTheWeb}
47
47
  * - {@apilink PageElement}
48
48
  *
49
- * @group Interactions
49
+ * @group Activities
50
50
  */
51
51
  export class Click extends PageElementInteraction {
52
52
 
@@ -69,7 +69,7 @@ import { PageElementInteraction } from './PageElementInteraction';
69
69
  * - {@apilink BrowseTheWeb}
70
70
  * - {@apilink PageElement}
71
71
  *
72
- * @group Interactions
72
+ * @group Activities
73
73
  */
74
74
  export class DoubleClick extends PageElementInteraction {
75
75
 
@@ -44,7 +44,7 @@ import { PageElementInteraction } from './PageElementInteraction';
44
44
  * - {@apilink BrowseTheWeb}
45
45
  * - {@apilink PageElement}
46
46
  *
47
- * @group Interactions
47
+ * @group Activities
48
48
  */
49
49
  export class Enter extends PageElementInteraction {
50
50
 
@@ -13,7 +13,7 @@ import { BrowseTheWeb } from '../abilities';
13
13
  * - {@apilink BrowseTheWeb}
14
14
  * - {@apilink LastScriptExecution.result}
15
15
  *
16
- * @group Interactions
16
+ * @group Activities
17
17
  */
18
18
  export class ExecuteScript {
19
19
 
@@ -200,7 +200,7 @@ export class ExecuteScript {
200
200
  * ## Learn more
201
201
  * - {@apilink ExecuteScript}
202
202
  *
203
- * @group Interactions
203
+ * @group Activities
204
204
  */
205
205
  export abstract class ExecuteScriptWithArguments extends Interaction {
206
206
 
@@ -50,7 +50,7 @@ import { PageElementInteraction } from './PageElementInteraction';
50
50
  * - {@apilink BrowseTheWeb}
51
51
  * - {@apilink PageElement}
52
52
  *
53
- * @group Interactions
53
+ * @group Activities
54
54
  */
55
55
  export class Hover extends PageElementInteraction {
56
56
 
@@ -11,7 +11,7 @@ import { BrowseTheWeb } from '../abilities';
11
11
  *
12
12
  * - {@apilink BrowseTheWeb}
13
13
  *
14
- * @group Interactions
14
+ * @group Activities
15
15
  */
16
16
  export class Navigate {
17
17
 
@@ -9,7 +9,7 @@ import { PageElement } from '../models';
9
9
  * **Note:** The recommended way to implement custom interactions
10
10
  * in your code is to use the {@apilink Interaction.where} factory method.
11
11
  *
12
- * @group Interactions
12
+ * @group Activities
13
13
  */
14
14
  export abstract class PageElementInteraction extends Interaction {
15
15
 
@@ -57,7 +57,7 @@ import { PageElementInteraction } from './PageElementInteraction';
57
57
  * - {@apilink BrowseTheWeb}
58
58
  * - {@apilink PageElement}
59
59
  *
60
- * @group Interactions
60
+ * @group Activities
61
61
  */
62
62
  export class Press extends PageElementInteraction {
63
63
 
@@ -65,7 +65,7 @@ import { PageElementInteraction } from './PageElementInteraction';
65
65
  * - {@apilink BrowseTheWeb}
66
66
  * - {@apilink PageElement}
67
67
  *
68
- * @group Interactions
68
+ * @group Activities
69
69
  */
70
70
  export class RightClick extends PageElementInteraction {
71
71
  /**
@@ -47,7 +47,7 @@ import { PageElement } from '../models';
47
47
  * - {@apilink BrowseTheWeb}
48
48
  * - {@apilink PageElement}
49
49
  *
50
- * @group Interactions
50
+ * @group Activities
51
51
  */
52
52
  export class Scroll extends Interaction {
53
53
 
@@ -13,7 +13,7 @@ import { PageElement, SelectOption } from '../models';
13
13
  * ## Learn more
14
14
  * - {@apilink Selected}
15
15
  *
16
- * @group Interactions
16
+ * @group Activities
17
17
  */
18
18
  export class Select {
19
19
 
@@ -98,7 +98,7 @@ import { Switchable } from '../models';
98
98
  * - {@apilink Switchable}
99
99
  * - {@apilink SwitchableOrigin}
100
100
  *
101
- * @group Interactions
101
+ * @group Activities
102
102
  */
103
103
  export class Switch extends Interaction {
104
104
 
@@ -29,7 +29,7 @@ import { BrowseTheWeb } from '../abilities';
29
29
  * - {@apilink Artifact}
30
30
  * - {@apilink ArtifactArchiver}
31
31
  *
32
- * @group Interactions
32
+ * @group Activities
33
33
  */
34
34
  export class TakeScreenshot extends Interaction {
35
35
 
@@ -36,16 +36,16 @@ export function isVisible(domNode: HTMLElement): boolean {
36
36
  // applicable if element's text is multiline.
37
37
  function getOverlappingRects (element: HTMLElement, context?: Document) {
38
38
  context = context || document
39
- const elems = []
39
+ const elements = []
40
40
 
41
41
  const rects = element.getClientRects()
42
42
  // webdriver clicks on center of the first element's rect (line of text), it might change in future
43
43
  const rect = rects[0]
44
44
  const x = rect.left + (rect.width / 2)
45
45
  const y = rect.top + (rect.height / 2)
46
- elems.push(context.elementFromPoint(x, y))
46
+ elements.push(context.elementFromPoint(x, y))
47
47
 
48
- return elems
48
+ return elements
49
49
  }
50
50
 
51
51
  // get overlapping elements