@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.
- package/CHANGELOG.md +20 -0
- package/README.md +6 -1
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts +2 -2
- package/lib/screenplay/abilities/BrowseTheWeb.js +2 -2
- package/lib/screenplay/interactions/Clear.d.ts +1 -1
- package/lib/screenplay/interactions/Clear.js +1 -1
- package/lib/screenplay/interactions/Click.d.ts +1 -1
- package/lib/screenplay/interactions/Click.js +1 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +1 -1
- package/lib/screenplay/interactions/DoubleClick.js +1 -1
- package/lib/screenplay/interactions/Enter.d.ts +1 -1
- package/lib/screenplay/interactions/Enter.js +1 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +2 -2
- package/lib/screenplay/interactions/ExecuteScript.js +2 -2
- package/lib/screenplay/interactions/Hover.d.ts +1 -1
- package/lib/screenplay/interactions/Hover.js +1 -1
- package/lib/screenplay/interactions/Navigate.d.ts +1 -1
- package/lib/screenplay/interactions/Navigate.js +1 -1
- package/lib/screenplay/interactions/PageElementInteraction.d.ts +1 -1
- package/lib/screenplay/interactions/PageElementInteraction.js +1 -1
- package/lib/screenplay/interactions/Press.d.ts +1 -1
- package/lib/screenplay/interactions/Press.js +1 -1
- package/lib/screenplay/interactions/RightClick.d.ts +1 -1
- package/lib/screenplay/interactions/RightClick.js +1 -1
- package/lib/screenplay/interactions/Scroll.d.ts +1 -1
- package/lib/screenplay/interactions/Scroll.js +1 -1
- package/lib/screenplay/interactions/Select.d.ts +1 -1
- package/lib/screenplay/interactions/Select.js +1 -1
- package/lib/screenplay/interactions/Switch.d.ts +1 -1
- package/lib/screenplay/interactions/Switch.js +1 -1
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +1 -1
- package/lib/screenplay/interactions/TakeScreenshot.js +1 -1
- package/lib/scripts/isVisible.js +3 -3
- package/lib/scripts/isVisible.js.map +1 -1
- package/package.json +8 -7
- package/src/screenplay/abilities/BrowseTheWeb.ts +2 -2
- package/src/screenplay/interactions/Clear.ts +1 -1
- package/src/screenplay/interactions/Click.ts +1 -1
- package/src/screenplay/interactions/DoubleClick.ts +1 -1
- package/src/screenplay/interactions/Enter.ts +1 -1
- package/src/screenplay/interactions/ExecuteScript.ts +2 -2
- package/src/screenplay/interactions/Hover.ts +1 -1
- package/src/screenplay/interactions/Navigate.ts +1 -1
- package/src/screenplay/interactions/PageElementInteraction.ts +1 -1
- package/src/screenplay/interactions/Press.ts +1 -1
- package/src/screenplay/interactions/RightClick.ts +1 -1
- package/src/screenplay/interactions/Scroll.ts +1 -1
- package/src/screenplay/interactions/Select.ts +1 -1
- package/src/screenplay/interactions/Switch.ts +1 -1
- package/src/screenplay/interactions/TakeScreenshot.ts +1 -1
- 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
|
+
[](https://www.linkedin.com/company/serenity-js)
|
|
4
|
+
[](https://www.youtube.com/@serenity-js)
|
|
5
|
+
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
6
|
+
[](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://
|
|
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
|
[](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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
53
|
+
* @group Activities
|
|
54
54
|
*/
|
|
55
55
|
class Hover extends PageElementInteraction_1.PageElementInteraction {
|
|
56
56
|
/**
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
68
|
+
* @group Activities
|
|
69
69
|
*/
|
|
70
70
|
class RightClick extends PageElementInteraction_1.PageElementInteraction {
|
|
71
71
|
/**
|
|
@@ -25,7 +25,7 @@ import { Answerable, AnswersQuestions, CollectsArtifacts, Interaction, UsesAbili
|
|
|
25
25
|
* - {@apilink Artifact}
|
|
26
26
|
* - {@apilink ArtifactArchiver}
|
|
27
27
|
*
|
|
28
|
-
* @group
|
|
28
|
+
* @group Activities
|
|
29
29
|
*/
|
|
30
30
|
export declare class TakeScreenshot extends Interaction {
|
|
31
31
|
private readonly name;
|
package/lib/scripts/isVisible.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
41
|
-
return
|
|
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,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE;QACzI,OAAO,KAAK,CAAA;KACf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,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.
|
|
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
|
|
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.
|
|
48
|
-
"@serenity-js/core": "3.0.0-rc.
|
|
49
|
-
"tiny-types": "^1.19.
|
|
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": "
|
|
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.
|
|
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.
|
|
76
|
+
* - {@apilink Cast.where}
|
|
77
77
|
* - {@apilink Cast.prepare}
|
|
78
78
|
*
|
|
79
79
|
* @group Abilities
|
|
@@ -13,7 +13,7 @@ import { BrowseTheWeb } from '../abilities';
|
|
|
13
13
|
* - {@apilink BrowseTheWeb}
|
|
14
14
|
* - {@apilink LastScriptExecution.result}
|
|
15
15
|
*
|
|
16
|
-
* @group
|
|
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
|
|
203
|
+
* @group Activities
|
|
204
204
|
*/
|
|
205
205
|
export abstract class ExecuteScriptWithArguments extends Interaction {
|
|
206
206
|
|
|
@@ -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
|
|
12
|
+
* @group Activities
|
|
13
13
|
*/
|
|
14
14
|
export abstract class PageElementInteraction extends Interaction {
|
|
15
15
|
|
package/src/scripts/isVisible.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
46
|
+
elements.push(context.elementFromPoint(x, y))
|
|
47
47
|
|
|
48
|
-
return
|
|
48
|
+
return elements
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// get overlapping elements
|