browsertime 26.3.2 → 27.0.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 +65 -0
- package/README.md +1 -1
- package/browserscripts/timings/softNavigations.js +94 -0
- package/lib/chrome/har.js +36 -5
- package/lib/chrome/settings/chromeAndroidOptions.js +2 -1
- package/lib/chrome/webdriver/chromium.js +39 -0
- package/lib/chrome/webdriver/setupChromiumOptions.js +86 -31
- package/lib/core/engine/collector.js +340 -317
- package/lib/core/engine/command/addText.js +93 -12
- package/lib/core/engine/command/click.js +239 -139
- package/lib/core/engine/command/commandHelper.js +45 -0
- package/lib/core/engine/command/cookie.js +85 -0
- package/lib/core/engine/command/element.js +37 -2
- package/lib/core/engine/command/javaScript.js +14 -24
- package/lib/core/engine/command/measure/screenshots.js +114 -0
- package/lib/core/engine/command/measure/video.js +85 -0
- package/lib/core/engine/command/measure.js +104 -180
- package/lib/core/engine/command/mouse/clickAndHold.js +6 -3
- package/lib/core/engine/command/mouse/contextClick.js +56 -4
- package/lib/core/engine/command/mouse/doubleClick.js +49 -1
- package/lib/core/engine/command/mouse/mouseMove.js +50 -1
- package/lib/core/engine/command/mouse/singleClick.js +165 -129
- package/lib/core/engine/command/navigation.js +6 -6
- package/lib/core/engine/command/select.js +95 -3
- package/lib/core/engine/command/selectorParser.js +58 -0
- package/lib/core/engine/command/set.js +55 -1
- package/lib/core/engine/command/wait.js +41 -2
- package/lib/core/engine/commands.js +550 -42
- package/lib/core/engine/index.js +206 -150
- package/lib/core/engine/iteration.js +269 -137
- package/lib/firefox/networkManager.js +22 -30
- package/lib/firefox/webdriver/builder.js +14 -0
- package/lib/safari/har.js +131 -0
- package/lib/safari/native/ios-capture +0 -0
- package/lib/safari/native/ios-capture.m +340 -0
- package/lib/safari/safariInspectorClient.js +322 -0
- package/lib/safari/webdriver/safari.js +303 -13
- package/lib/safari/webkitToCdpAdapter.js +241 -0
- package/lib/support/cli.js +13 -0
- package/lib/support/engineUtils.js +16 -5
- package/lib/support/getViewPort.js +5 -0
- package/lib/support/har/index.js +41 -3
- package/lib/support/usbPower.js +2 -3
- package/lib/video/postprocessing/finetune/addTextToVideo.js +4 -0
- package/lib/video/postprocessing/finetune/getFont.js +3 -3
- package/lib/video/postprocessing/finetune/getTimingMetrics.js +7 -0
- package/lib/video/postprocessing/finetune/index.js +26 -9
- package/lib/video/screenRecording/ios/iosDeviceRecorder.js +109 -0
- package/lib/video/screenRecording/recorder.js +2 -2
- package/lib/video/screenRecording/setOrangeBackground.js +3 -0
- package/package.json +11 -11
- package/types/core/engine/command/addText.d.ts +35 -6
- package/types/core/engine/command/addText.d.ts.map +1 -1
- package/types/core/engine/command/click.d.ts +87 -16
- package/types/core/engine/command/click.d.ts.map +1 -1
- package/types/core/engine/command/commandHelper.d.ts +16 -0
- package/types/core/engine/command/commandHelper.d.ts.map +1 -0
- package/types/core/engine/command/cookie.d.ts +65 -0
- package/types/core/engine/command/cookie.d.ts.map +1 -0
- package/types/core/engine/command/element.d.ts +19 -1
- package/types/core/engine/command/element.d.ts.map +1 -1
- package/types/core/engine/command/javaScript.d.ts +4 -0
- package/types/core/engine/command/javaScript.d.ts.map +1 -1
- package/types/core/engine/command/measure/screenshots.d.ts +15 -0
- package/types/core/engine/command/measure/screenshots.d.ts.map +1 -0
- package/types/core/engine/command/measure/video.d.ts +26 -0
- package/types/core/engine/command/measure/video.d.ts.map +1 -0
- package/types/core/engine/command/measure.d.ts +59 -33
- package/types/core/engine/command/measure.d.ts.map +1 -1
- package/types/core/engine/command/mouse/clickAndHold.d.ts.map +1 -1
- package/types/core/engine/command/mouse/contextClick.d.ts +28 -4
- package/types/core/engine/command/mouse/contextClick.d.ts.map +1 -1
- package/types/core/engine/command/mouse/doubleClick.d.ts +24 -4
- package/types/core/engine/command/mouse/doubleClick.d.ts.map +1 -1
- package/types/core/engine/command/mouse/mouseMove.d.ts +30 -5
- package/types/core/engine/command/mouse/mouseMove.d.ts.map +1 -1
- package/types/core/engine/command/mouse/singleClick.d.ts +50 -13
- package/types/core/engine/command/mouse/singleClick.d.ts.map +1 -1
- package/types/core/engine/command/navigation.d.ts +3 -3
- package/types/core/engine/command/select.d.ts +45 -8
- package/types/core/engine/command/select.d.ts.map +1 -1
- package/types/core/engine/command/selectorParser.d.ts +20 -0
- package/types/core/engine/command/selectorParser.d.ts.map +1 -0
- package/types/core/engine/command/set.d.ts +34 -7
- package/types/core/engine/command/set.d.ts.map +1 -1
- package/types/core/engine/command/wait.d.ts +29 -6
- package/types/core/engine/command/wait.d.ts.map +1 -1
- package/types/core/engine/commands.d.ts +296 -28
- package/types/core/engine/commands.d.ts.map +1 -1
- package/types/support/engineUtils.d.ts.map +1 -1
- package/types/support/getViewPort.d.ts.map +1 -1
- package/types/support/usbPower.d.ts.map +1 -1
- package/types/video/postprocessing/finetune/addTextToVideo.d.ts.map +1 -1
- package/types/video/postprocessing/finetune/getTimingMetrics.d.ts.map +1 -1
- package/types/video/postprocessing/finetune/index.d.ts.map +1 -1
- package/types/video/screenRecording/ios/iosDeviceRecorder.d.ts +28 -0
- package/types/video/screenRecording/ios/iosDeviceRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/recorder.d.ts +2 -2
- package/types/video/screenRecording/recorder.d.ts.map +1 -1
- package/types/video/screenRecording/setOrangeBackground.d.ts.map +1 -1
- package/types/video/video.d.ts +1 -1
- package/types/video/video.d.ts.map +1 -1
- package/visualmetrics/visualmetrics-portable.py +136 -136
- package/lib/video/screenRecording/ios/convertToMp4.js +0 -22
- package/lib/video/screenRecording/ios/iosRecorder.js +0 -68
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/contextClick.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contextClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/contextClick.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH;IACE,wCAiBC;IAhBC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,eAAiC;IACjC;;OAEG;IACH,gBAAmD;IACnD;;OAEG;IACH,gBAAsB;IAGxB;;OAEG;IACH,wBAKC;IAED;;;;;;;OAOG;IACH,cAJW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAkBzB;IAED;;;;;;;;OAQG;IACH,gBAUC;IAED;;;;;;;;OAQG;IACH,mBAYC;IAED;;;;;;;OAOG;IACH,iBASC;CACF"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @hideconstructor
|
|
6
6
|
*/
|
|
7
7
|
export class DoubleClick {
|
|
8
|
-
constructor(browser: any, pageCompleteCheck: any);
|
|
8
|
+
constructor(browser: any, pageCompleteCheck: any, options: any);
|
|
9
9
|
/**
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
@@ -19,6 +19,24 @@ export class DoubleClick {
|
|
|
19
19
|
*/
|
|
20
20
|
private pageCompleteCheck;
|
|
21
21
|
/**
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
private options;
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
private _waitForElement;
|
|
29
|
+
/**
|
|
30
|
+
* Performs a double click on an element using a unified selector string.
|
|
31
|
+
*
|
|
32
|
+
* @async
|
|
33
|
+
* @param {string} selector - The selector string. CSS by default, or use a prefix.
|
|
34
|
+
* @returns {Promise<void>}
|
|
35
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
36
|
+
*/
|
|
37
|
+
run(selector: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
22
40
|
* Performs a mouse double-click on an element matching a given XPath selector.
|
|
23
41
|
*
|
|
24
42
|
* @async
|
|
@@ -27,8 +45,9 @@ export class DoubleClick {
|
|
|
27
45
|
* @returns {Promise<void>} A promise that resolves when the double-click action is performed.
|
|
28
46
|
* @throws {Error} Throws an error if the element is not found.
|
|
29
47
|
*/
|
|
30
|
-
byXpath
|
|
48
|
+
private byXpath;
|
|
31
49
|
/**
|
|
50
|
+
* @private
|
|
32
51
|
* Performs a mouse double-click on an element matching a given CSS selector.
|
|
33
52
|
*
|
|
34
53
|
* @async
|
|
@@ -37,8 +56,9 @@ export class DoubleClick {
|
|
|
37
56
|
* @returns {Promise<void>} A promise that resolves when the double-click action is performed.
|
|
38
57
|
* @throws {Error} Throws an error if the element is not found.
|
|
39
58
|
*/
|
|
40
|
-
bySelector
|
|
59
|
+
private bySelector;
|
|
41
60
|
/**
|
|
61
|
+
* @private
|
|
42
62
|
* Performs a mouse double-click at the current cursor position.
|
|
43
63
|
*
|
|
44
64
|
* @async
|
|
@@ -46,6 +66,6 @@ export class DoubleClick {
|
|
|
46
66
|
* @returns {Promise<void>} A promise that resolves when the double-click occurs.
|
|
47
67
|
* @throws {Error} Throws an error if the double-click action cannot be performed.
|
|
48
68
|
*/
|
|
49
|
-
atCursor
|
|
69
|
+
private atCursor;
|
|
50
70
|
}
|
|
51
71
|
//# sourceMappingURL=doubleClick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doubleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/doubleClick.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doubleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/doubleClick.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH;IACE,gEAiBC;IAhBC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAgE;IAChE;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,gBAAsB;IAGxB;;OAEG;IACH,wBAKC;IAED;;;;;;;OAOG;IACH,cAJW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAkBzB;IAED;;;;;;;;;OASG;IACH,gBAeC;IAED;;;;;;;;;OASG;IACH,mBAiBC;IAED;;;;;;;;OAQG;IACH,iBAYC;CACF"}
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* @hideconstructor
|
|
6
6
|
*/
|
|
7
7
|
export class MouseMove {
|
|
8
|
-
constructor(browser: any);
|
|
8
|
+
constructor(browser: any, options: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private browser;
|
|
9
13
|
/**
|
|
10
14
|
* @private
|
|
11
15
|
*/
|
|
@@ -15,6 +19,24 @@ export class MouseMove {
|
|
|
15
19
|
*/
|
|
16
20
|
private actions;
|
|
17
21
|
/**
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
private options;
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
private _waitForElement;
|
|
29
|
+
/**
|
|
30
|
+
* Moves the mouse cursor to an element using a unified selector string.
|
|
31
|
+
*
|
|
32
|
+
* @async
|
|
33
|
+
* @param {string} selector - The selector string. CSS by default, or use a prefix.
|
|
34
|
+
* @returns {Promise<void>}
|
|
35
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
36
|
+
*/
|
|
37
|
+
run(selector: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
18
40
|
* Moves the mouse cursor to an element that matches a given XPath selector.
|
|
19
41
|
*
|
|
20
42
|
* @async
|
|
@@ -22,8 +44,9 @@ export class MouseMove {
|
|
|
22
44
|
* @returns {Promise<void>} A promise that resolves when the mouse has moved to the element.
|
|
23
45
|
* @throws {Error} Throws an error if the element is not found.
|
|
24
46
|
*/
|
|
25
|
-
byXpath
|
|
47
|
+
private byXpath;
|
|
26
48
|
/**
|
|
49
|
+
* @private
|
|
27
50
|
* Moves the mouse cursor to an element that matches a given CSS selector.
|
|
28
51
|
*
|
|
29
52
|
* @async
|
|
@@ -31,8 +54,9 @@ export class MouseMove {
|
|
|
31
54
|
* @returns {Promise<void>} A promise that resolves when the mouse has moved to the element.
|
|
32
55
|
* @throws {Error} Throws an error if the element is not found.
|
|
33
56
|
*/
|
|
34
|
-
bySelector
|
|
57
|
+
private bySelector;
|
|
35
58
|
/**
|
|
59
|
+
* @private
|
|
36
60
|
* Moves the mouse cursor to a specific position on the screen.
|
|
37
61
|
*
|
|
38
62
|
* @async
|
|
@@ -41,8 +65,9 @@ export class MouseMove {
|
|
|
41
65
|
* @returns {Promise<void>} A promise that resolves when the mouse has moved to the specified position.
|
|
42
66
|
* @throws {Error} Throws an error if the action cannot be performed.
|
|
43
67
|
*/
|
|
44
|
-
toPosition
|
|
68
|
+
private toPosition;
|
|
45
69
|
/**
|
|
70
|
+
* @private
|
|
46
71
|
* Moves the mouse cursor by an offset from its current position.
|
|
47
72
|
*
|
|
48
73
|
* @async
|
|
@@ -51,6 +76,6 @@ export class MouseMove {
|
|
|
51
76
|
* @returns {Promise<void>} A promise that resolves when the mouse has moved by the specified offset.
|
|
52
77
|
* @throws {Error} Throws an error if the action cannot be performed.
|
|
53
78
|
*/
|
|
54
|
-
byOffset
|
|
79
|
+
private byOffset;
|
|
55
80
|
}
|
|
56
81
|
//# sourceMappingURL=mouseMove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouseMove.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/mouseMove.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mouseMove.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/mouseMove.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH;IACE,wCAiBC;IAhBC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,eAAiC;IACjC;;OAEG;IACH,gBAAmD;IACnD;;OAEG;IACH,gBAAsB;IAGxB;;OAEG;IACH,wBAKC;IAED;;;;;;;OAOG;IACH,cAJW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,gBASC;IAED;;;;;;;;OAQG;IACH,mBASC;IAED;;;;;;;;;OASG;IACH,mBAQC;IAED;;;;;;;;;OASG;IACH,iBAUC;CACF"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @class
|
|
6
6
|
*/
|
|
7
7
|
export class SingleClick {
|
|
8
|
-
constructor(browser: any, pageCompleteCheck: any);
|
|
8
|
+
constructor(browser: any, pageCompleteCheck: any, options: any);
|
|
9
9
|
/**
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
@@ -19,6 +19,32 @@ export class SingleClick {
|
|
|
19
19
|
*/
|
|
20
20
|
private pageCompleteCheck;
|
|
21
21
|
/**
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
private options;
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
private _waitForElement;
|
|
29
|
+
/**
|
|
30
|
+
* Performs a single click on an element using a unified selector string.
|
|
31
|
+
*
|
|
32
|
+
* @async
|
|
33
|
+
* @param {string} selector - The selector string. CSS by default, or use a prefix.
|
|
34
|
+
* @param {Object} [options] - Options for the click action.
|
|
35
|
+
* @param {boolean} [options.waitForNavigation=false] - If true, waits for page complete check.
|
|
36
|
+
* @returns {Promise<void>}
|
|
37
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
38
|
+
*/
|
|
39
|
+
run(selector: string, options?: {
|
|
40
|
+
waitForNavigation?: boolean;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
private _andWait;
|
|
46
|
+
/**
|
|
47
|
+
* @private
|
|
22
48
|
* Performs a single mouse click on an element matching a given XPath selector.
|
|
23
49
|
*
|
|
24
50
|
* @async
|
|
@@ -27,8 +53,9 @@ export class SingleClick {
|
|
|
27
53
|
* @returns {Promise<void>} A promise that resolves when the single click action is performed.
|
|
28
54
|
* @throws {Error} Throws an error if the element is not found.
|
|
29
55
|
*/
|
|
30
|
-
byXpath
|
|
56
|
+
private byXpath;
|
|
31
57
|
/**
|
|
58
|
+
* @private
|
|
32
59
|
* Performs a single mouse click on an element matching a given XPath selector and wait for page complete check.
|
|
33
60
|
*
|
|
34
61
|
* @async
|
|
@@ -36,8 +63,9 @@ export class SingleClick {
|
|
|
36
63
|
* @returns {Promise<void>} A promise that resolves when the single click action is performed.
|
|
37
64
|
* @throws {Error} Throws an error if the element is not found.
|
|
38
65
|
*/
|
|
39
|
-
byXpathAndWait
|
|
66
|
+
private byXpathAndWait;
|
|
40
67
|
/**
|
|
68
|
+
* @private
|
|
41
69
|
* Performs a single mouse click on an element matching a given CSS selector.
|
|
42
70
|
*
|
|
43
71
|
* @async
|
|
@@ -46,8 +74,9 @@ export class SingleClick {
|
|
|
46
74
|
* @returns {Promise<void>} A promise that resolves when the single click action is performed.
|
|
47
75
|
* @throws {Error} Throws an error if the element is not found.
|
|
48
76
|
*/
|
|
49
|
-
bySelector
|
|
77
|
+
private bySelector;
|
|
50
78
|
/**
|
|
79
|
+
* @private
|
|
51
80
|
* Performs a single mouse click on an element matching a given CSS selector and waits on the page complete check.
|
|
52
81
|
*
|
|
53
82
|
* @async
|
|
@@ -55,8 +84,9 @@ export class SingleClick {
|
|
|
55
84
|
* @returns {Promise<void>} A promise that resolves when the single click action is performed.
|
|
56
85
|
* @throws {Error} Throws an error if the element is not found.
|
|
57
86
|
*/
|
|
58
|
-
bySelectorAndWait
|
|
87
|
+
private bySelectorAndWait;
|
|
59
88
|
/**
|
|
89
|
+
* @private
|
|
60
90
|
* Performs a single mouse click at the current cursor position.
|
|
61
91
|
*
|
|
62
92
|
* @async
|
|
@@ -64,8 +94,9 @@ export class SingleClick {
|
|
|
64
94
|
* @returns {Promise<void>} A promise that resolves when the single click occurs.
|
|
65
95
|
* @throws {Error} Throws an error if the single click action cannot be performed.
|
|
66
96
|
*/
|
|
67
|
-
atCursor
|
|
97
|
+
private atCursor;
|
|
68
98
|
/**
|
|
99
|
+
* @private
|
|
69
100
|
* Performs a single mouse click at the current cursor position and waits on the
|
|
70
101
|
* page complete check.
|
|
71
102
|
*
|
|
@@ -73,8 +104,9 @@ export class SingleClick {
|
|
|
73
104
|
* @returns {Promise<void>} A promise that resolves when the single click occurs.
|
|
74
105
|
* @throws {Error} Throws an error if the single click action cannot be performed.
|
|
75
106
|
*/
|
|
76
|
-
atCursorAndWait
|
|
107
|
+
private atCursorAndWait;
|
|
77
108
|
/**
|
|
109
|
+
* @private
|
|
78
110
|
* Clicks on a link whose visible text matches the given string.
|
|
79
111
|
*
|
|
80
112
|
* @async
|
|
@@ -82,8 +114,9 @@ export class SingleClick {
|
|
|
82
114
|
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
83
115
|
* @throws {Error} Throws an error if the link is not found.
|
|
84
116
|
*/
|
|
85
|
-
byLinkText
|
|
117
|
+
private byLinkText;
|
|
86
118
|
/**
|
|
119
|
+
* @private
|
|
87
120
|
* Clicks on a link whose visible text matches the given string and waits on the opage complete check.
|
|
88
121
|
*
|
|
89
122
|
* @async
|
|
@@ -91,8 +124,9 @@ export class SingleClick {
|
|
|
91
124
|
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
92
125
|
* @throws {Error} Throws an error if the link is not found.
|
|
93
126
|
*/
|
|
94
|
-
byLinkTextAndWait
|
|
127
|
+
private byLinkTextAndWait;
|
|
95
128
|
/**
|
|
129
|
+
* @private
|
|
96
130
|
* Clicks on a link whose visible text contains the given substring.
|
|
97
131
|
*
|
|
98
132
|
* @async
|
|
@@ -100,8 +134,9 @@ export class SingleClick {
|
|
|
100
134
|
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
101
135
|
* @throws {Error} Throws an error if the link is not found.
|
|
102
136
|
*/
|
|
103
|
-
byPartialLinkText
|
|
137
|
+
private byPartialLinkText;
|
|
104
138
|
/**
|
|
139
|
+
* @private
|
|
105
140
|
* Clicks on a link whose visible text contains the given substring and waits on the
|
|
106
141
|
* page complete check.
|
|
107
142
|
*
|
|
@@ -110,8 +145,9 @@ export class SingleClick {
|
|
|
110
145
|
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
111
146
|
* @throws {Error} Throws an error if the link is not found.
|
|
112
147
|
*/
|
|
113
|
-
byPartialLinkTextAndWait
|
|
148
|
+
private byPartialLinkTextAndWait;
|
|
114
149
|
/**
|
|
150
|
+
* @private
|
|
115
151
|
* Clicks on a element with a specific id.
|
|
116
152
|
*
|
|
117
153
|
* @async
|
|
@@ -119,8 +155,9 @@ export class SingleClick {
|
|
|
119
155
|
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
120
156
|
* @throws {Error} Throws an error if the id is not found.
|
|
121
157
|
*/
|
|
122
|
-
byId
|
|
158
|
+
private byId;
|
|
123
159
|
/**
|
|
160
|
+
* @private
|
|
124
161
|
* Clicks on a element with a specific id and wait on the page complete check
|
|
125
162
|
*
|
|
126
163
|
* @async
|
|
@@ -128,6 +165,6 @@ export class SingleClick {
|
|
|
128
165
|
* @returns {Promise<void>} A promise that resolves when the page has completed.
|
|
129
166
|
* @throws {Error} Throws an error if the id is not found.
|
|
130
167
|
*/
|
|
131
|
-
byIdAndWait
|
|
168
|
+
private byIdAndWait;
|
|
132
169
|
}
|
|
133
170
|
//# sourceMappingURL=singleClick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/singleClick.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"singleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/singleClick.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH;IACE,gEAiBC;IAhBC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAgE;IAChE;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,gBAAsB;IAGxB;;OAEG;IACH,wBAKC;IAED;;;;;;;;;OASG;IACH,cANW,MAAM,YAEd;QAA0B,iBAAiB,GAAnC,OAAO;KACf,GAAU,OAAO,CAAC,IAAI,CAAC,CAqBzB;IAED;;OAEG;IACH,iBAGC;IAED;;;;;;;;;OASG;IACH,gBAoBC;IAED;;;;;;;;OAQG;IACH,uBAEC;IAED;;;;;;;;;OASG;IACH,mBAoBC;IAED;;;;;;;;OAQG;IACH,0BAEC;IAED;;;;;;;;OAQG;IACH,iBAiBC;IAED;;;;;;;;OAQG;IACH,wBAEC;IAED;;;;;;;;OAQG;IACH,mBAQC;IAED;;;;;;;;OAQG;IACH,0BAQC;IAED;;;;;;;;OAQG;IACH,0BAQC;IAED;;;;;;;;;OASG;IACH,iCAQC;IAED;;;;;;;;OAQG;IACH,aAYC;IAED;;;;;;;;OAQG;IACH,oBAEC;CACF"}
|
|
@@ -19,7 +19,7 @@ export class Navigation {
|
|
|
19
19
|
*
|
|
20
20
|
* @async
|
|
21
21
|
* @example await commands.navigation.back();
|
|
22
|
-
* @param {Object} [options] - Additional options for navigation. Set {
|
|
22
|
+
* @param {Object} [options] - Additional options for navigation. Set {waitForNavigation:true} to wait for the page complete check to run.
|
|
23
23
|
* @returns {Promise<void>} A promise that resolves when the navigation action is completed.
|
|
24
24
|
* @throws {Error} Throws an error if navigation fails.
|
|
25
25
|
*/
|
|
@@ -29,7 +29,7 @@ export class Navigation {
|
|
|
29
29
|
*
|
|
30
30
|
* @async
|
|
31
31
|
* @example await commands.navigation.forward();
|
|
32
|
-
* @param {Object} [options] - Additional options for navigation. Set {
|
|
32
|
+
* @param {Object} [options] - Additional options for navigation. Set {waitForNavigation:true} to wait for the page complete check to run.
|
|
33
33
|
* @returns {Promise<void>} A promise that resolves when the navigation action is completed.
|
|
34
34
|
* @throws {Error} Throws an error if navigation fails.
|
|
35
35
|
*/
|
|
@@ -39,7 +39,7 @@ export class Navigation {
|
|
|
39
39
|
*
|
|
40
40
|
* @async
|
|
41
41
|
* @example await commands.navigation.refresh();
|
|
42
|
-
* @param {Object} [options] - Additional options for refresh action. Set {
|
|
42
|
+
* @param {Object} [options] - Additional options for refresh action. Set {waitForNavigation:true} to wait for the page complete check to run.
|
|
43
43
|
* @returns {Promise<void>} A promise that resolves when the page has been refreshed.
|
|
44
44
|
* @throws {Error} Throws an error if refreshing the page fails.
|
|
45
45
|
*/
|
|
@@ -5,77 +5,114 @@
|
|
|
5
5
|
* @hideconstructor
|
|
6
6
|
*/
|
|
7
7
|
export class Select {
|
|
8
|
-
constructor(browser: any);
|
|
8
|
+
constructor(browser: any, options: any);
|
|
9
9
|
/**
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
12
|
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private options;
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
private _waitForElement;
|
|
21
|
+
/**
|
|
22
|
+
* Selects an option in a select element using a unified selector string and a value.
|
|
23
|
+
* Supports CSS selectors (default), and prefix-based strategies:
|
|
24
|
+
* 'id:mySelect', 'name:country', 'class:dropdown'.
|
|
25
|
+
*
|
|
26
|
+
* @async
|
|
27
|
+
* @param {string} selector - The selector string for the select element.
|
|
28
|
+
* @param {string} value - The value of the option to select.
|
|
29
|
+
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
30
|
+
* @throws {Error} Throws an error if the select element is not found.
|
|
31
|
+
*/
|
|
32
|
+
run(selector: string, value: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Selects an option in a select element by its visible text using a unified selector string.
|
|
35
|
+
*
|
|
36
|
+
* @async
|
|
37
|
+
* @param {string} selector - The selector string for the select element.
|
|
38
|
+
* @param {string} text - The visible text of the option to select.
|
|
39
|
+
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
40
|
+
* @throws {Error} Throws an error if the select element or option is not found.
|
|
41
|
+
*/
|
|
42
|
+
runByText(selector: string, text: string): Promise<void>;
|
|
13
43
|
/**
|
|
14
44
|
* Selects an option in a `<select>` element by its ID and the value of the option.
|
|
15
45
|
*
|
|
16
46
|
* @async
|
|
47
|
+
* @private
|
|
17
48
|
* @param {string} selectId - The ID of the `<select>` element.
|
|
18
49
|
* @param {string} value - The value of the option to select.
|
|
19
50
|
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
20
51
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
21
52
|
*/
|
|
22
|
-
selectByIdAndValue
|
|
53
|
+
private selectByIdAndValue;
|
|
23
54
|
/**
|
|
24
55
|
* Selects an option in a `<select>` element by its name and the value of the option.
|
|
25
56
|
*
|
|
26
57
|
* @async
|
|
58
|
+
* @private
|
|
27
59
|
* @param {string} selectName - The name of the `<select>` element.
|
|
28
60
|
* @param {string} value - The value of the option to select.
|
|
29
61
|
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
30
62
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
31
63
|
*/
|
|
32
|
-
selectByNameAndValue
|
|
64
|
+
private selectByNameAndValue;
|
|
33
65
|
/**
|
|
34
66
|
* Selects an option in a `<select>` element by its ID and the index of the option.
|
|
35
67
|
*
|
|
36
68
|
* @async
|
|
69
|
+
* @private
|
|
37
70
|
* @param {string} selectId - The ID of the `<select>` element.
|
|
38
71
|
* @param {number} index - The index of the option to select.
|
|
39
72
|
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
40
73
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
41
74
|
*/
|
|
42
|
-
selectByIdAndIndex
|
|
75
|
+
private selectByIdAndIndex;
|
|
43
76
|
/**
|
|
44
77
|
* Selects an option in a `<select>` element by its name and the index of the option.
|
|
45
78
|
*
|
|
46
79
|
* @async
|
|
80
|
+
* @private
|
|
47
81
|
* @param {string} selectName - The name of the `<select>` element.
|
|
48
82
|
* @param {number} index - The index of the option to select.
|
|
49
83
|
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
50
84
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
51
85
|
*/
|
|
52
|
-
selectByNameAndIndex
|
|
86
|
+
private selectByNameAndIndex;
|
|
53
87
|
/**
|
|
54
88
|
* Deselects all options in a `<select>` element by its ID.
|
|
55
89
|
*
|
|
56
90
|
* @async
|
|
91
|
+
* @private
|
|
57
92
|
* @param {string} selectId - The ID of the `<select>` element.
|
|
58
93
|
* @returns {Promise<void>} A promise that resolves when all options are deselected.
|
|
59
94
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
60
95
|
*/
|
|
61
|
-
deselectById
|
|
96
|
+
private deselectById;
|
|
62
97
|
/**
|
|
63
98
|
* Retrieves all option values in a `<select>` element by its ID.
|
|
64
99
|
*
|
|
65
100
|
* @async
|
|
101
|
+
* @private
|
|
66
102
|
* @param {string} selectId - The ID of the `<select>` element.
|
|
67
103
|
* @returns {Promise<string[]>} A promise that resolves with an array of the values of the options.
|
|
68
104
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
69
105
|
*/
|
|
70
|
-
getValuesById
|
|
106
|
+
private getValuesById;
|
|
71
107
|
/**
|
|
72
108
|
* Retrieves the value of the selected option in a `<select>` element by its ID.
|
|
73
109
|
*
|
|
74
110
|
* @async
|
|
111
|
+
* @private
|
|
75
112
|
* @param {string} selectId - The ID of the `<select>` element.
|
|
76
113
|
* @returns {Promise<string>} A promise that resolves with the value of the selected option.
|
|
77
114
|
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
78
115
|
*/
|
|
79
|
-
getSelectedValueById
|
|
116
|
+
private getSelectedValueById;
|
|
80
117
|
}
|
|
81
118
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/select.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/select.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;OAEG;IACH,wBAKC;IAED;;;;;;;;;;OAUG;IACH,cALW,MAAM,SACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAoBzB;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,QACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CA8BzB;IAED;;;;;;;;;OASG;IACH,2BASC;IAED;;;;;;;;;OASG;IACH,6BAWC;IAED;;;;;;;;;OASG;IACH,2BAaC;IAED;;;;;;;;;OASG;IACH,6BAaC;IAED;;;;;;;;OAQG;IACH,qBAUC;IAED;;;;;;;;OAQG;IACH,sBAiBC;IAED;;;;;;;;OAQG;IACH,6BAUC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a selector string into a Selenium By locator.
|
|
3
|
+
* Supports prefix-based strategies:
|
|
4
|
+
* - 'id:value' -> By.id('value')
|
|
5
|
+
* - 'xpath:expression' -> By.xpath('expression')
|
|
6
|
+
* - 'name:value' -> By.name('value')
|
|
7
|
+
* - 'text:value' -> By.xpath('//*[normalize-space(text())="value"]')
|
|
8
|
+
* - 'link:value' -> By.xpath('//a[text()="value"]')
|
|
9
|
+
* - 'class:value' -> By.className('value')
|
|
10
|
+
* - No prefix -> By.css(selector) (CSS selector is the default)
|
|
11
|
+
*
|
|
12
|
+
* @param {string} selector - The selector string to parse.
|
|
13
|
+
* @returns {{ locator: By, description: string }} The parsed locator and a human-readable description.
|
|
14
|
+
*/
|
|
15
|
+
export function parseSelector(selector: string): {
|
|
16
|
+
locator: By;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
import { By } from 'selenium-webdriver';
|
|
20
|
+
//# sourceMappingURL=selectorParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectorParser.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/selectorParser.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wCAHW,MAAM,GACJ;IAAE,OAAO,EAAE,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CA2ChD;mBAzDkB,oBAAoB"}
|
|
@@ -5,70 +5,97 @@
|
|
|
5
5
|
* @hideconstructor
|
|
6
6
|
*/
|
|
7
7
|
export class Set {
|
|
8
|
-
constructor(browser: any);
|
|
8
|
+
constructor(browser: any, options: any);
|
|
9
9
|
/**
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
12
|
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private options;
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
private _waitForElement;
|
|
21
|
+
/**
|
|
22
|
+
* Sets a property on an element using a unified selector string.
|
|
23
|
+
* Supports CSS selectors (default), and prefix-based strategies:
|
|
24
|
+
* 'id:myId', 'xpath://input', 'name:field', 'class:input-field'.
|
|
25
|
+
*
|
|
26
|
+
* @async
|
|
27
|
+
* @param {string} selector - The selector string for the element.
|
|
28
|
+
* @param {string} value - The value to set.
|
|
29
|
+
* @param {string} [property='value'] - The property to set: 'value', 'innerText', or 'innerHTML'.
|
|
30
|
+
* @returns {Promise<void>} A promise that resolves when the property is set.
|
|
31
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
32
|
+
*/
|
|
33
|
+
run(selector: string, value: string, property?: string): Promise<void>;
|
|
13
34
|
/**
|
|
14
35
|
* Sets the innerHTML of an element using a CSS selector.
|
|
15
36
|
*
|
|
16
37
|
* @async
|
|
38
|
+
* @private
|
|
17
39
|
* @param {string} html - The HTML string to set as innerHTML.
|
|
18
40
|
* @param {string} selector - The CSS selector of the element.
|
|
19
41
|
* @returns {Promise<void>} A promise that resolves when the innerHTML is set.
|
|
20
42
|
* @throws {Error} Throws an error if the element is not found.
|
|
21
43
|
*/
|
|
22
|
-
innerHtml
|
|
44
|
+
private innerHtml;
|
|
23
45
|
/**
|
|
24
46
|
* Sets the innerHTML of an element using its ID.
|
|
25
47
|
*
|
|
26
48
|
* @async
|
|
49
|
+
* @private
|
|
27
50
|
* @param {string} html - The HTML string to set as innerHTML.
|
|
28
51
|
* @param {string} id - The ID of the element.
|
|
29
52
|
* @returns {Promise<void>} A promise that resolves when the innerHTML is set.
|
|
30
53
|
* @throws {Error} Throws an error if the element is not found.
|
|
31
54
|
*/
|
|
32
|
-
innerHtmlById
|
|
55
|
+
private innerHtmlById;
|
|
33
56
|
/**
|
|
34
57
|
* Sets the innerText of an element using a CSS selector.
|
|
35
58
|
*
|
|
36
59
|
* @async
|
|
60
|
+
* @private
|
|
37
61
|
* @param {string} text - The text to set as innerText.
|
|
38
62
|
* @param {string} selector - The CSS selector of the element.
|
|
39
63
|
* @returns {Promise<void>} A promise that resolves when the innerText is set.
|
|
40
64
|
* @throws {Error} Throws an error if the element is not found.
|
|
41
65
|
*/
|
|
42
|
-
innerText
|
|
66
|
+
private innerText;
|
|
43
67
|
/**
|
|
44
68
|
* Sets the innerText of an element using its ID.
|
|
45
69
|
*
|
|
46
70
|
* @async
|
|
71
|
+
* @private
|
|
47
72
|
* @param {string} text - The text to set as innerText.
|
|
48
73
|
* @param {string} id - The ID of the element.
|
|
49
74
|
* @returns {Promise<void>} A promise that resolves when the innerText is set.
|
|
50
75
|
* @throws {Error} Throws an error if the element is not found.
|
|
51
76
|
*/
|
|
52
|
-
innerTextById
|
|
77
|
+
private innerTextById;
|
|
53
78
|
/**
|
|
54
79
|
* Sets the value of an element using a CSS selector.
|
|
55
80
|
*
|
|
56
81
|
* @async
|
|
82
|
+
* @private
|
|
57
83
|
* @param {string} value - The value to set on the element.
|
|
58
84
|
* @param {string} selector - The CSS selector of the element.
|
|
59
85
|
* @returns {Promise<void>} A promise that resolves when the value is set.
|
|
60
86
|
* @throws {Error} Throws an error if the element is not found.
|
|
61
87
|
*/
|
|
62
|
-
value
|
|
88
|
+
private value;
|
|
63
89
|
/**
|
|
64
90
|
* Sets the value of an element using its ID.
|
|
65
91
|
*
|
|
66
92
|
* @async
|
|
93
|
+
* @private
|
|
67
94
|
* @param {string} value - The value to set on the element.
|
|
68
95
|
* @param {string} id - The ID of the element.
|
|
69
96
|
* @returns {Promise<void>} A promise that resolves when the value is set.
|
|
70
97
|
* @throws {Error} Throws an error if the element is not found.
|
|
71
98
|
*/
|
|
72
|
-
valueById
|
|
99
|
+
private valueById;
|
|
73
100
|
}
|
|
74
101
|
//# sourceMappingURL=set.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/set.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/set.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;OAEG;IACH,wBAKC;IAED;;;;;;;;;;;OAWG;IACH,cANW,MAAM,SACN,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAoBzB;IAED;;;;;;;;;OASG;IACH,kBAWC;IAED;;;;;;;;;OASG;IACH,sBASC;IAED;;;;;;;;;OASG;IACH,kBAWC;IAED;;;;;;;;;OASG;IACH,sBASC;IAED;;;;;;;;;OASG;IACH,cASC;IAED;;;;;;;;;OASG;IACH,kBASC;CACF"}
|