browsertime 19.3.1 → 21.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 +36 -0
- package/README.md +9 -8
- package/bin/browsertime.js +9 -3
- package/browserscripts/pageinfo/interactionToNextPaintInfo.js +170 -143
- package/browserscripts/timings/interactionToNextPaint.js +49 -137
- package/lib/chrome/webdriver/setupChromiumOptions.js +0 -9
- package/lib/core/engine/collector.js +11 -0
- package/lib/core/engine/command/actions.js +52 -0
- package/lib/core/engine/command/addText.js +48 -30
- package/lib/core/engine/command/android.js +43 -4
- package/lib/core/engine/command/cache.js +39 -2
- package/lib/core/engine/command/chromeDevToolsProtocol.js +51 -1
- package/lib/core/engine/command/chromeTrace.js +34 -0
- package/lib/core/engine/command/click.js +102 -52
- package/lib/core/engine/command/debug.js +19 -2
- package/lib/core/engine/command/element.js +66 -0
- package/lib/core/engine/command/geckoProfiler.js +41 -1
- package/lib/core/engine/command/javaScript.js +43 -20
- package/lib/core/engine/command/measure.js +151 -19
- package/lib/core/engine/command/meta.js +17 -0
- package/lib/core/engine/command/mouse/clickAndHold.js +56 -29
- package/lib/core/engine/command/mouse/contextClick.js +30 -11
- package/lib/core/engine/command/mouse/doubleClick.js +35 -11
- package/lib/core/engine/command/mouse/mouseMove.js +38 -16
- package/lib/core/engine/command/mouse/singleClick.js +187 -12
- package/lib/core/engine/command/navigation.js +31 -3
- package/lib/core/engine/command/screenshot.js +33 -0
- package/lib/core/engine/command/scroll.js +35 -13
- package/lib/core/engine/command/select.js +55 -36
- package/lib/core/engine/command/set.js +51 -36
- package/lib/core/engine/command/stopWatch.js +30 -9
- package/lib/core/engine/command/switch.js +49 -11
- package/lib/core/engine/command/wait.js +50 -25
- package/lib/core/engine/commands.js +267 -0
- package/lib/core/engine/context.js +81 -0
- package/lib/core/engine/index.js +6 -2
- package/lib/core/engine/iteration.js +20 -102
- package/lib/firefox/geckoProfiler.js +49 -1
- package/lib/firefox/webdriver/builder.js +35 -12
- package/lib/firefox/webdriver/firefox.js +1 -1
- package/lib/support/cli.js +35 -15
- package/lib/support/engineUtils.js +13 -1
- package/lib/support/statistics.js +11 -1
- package/lib/support/userTiming.js +2 -2
- package/package.json +17 -8
- package/types/android/index.d.ts +70 -0
- package/types/android/index.d.ts.map +1 -0
- package/types/chrome/parseCpuTrace.d.ts +21 -0
- package/types/chrome/parseCpuTrace.d.ts.map +1 -0
- package/types/chrome/traceCategoriesParser.d.ts +2 -0
- package/types/chrome/traceCategoriesParser.d.ts.map +1 -0
- package/types/chrome/webdriver/traceUtilities.d.ts +8 -0
- package/types/chrome/webdriver/traceUtilities.d.ts.map +1 -0
- package/types/core/engine/command/action.d.ts +73 -0
- package/types/core/engine/command/action.d.ts.map +1 -0
- package/types/core/engine/command/actions.d.ts +38 -0
- package/types/core/engine/command/actions.d.ts.map +1 -0
- package/types/core/engine/command/addText.d.ts +68 -0
- package/types/core/engine/command/addText.d.ts.map +1 -0
- package/types/core/engine/command/android.d.ts +39 -0
- package/types/core/engine/command/android.d.ts.map +1 -0
- package/types/core/engine/command/cache.d.ts +53 -0
- package/types/core/engine/command/cache.d.ts.map +1 -0
- package/types/core/engine/command/chromeDevToolsProtocol.d.ts +61 -0
- package/types/core/engine/command/chromeDevToolsProtocol.d.ts.map +1 -0
- package/types/core/engine/command/chromeTrace.d.ts +45 -0
- package/types/core/engine/command/chromeTrace.d.ts.map +1 -0
- package/types/core/engine/command/click.d.ts +151 -0
- package/types/core/engine/command/click.d.ts.map +1 -0
- package/types/core/engine/command/debug.d.ts +28 -0
- package/types/core/engine/command/debug.d.ts.map +1 -0
- package/types/core/engine/command/element.d.ts +49 -0
- package/types/core/engine/command/element.d.ts.map +1 -0
- package/types/core/engine/command/geckoProfiler.d.ts +46 -0
- package/types/core/engine/command/geckoProfiler.d.ts.map +1 -0
- package/types/core/engine/command/javaScript.d.ts +63 -0
- package/types/core/engine/command/javaScript.d.ts.map +1 -0
- package/types/core/engine/command/measure.d.ts +194 -0
- package/types/core/engine/command/measure.d.ts.map +1 -0
- package/types/core/engine/command/meta.d.ts +23 -0
- package/types/core/engine/command/meta.d.ts.map +1 -0
- package/types/core/engine/command/mouse/clickAndHold.d.ts +82 -0
- package/types/core/engine/command/mouse/clickAndHold.d.ts.map +1 -0
- package/types/core/engine/command/mouse/contextClick.d.ts +44 -0
- package/types/core/engine/command/mouse/contextClick.d.ts.map +1 -0
- package/types/core/engine/command/mouse/doubleClick.d.ts +51 -0
- package/types/core/engine/command/mouse/doubleClick.d.ts.map +1 -0
- package/types/core/engine/command/mouse/index.d.ts +6 -0
- package/types/core/engine/command/mouse/index.d.ts.map +1 -0
- package/types/core/engine/command/mouse/mouseMove.d.ts +56 -0
- package/types/core/engine/command/mouse/mouseMove.d.ts.map +1 -0
- package/types/core/engine/command/mouse/singleClick.d.ts +115 -0
- package/types/core/engine/command/mouse/singleClick.d.ts.map +1 -0
- package/types/core/engine/command/navigation.d.ts +45 -0
- package/types/core/engine/command/navigation.d.ts.map +1 -0
- package/types/core/engine/command/screenshot.d.ts +33 -0
- package/types/core/engine/command/screenshot.d.ts.map +1 -0
- package/types/core/engine/command/scroll.d.ts +52 -0
- package/types/core/engine/command/scroll.d.ts.map +1 -0
- package/types/core/engine/command/select.d.ts +81 -0
- package/types/core/engine/command/select.d.ts.map +1 -0
- package/types/core/engine/command/set.d.ts +74 -0
- package/types/core/engine/command/set.d.ts.map +1 -0
- package/types/core/engine/command/stopWatch.d.ts +49 -0
- package/types/core/engine/command/stopWatch.d.ts.map +1 -0
- package/types/core/engine/command/switch.d.ts +77 -0
- package/types/core/engine/command/switch.d.ts.map +1 -0
- package/types/core/engine/command/util/lcpHighlightScript.d.ts +2 -0
- package/types/core/engine/command/util/lcpHighlightScript.d.ts.map +1 -0
- package/types/core/engine/command/util/lsHighlightScript.d.ts +2 -0
- package/types/core/engine/command/util/lsHighlightScript.d.ts.map +1 -0
- package/types/core/engine/command/wait.d.ts +74 -0
- package/types/core/engine/command/wait.d.ts.map +1 -0
- package/types/core/engine/commands.d.ts +161 -0
- package/types/core/engine/commands.d.ts.map +1 -0
- package/types/core/engine/context.d.ts +87 -0
- package/types/core/engine/context.d.ts.map +1 -0
- package/types/firefox/geckoProfiler.d.ts +11 -0
- package/types/firefox/geckoProfiler.d.ts.map +1 -0
- package/types/firefox/settings/geckoProfilerDefaults.d.ts +8 -0
- package/types/firefox/settings/geckoProfilerDefaults.d.ts.map +1 -0
- package/types/scripting.d.ts +2 -0
- package/types/support/engineUtils.d.ts +5 -0
- package/types/support/engineUtils.d.ts.map +1 -0
- package/types/support/errors.d.ts +15 -0
- package/types/support/errors.d.ts.map +1 -0
- package/types/support/fileUtil.d.ts +10 -0
- package/types/support/fileUtil.d.ts.map +1 -0
- package/types/support/filters.d.ts +7 -0
- package/types/support/filters.d.ts.map +1 -0
- package/types/support/getViewPort.d.ts +2 -0
- package/types/support/getViewPort.d.ts.map +1 -0
- package/types/support/pathToFolder.d.ts +2 -0
- package/types/support/pathToFolder.d.ts.map +1 -0
- package/types/support/storageManager.d.ts +17 -0
- package/types/support/storageManager.d.ts.map +1 -0
- package/types/support/tcpdump.d.ts +10 -0
- package/types/support/tcpdump.d.ts.map +1 -0
- package/types/support/userTiming.d.ts +2 -0
- package/types/support/userTiming.d.ts.map +1 -0
- package/types/support/util.d.ts +6 -0
- package/types/support/util.d.ts.map +1 -0
- package/types/video/defaults.d.ts +7 -0
- package/types/video/defaults.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/addTextToVideo.d.ts +2 -0
- package/types/video/postprocessing/finetune/addTextToVideo.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/convertFps.d.ts +2 -0
- package/types/video/postprocessing/finetune/convertFps.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/getFont.d.ts +2 -0
- package/types/video/postprocessing/finetune/getFont.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/getTimingMetrics.d.ts +2 -0
- package/types/video/postprocessing/finetune/getTimingMetrics.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/index.d.ts +2 -0
- package/types/video/postprocessing/finetune/index.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/removeOrange.d.ts +2 -0
- package/types/video/postprocessing/finetune/removeOrange.d.ts.map +1 -0
- package/types/video/postprocessing/visualmetrics/extraMetrics.d.ts +5 -0
- package/types/video/postprocessing/visualmetrics/extraMetrics.d.ts.map +1 -0
- package/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts +5 -0
- package/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts.map +1 -0
- package/types/video/postprocessing/visualmetrics/visualMetrics.d.ts +3 -0
- package/types/video/postprocessing/visualmetrics/visualMetrics.d.ts.map +1 -0
- package/types/video/screenRecording/android/recorder.d.ts +11 -0
- package/types/video/screenRecording/android/recorder.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/convert.d.ts +2 -0
- package/types/video/screenRecording/desktop/convert.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/desktopRecorder.d.ts +28 -0
- package/types/video/screenRecording/desktop/desktopRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/ffmpegRecorder.d.ts +17 -0
- package/types/video/screenRecording/desktop/ffmpegRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts +2 -0
- package/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/osx/getScreen.d.ts +2 -0
- package/types/video/screenRecording/desktop/osx/getScreen.d.ts.map +1 -0
- package/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts +13 -0
- package/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/ios/convertToMp4.d.ts +2 -0
- package/types/video/screenRecording/ios/convertToMp4.d.ts.map +1 -0
- package/types/video/screenRecording/ios/iosRecorder.d.ts +14 -0
- package/types/video/screenRecording/ios/iosRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/iosSimulator/convertToMp4.d.ts +2 -0
- package/types/video/screenRecording/iosSimulator/convertToMp4.d.ts.map +1 -0
- package/types/video/screenRecording/iosSimulator/recorder.d.ts +9 -0
- package/types/video/screenRecording/iosSimulator/recorder.d.ts.map +1 -0
- package/types/video/screenRecording/recorder.d.ts +7 -0
- package/types/video/screenRecording/recorder.d.ts.map +1 -0
- package/types/video/screenRecording/setOrangeBackground.d.ts +2 -0
- package/types/video/screenRecording/setOrangeBackground.d.ts.map +1 -0
- package/types/video/video.d.ts +41 -0
- package/types/video/video.d.ts.map +1 -0
- package/CONTRIBUTING.md +0 -24
- package/browsersupport/firefox-profile/cert9.db +0 -0
- package/browsersupport/firefox-profile/chrome/userChrome.css +0 -4
- package/browsersupport/firefox-profile/key4.db +0 -0
- package/docs/examples/README.md +0 -9
- package/docs/examples/advance.md +0 -12
- package/docs/examples/android.md +0 -54
- package/docs/examples/basic.md +0 -36
- package/docs/examples/chrome.md +0 -28
- package/docs/examples/firefox.md +0 -10
- package/docs/issues.md +0 -18
- package/docs/new-style-script-objects.md +0 -38
- package/docs/sequence-diagrams/loadAndWait.wsd +0 -24
- package/docs/sequence-diagrams/run.wsd +0 -24
- package/vendor/mac/x86/qvh +0 -0
- package/visualmetrics/__init__.py +0 -1
- package/visualmetrics/test_data/ms_000000.png +0 -0
- package/visualmetrics/test_data/ms_000920.png +0 -0
- package/visualmetrics/test_data/ms_001000.png +0 -0
- package/visualmetrics/test_data/ms_001080.png +0 -0
- package/visualmetrics/test_data/ms_001200.png +0 -0
- package/visualmetrics/test_data/ms_001240.png +0 -0
- package/visualmetrics/test_data/ms_001280.png +0 -0
- package/visualmetrics/test_data/ms_001360.png +0 -0
- package/visualmetrics/test_data/ms_001400.png +0 -0
- package/visualmetrics/test_data/ms_001520.png +0 -0
- package/visualmetrics/test_data/ms_002040.png +0 -0
- package/visualmetrics/test_data/ms_002600.png +0 -0
- package/visualmetrics/test_data/ms_003160.png +0 -0
- package/visualmetrics/test_data/ms_003720.png +0 -0
- package/visualmetrics/test_data/ms_004280.png +0 -0
- package/visualmetrics/test_data/ms_004880.png +0 -0
- package/visualmetrics/test_data/ms_005440.png +0 -0
- package/visualmetrics/test_data/ms_006000.png +0 -0
- package/visualmetrics/test_visualmetrics.py +0 -34
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Take a screenshot. The screenshot will be stored to disk,
|
|
3
|
+
* named by the name provided to the take function.
|
|
4
|
+
*
|
|
5
|
+
* @class
|
|
6
|
+
* @hideconstructor
|
|
7
|
+
*/
|
|
8
|
+
export class Screenshot {
|
|
9
|
+
constructor(screenshotManager: any, browser: any, index: any);
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
private screenshotManager;
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
private browser;
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
private index;
|
|
22
|
+
/**
|
|
23
|
+
* Takes a screenshot and saves it using the screenshot manager.
|
|
24
|
+
*
|
|
25
|
+
* @async
|
|
26
|
+
* @example async commands.screenshot.take('my_startpage');
|
|
27
|
+
* @param {string} name The name to assign to the screenshot file.
|
|
28
|
+
* @throws {Error} Throws an error if the name parameter is not provided.
|
|
29
|
+
* @returns {Promise<Object>} A promise that resolves with the screenshot details.
|
|
30
|
+
*/
|
|
31
|
+
take(name: string): Promise<any>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=screenshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/screenshot.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH;IACE,8DAaC;IAZC;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,cAAkB;IAGpB;;;;;;;;OAQG;IAEH,WALW,MAAM,GAEJ,YAAe,CAa3B;CACF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides functionality to control page scrolling in the browser.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class Scroll {
|
|
8
|
+
constructor(browser: any, options: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private options;
|
|
17
|
+
/**
|
|
18
|
+
* Scrolls the page by the specified number of pixels.
|
|
19
|
+
*
|
|
20
|
+
* @async
|
|
21
|
+
* @param {number} Xpixels - The number of pixels to scroll horizontally.
|
|
22
|
+
* @param {number} Ypixels - The number of pixels to scroll vertically.
|
|
23
|
+
* @returns {Promise<void>} A promise that resolves when the scrolling action is completed.
|
|
24
|
+
*/
|
|
25
|
+
byPixels(Xpixels: number, Ypixels: number): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Scrolls the page by the specified number of lines. This method is only supported in Firefox.
|
|
28
|
+
*
|
|
29
|
+
* @async
|
|
30
|
+
* @param {number} lines - The number of lines to scroll.
|
|
31
|
+
* @returns {Promise<void>} A promise that resolves when the scrolling action is completed.
|
|
32
|
+
* @throws {Error} Throws an error if not used in Firefox.
|
|
33
|
+
*/
|
|
34
|
+
byLines(lines: number): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Scrolls the page by the specified number of pages.
|
|
37
|
+
*
|
|
38
|
+
* @async
|
|
39
|
+
* @param {number} pages - The number of pages to scroll.
|
|
40
|
+
* @returns {Promise<void>} A promise that resolves when the scrolling action is completed.
|
|
41
|
+
*/
|
|
42
|
+
byPages(pages: number): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Scrolls to the bottom of the page, scrolling page by page with a delay between each scroll.
|
|
45
|
+
*
|
|
46
|
+
* @async
|
|
47
|
+
* @param {number} [delayTime=250] - The delay time in milliseconds between each scroll.
|
|
48
|
+
* @returns {Promise<void>} A promise that resolves when the scrolling to the bottom is completed.
|
|
49
|
+
*/
|
|
50
|
+
toBottom(delayTime?: number): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/scroll.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;OAOG;IACH,kBAJW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAKzB;IAED;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;OAMG;IACH,eAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;OAMG;IACH,qBAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;CACF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides functionality to interact with `<select>` elements on a web page.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class Select {
|
|
8
|
+
constructor(browser: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* Selects an option in a `<select>` element by its ID and the value of the option.
|
|
15
|
+
*
|
|
16
|
+
* @async
|
|
17
|
+
* @param {string} selectId - The ID of the `<select>` element.
|
|
18
|
+
* @param {string} value - The value of the option to select.
|
|
19
|
+
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
20
|
+
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
21
|
+
*/
|
|
22
|
+
selectByIdAndValue(selectId: string, value: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Selects an option in a `<select>` element by its name and the value of the option.
|
|
25
|
+
*
|
|
26
|
+
* @async
|
|
27
|
+
* @param {string} selectName - The name of 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
|
+
selectByNameAndValue(selectName: string, value: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Selects an option in a `<select>` element by its ID and the index of the option.
|
|
35
|
+
*
|
|
36
|
+
* @async
|
|
37
|
+
* @param {string} selectId - The ID of the `<select>` element.
|
|
38
|
+
* @param {number} index - The index 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 is not found.
|
|
41
|
+
*/
|
|
42
|
+
selectByIdAndIndex(selectId: string, index: number): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Selects an option in a `<select>` element by its name and the index of the option.
|
|
45
|
+
*
|
|
46
|
+
* @async
|
|
47
|
+
* @param {string} selectName - The name of the `<select>` element.
|
|
48
|
+
* @param {number} index - The index of the option to select.
|
|
49
|
+
* @returns {Promise<void>} A promise that resolves when the option is selected.
|
|
50
|
+
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
51
|
+
*/
|
|
52
|
+
selectByNameAndIndex(selectName: string, index: number): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Deselects all options in a `<select>` element by its ID.
|
|
55
|
+
*
|
|
56
|
+
* @async
|
|
57
|
+
* @param {string} selectId - The ID of the `<select>` element.
|
|
58
|
+
* @returns {Promise<void>} A promise that resolves when all options are deselected.
|
|
59
|
+
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
60
|
+
*/
|
|
61
|
+
deselectById(selectId: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves all option values in a `<select>` element by its ID.
|
|
64
|
+
*
|
|
65
|
+
* @async
|
|
66
|
+
* @param {string} selectId - The ID of the `<select>` element.
|
|
67
|
+
* @returns {Promise<string[]>} A promise that resolves with an array of the values of the options.
|
|
68
|
+
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
69
|
+
*/
|
|
70
|
+
getValuesById(selectId: string): Promise<string[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves the value of the selected option in a `<select>` element by its ID.
|
|
73
|
+
*
|
|
74
|
+
* @async
|
|
75
|
+
* @param {string} selectId - The ID of the `<select>` element.
|
|
76
|
+
* @returns {Promise<string>} A promise that resolves with the value of the selected option.
|
|
77
|
+
* @throws {Error} Throws an error if the `<select>` element is not found.
|
|
78
|
+
*/
|
|
79
|
+
getSelectedValueById(selectId: string): Promise<string>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/select.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,6BALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,iCALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,6BALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;;OAQG;IACH,iCALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;OAOG;IACH,uBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,MAAM,EAAE,CAAC,CAoB7B;IAED;;;;;;;OAOG;IACH,+BAJW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAa3B;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides functionality to set properties like innerHTML, innerText, and value on elements in a web page.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class Set {
|
|
8
|
+
constructor(browser: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the innerHTML of an element using a CSS selector.
|
|
15
|
+
*
|
|
16
|
+
* @async
|
|
17
|
+
* @param {string} html - The HTML string to set as innerHTML.
|
|
18
|
+
* @param {string} selector - The CSS selector of the element.
|
|
19
|
+
* @returns {Promise<void>} A promise that resolves when the innerHTML is set.
|
|
20
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
21
|
+
*/
|
|
22
|
+
innerHtml(html: string, selector: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the innerHTML of an element using its ID.
|
|
25
|
+
*
|
|
26
|
+
* @async
|
|
27
|
+
* @param {string} html - The HTML string to set as innerHTML.
|
|
28
|
+
* @param {string} id - The ID of the element.
|
|
29
|
+
* @returns {Promise<void>} A promise that resolves when the innerHTML is set.
|
|
30
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
31
|
+
*/
|
|
32
|
+
innerHtmlById(html: string, id: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the innerText of an element using a CSS selector.
|
|
35
|
+
*
|
|
36
|
+
* @async
|
|
37
|
+
* @param {string} text - The text to set as innerText.
|
|
38
|
+
* @param {string} selector - The CSS selector of the element.
|
|
39
|
+
* @returns {Promise<void>} A promise that resolves when the innerText is set.
|
|
40
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
41
|
+
*/
|
|
42
|
+
innerText(text: string, selector: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the innerText of an element using its ID.
|
|
45
|
+
*
|
|
46
|
+
* @async
|
|
47
|
+
* @param {string} text - The text to set as innerText.
|
|
48
|
+
* @param {string} id - The ID of the element.
|
|
49
|
+
* @returns {Promise<void>} A promise that resolves when the innerText is set.
|
|
50
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
51
|
+
*/
|
|
52
|
+
innerTextById(text: string, id: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Sets the value of an element using a CSS selector.
|
|
55
|
+
*
|
|
56
|
+
* @async
|
|
57
|
+
* @param {string} value - The value to set on the element.
|
|
58
|
+
* @param {string} selector - The CSS selector of the element.
|
|
59
|
+
* @returns {Promise<void>} A promise that resolves when the value is set.
|
|
60
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
61
|
+
*/
|
|
62
|
+
value(value: string, selector: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Sets the value of an element using its ID.
|
|
65
|
+
*
|
|
66
|
+
* @async
|
|
67
|
+
* @param {string} value - The value to set on the element.
|
|
68
|
+
* @param {string} id - The ID of the element.
|
|
69
|
+
* @returns {Promise<void>} A promise that resolves when the value is set.
|
|
70
|
+
* @throws {Error} Throws an error if the element is not found.
|
|
71
|
+
*/
|
|
72
|
+
valueById(value: string, id: string): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/set.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,gBALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,gBALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,aALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,iBALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stopwatch utility for measuring time intervals.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class StopWatch {
|
|
8
|
+
constructor(name: any, measure: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private name;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private measure;
|
|
17
|
+
/**
|
|
18
|
+
* Starts the stopwatch.
|
|
19
|
+
*/
|
|
20
|
+
start(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Stops the stopwatch and automatically adds the measured time to the
|
|
23
|
+
* last measured page. Logs an error if no page has been measured.
|
|
24
|
+
* @returns {number} The measured time in milliseconds.
|
|
25
|
+
*/
|
|
26
|
+
stopAndAdd(): number;
|
|
27
|
+
/**
|
|
28
|
+
* Stops the stopwatch.
|
|
29
|
+
* @returns {number} The measured time in milliseconds.
|
|
30
|
+
*/
|
|
31
|
+
stop(): number;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the name of the stopwatch.
|
|
34
|
+
* @returns {string} The name of the stopwatch.
|
|
35
|
+
*/
|
|
36
|
+
getName(): string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
export class Watch {
|
|
42
|
+
constructor(measure: any);
|
|
43
|
+
measure: any;
|
|
44
|
+
/**
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
private get;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=stopWatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopWatch.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/stopWatch.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH;IACE,qCAaC;IAZC;;OAEG;IACH,aAAgB;IAChB;;OAEG;IACH,gBAAsB;IAOxB;;OAEG;IACH,cAEC;IAED;;;;OAIG;IACH,cAFa,MAAM,CAOlB;IAED;;;OAGG;IACH,QAFa,MAAM,CAMlB;IAED;;;OAGG;IACH,WAFa,MAAM,CAIlB;CACF;AAED;;GAEG;AACH;IACE,0BAEC;IADC,aAAsB;IAGxB;;OAEG;IACH,YAEC;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides functionality to switch between frames, windows, and tabs in the browser.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class Switch {
|
|
8
|
+
constructor(browser: any, pageCompleteCheck: any, navigate: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private pageCompleteCheck;
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
private navigate;
|
|
21
|
+
/**
|
|
22
|
+
* Switches to a frame identified by its ID.
|
|
23
|
+
*
|
|
24
|
+
* @async
|
|
25
|
+
* @param {string|number} id - The ID of the frame.
|
|
26
|
+
* @throws {Error} Throws an error if switching to the frame fails.
|
|
27
|
+
*/
|
|
28
|
+
toFrame(id: string | number): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Switches to a frame identified by an XPath.
|
|
31
|
+
*
|
|
32
|
+
* @async
|
|
33
|
+
* @param {string} xpath - The XPath of the frame element.
|
|
34
|
+
* @throws {Error} Throws an error if the frame is not found or switching fails.
|
|
35
|
+
*/
|
|
36
|
+
toFrameByXpath(xpath: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Switches to a frame identified by a CSS selector.
|
|
39
|
+
*
|
|
40
|
+
* @async
|
|
41
|
+
* @param {string} selector - The CSS selector of the frame element.
|
|
42
|
+
* @throws {Error} Throws an error if the frame is not found or switching fails.
|
|
43
|
+
*/
|
|
44
|
+
toFrameBySelector(selector: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Switches to a window identified by its name.
|
|
47
|
+
*
|
|
48
|
+
* @async
|
|
49
|
+
* @param {string} name - The name of the window.
|
|
50
|
+
* @throws {Error} Throws an error if switching to the window fails.
|
|
51
|
+
*/
|
|
52
|
+
toWindow(name: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Switches to the parent frame of the current frame.
|
|
55
|
+
*
|
|
56
|
+
* @async
|
|
57
|
+
* @throws {Error} Throws an error if switching to the parent frame fails.
|
|
58
|
+
*/
|
|
59
|
+
toParentFrame(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Opens a new tab and optionally navigates to a URL.
|
|
62
|
+
*
|
|
63
|
+
* @async
|
|
64
|
+
* @param {string} [url] - Optional URL to navigate to in the new tab.
|
|
65
|
+
* @throws {Error} Throws an error if opening a new tab fails.
|
|
66
|
+
*/
|
|
67
|
+
toNewTab(url?: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Opens a new window and optionally navigates to a URL.
|
|
70
|
+
*
|
|
71
|
+
* @async
|
|
72
|
+
* @param {string} [url] - Optional URL to navigate to in the new window.
|
|
73
|
+
* @throws {Error} Throws an error if opening a new window fails.
|
|
74
|
+
*/
|
|
75
|
+
toNewWindow(url?: string): Promise<void>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/switch.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH;IACE,iEAaC;IAZC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,iBAAwB;IAG1B;;;;;;OAMG;IACH,YAHW,MAAM,GAAC,MAAM,iBAYvB;IAED;;;;;;OAMG;IACH,sBAHW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,4BAHW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,eAHW,MAAM,iBAYhB;IAED;;;;;OAKG;IACH,+BASC;IAED;;;;;;OAMG;IACH,eAHW,MAAM,iBAiBhB;IAED;;;;;;OAMG;IACH,kBAHW,MAAM,iBAiBhB;CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const lcpHighlightScript: "\nreturn (function(color) {\n const observer = new PerformanceObserver(list => {});\n observer.observe({ type: 'largest-contentful-paint', buffered: true });\n const entries = observer.takeRecords();\n if (entries.length > 0) {\n const largestEntry = entries[entries.length - 1];\n // There could be cases where we do not get an element\n if (largestEntry.element) {\n const clientRect = largestEntry.element.getBoundingClientRect();\n\n const canvas = document.createElement('canvas'); //Create a canvas element\n canvas.style.width='100%';\n canvas.style.height='100%';\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvas.style.position='absolute';\n canvas.style.left=0;\n canvas.style.top=0;\n canvas.style.zIndex=2147483646;\n canvas.id = \"browsertime-lcp\";\n document.body.appendChild(canvas); \n const context = canvas.getContext('2d');\n context.rect(Math.max(0,clientRect.x), Math.max(0,clientRect.y), Math.min(clientRect.width, window.innerWidth - clientRect.x) , Math.min(clientRect.height, window.innerHeight-clientRect.y));\n context.lineWidth = \"6\";\n context.strokeStyle = color;\n context.stroke();\n\n context.fillStyle = color;\n context.globalAlpha = 0.1;\n context.rect(Math.max(0,clientRect.x), Math.max(0,clientRect.y), Math.min(clientRect.width, window.innerWidth - clientRect.x) , Math.min(clientRect.height, window.innerHeight-clientRect.y));\n context.fill();\n return '';\n } else {\n return 'No element attached to the entry in largest-contentful-paint';\n }\n } else {\n return 'Chrome did not report any largest-contentful-paint';\n }\n})(arguments[arguments.length - 1]);\n";
|
|
2
|
+
//# sourceMappingURL=lcpHighlightScript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lcpHighlightScript.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/util/lcpHighlightScript.js"],"names":[],"mappings":"AAAA,o8DAwCE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const clsHighlightScript: "\n(function(options) {\n const rectColor = options.color;\n const limit = options.limit;\n const observer = new PerformanceObserver(list => {});\n observer.observe({ type: 'layout-shift', buffered: true });\n const entries = observer.takeRecords();\n if (entries.length > 0) {\n const canvas = document.createElement('canvas'); \n canvas.style.width='100%';\n canvas.style.height='100%';\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvas.style.position='absolute';\n canvas.style.left=0;\n canvas.style.top=0;\n canvas.style.zIndex=2147483646;\n canvas.id = \"browsertime-ls\";\n document.body.appendChild(canvas);\n\n function paintRectangle(context, clientRect, color) { \n context.fillStyle = color;\n context.globalAlpha = 0.03;\n context.rect(Math.max(0,clientRect.x), Math.max(0,clientRect.y), Math.min(clientRect.width, window.innerWidth - clientRect.x) , Math.min(clientRect.height, window.innerHeight-clientRect.y));\n context.fill();\n\n\n context.strokeStyle = color;\n context.globalAlpha = 1.0;\n context.rect(Math.max(0,clientRect.x), Math.max(0,clientRect.y), Math.min(clientRect.width, window.innerWidth - clientRect.x) , Math.min(clientRect.height, window.innerHeight-clientRect.y));\n context.stroke();\n }\n\n let maxSessionGap1sLimit5s = {}; \n let max = 0; \n let current = [];\n let curr = 0; \n let firstTs = Number.NEGATIVE_INFINITY;\n let prevTs = Number.NEGATIVE_INFINITY;\n\n for (let entry of entries) {\n if (entry.hadRecentInput || entry.value <= limit) {\n continue;\n } \n if (entry.startTime - firstTs > 5000 || entry.startTime - prevTs > 1000) {\n firstTs = entry.startTime;\n curr = 0;\n maxSessionGap1sLimit5s[max] = [...current];\n current = []; \n }\n prevTs = entry.startTime;\n curr += entry.value;\n max = Math.max(max, curr);\n current.push(entry);\n }\n\n for (let entry of maxSessionGap1sLimit5s[max] || current) {\n for (let source of entry.sources) {\n if (source.previousRect && source.currentRect) {\n const context = canvas.getContext('2d');\n \n // paintRectangle(context, source.previousRect, \"yellow\", false);\n paintRectangle(context, source.currentRect, rectColor);\n \n context.font = \"bolder 24px Arial\";\n context.fillStyle = \"black\";\n context.fillText(entry.value.toFixed(4), Math.max(0,source.currentRect.x) + 24,Math.max(0,source.currentRect.y) + 24);\n\n }\n }\n }\n }\n})(arguments[arguments.length - 1]);\n";
|
|
2
|
+
//# sourceMappingURL=lsHighlightScript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsHighlightScript.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/util/lsHighlightScript.js"],"names":[],"mappings":"AAAA,0+FAyEE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides functionality to wait for different conditions in the browser.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class Wait {
|
|
8
|
+
constructor(browser: any, pageCompleteCheck: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private browser;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private pageCompleteCheck;
|
|
17
|
+
/**
|
|
18
|
+
* Waits for an element with a specific ID to appear within a maximum time.
|
|
19
|
+
*
|
|
20
|
+
* @async
|
|
21
|
+
* @param {string} id - The ID of the element to wait for.
|
|
22
|
+
* @param {number} maxTime - Maximum time to wait in milliseconds.
|
|
23
|
+
* @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
|
|
24
|
+
* @throws {Error} Throws an error if the element is not found within the specified time.
|
|
25
|
+
*/
|
|
26
|
+
byId(id: string, maxTime: number): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Waits for an element located by XPath to appear within a maximum time.
|
|
29
|
+
*
|
|
30
|
+
* @async
|
|
31
|
+
* @param {string} xpath - The XPath of the element to wait for.
|
|
32
|
+
* @param {number} maxTime - Maximum time to wait in milliseconds.
|
|
33
|
+
* @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
|
|
34
|
+
* @throws {Error} Throws an error if the element is not found within the specified time.
|
|
35
|
+
*/
|
|
36
|
+
byXpath(xpath: string, maxTime: number): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Waits for an element located by a CSS selector to appear within a maximum time.
|
|
39
|
+
*
|
|
40
|
+
* @async
|
|
41
|
+
* @param {string} selector - The CSS selector of the element to wait for.
|
|
42
|
+
* @param {number} maxTime - Maximum time to wait in milliseconds.
|
|
43
|
+
* @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
|
|
44
|
+
* @throws {Error} Throws an error if the element is not found within the specified time.
|
|
45
|
+
*/
|
|
46
|
+
bySelector(selector: string, maxTime: number): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Waits for a specified amount of time.
|
|
49
|
+
*
|
|
50
|
+
* @async
|
|
51
|
+
* @example async commands.wait.byTime(1000);
|
|
52
|
+
* @param {number} ms - The time in milliseconds to wait.
|
|
53
|
+
* @returns {Promise<void>} A promise that resolves when the specified time has elapsed.
|
|
54
|
+
*/
|
|
55
|
+
byTime(ms: number): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Waits for the page to finish loading.
|
|
58
|
+
* @async
|
|
59
|
+
* @example async commands.wait.byPageToComplete();
|
|
60
|
+
* @returns {Promise<void>} A promise that resolves when the page complete check has finished.
|
|
61
|
+
*/
|
|
62
|
+
byPageToComplete(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Waits for a JavaScript condition to return a truthy value within a maximum time.
|
|
65
|
+
*
|
|
66
|
+
* @async
|
|
67
|
+
* @param {string} jsExpression - The JavaScript expression to evaluate.
|
|
68
|
+
* @param {number} maxTime - Maximum time to wait in milliseconds.
|
|
69
|
+
* @returns {Promise<void>} A promise that resolves when the condition becomes truthy or the time times out.
|
|
70
|
+
* @throws {Error} Throws an error if the condition is not met within the specified time.
|
|
71
|
+
*/
|
|
72
|
+
byCondition(jsExpression: string, maxTime: number): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=wait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,SALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,eALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAuBzB;IAED;;;;;;;OAOG;IACH,WAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;OAKG;IACH,oBAFa,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;CACF"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the set of commands available in a Browsertime script.
|
|
3
|
+
* @hideconstructor
|
|
4
|
+
*/
|
|
5
|
+
export class Commands {
|
|
6
|
+
constructor(browser: any, engineDelegate: any, index: any, result: any, storageManager: any, pageCompleteCheck: any, extensionServer: any, context: any, videos: any, screenshotManager: any, scriptsByCategory: any, asyncScriptsByCategory: any, postURLScripts: any, options: any);
|
|
7
|
+
profiler: GeckoProfilerCommand;
|
|
8
|
+
/**
|
|
9
|
+
* Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.
|
|
10
|
+
* @type {ChromeTrace}
|
|
11
|
+
*/
|
|
12
|
+
trace: ChromeTrace;
|
|
13
|
+
/**
|
|
14
|
+
* Provides functionality to perform click actions on elements in a web page using various selectors.
|
|
15
|
+
* @type {Click}
|
|
16
|
+
*/
|
|
17
|
+
click: Click;
|
|
18
|
+
/**
|
|
19
|
+
* Provides functionality to control page scrolling in the browser.
|
|
20
|
+
* @type {Scroll}
|
|
21
|
+
*/
|
|
22
|
+
scroll: Scroll;
|
|
23
|
+
/**
|
|
24
|
+
* Provides functionality to add text to elements on a web page using various selectors.
|
|
25
|
+
* @type {AddText}
|
|
26
|
+
*/
|
|
27
|
+
addText: AddText;
|
|
28
|
+
/**
|
|
29
|
+
* Provides functionality to wait for different conditions in the browser.
|
|
30
|
+
* @type {Wait}
|
|
31
|
+
*/
|
|
32
|
+
wait: Wait;
|
|
33
|
+
/**
|
|
34
|
+
* Provides functionality for measuring a navigation.
|
|
35
|
+
* @type {Measure}
|
|
36
|
+
*/
|
|
37
|
+
measure: Measure;
|
|
38
|
+
/**
|
|
39
|
+
* Navigates to a specified URL and handles additional setup for a page visit.
|
|
40
|
+
* @async
|
|
41
|
+
* @example await commands.navigate('https://www.example.org');
|
|
42
|
+
* @type {Function}
|
|
43
|
+
* @param {string} url - The URL to navigate to.
|
|
44
|
+
* @throws {Error} Throws an error if navigation or setup fails.
|
|
45
|
+
* @returns {Promise<void>} A promise that resolves when the navigation and setup are
|
|
46
|
+
*/
|
|
47
|
+
navigate: Function;
|
|
48
|
+
/**
|
|
49
|
+
* Provides functionality to control browser navigation such as back, forward, and refresh actions.
|
|
50
|
+
* @type {Navigation}
|
|
51
|
+
*/
|
|
52
|
+
navigation: Navigation;
|
|
53
|
+
/**
|
|
54
|
+
* Add a text that will be an error attached to the current page.
|
|
55
|
+
* @example await commands.error('My error message');
|
|
56
|
+
* @param {string} message - The error message.
|
|
57
|
+
* @type {Function}
|
|
58
|
+
*/
|
|
59
|
+
error: Function;
|
|
60
|
+
/**
|
|
61
|
+
* Mark this run as an failure. Add a message that explains the failure.
|
|
62
|
+
* @example await commands.markAsFailure('My failure message');
|
|
63
|
+
* @param {string} message - The message attached as a failure
|
|
64
|
+
* @type {Function}
|
|
65
|
+
*/
|
|
66
|
+
markAsFailure: Function;
|
|
67
|
+
/**
|
|
68
|
+
* Executes JavaScript in the browser context.
|
|
69
|
+
* @type {JavaScript}
|
|
70
|
+
*/
|
|
71
|
+
js: JavaScript;
|
|
72
|
+
/**
|
|
73
|
+
* Switches context to different frames, windows, or tabs in the browser.
|
|
74
|
+
* @type {Switch}
|
|
75
|
+
*/
|
|
76
|
+
switch: Switch;
|
|
77
|
+
/**
|
|
78
|
+
* Sets values on HTML elements in the page.
|
|
79
|
+
* @type {Set}
|
|
80
|
+
*/
|
|
81
|
+
set: Set;
|
|
82
|
+
/**
|
|
83
|
+
* Stopwatch utility for measuring time intervals.
|
|
84
|
+
* @type {StopWatch}
|
|
85
|
+
*/
|
|
86
|
+
stopWatch: StopWatch;
|
|
87
|
+
/**
|
|
88
|
+
* Manages the browser's cache.
|
|
89
|
+
* @type {Cache}
|
|
90
|
+
*/
|
|
91
|
+
cache: Cache;
|
|
92
|
+
/**
|
|
93
|
+
* Adds metadata to the user journey.
|
|
94
|
+
* @type {Meta}
|
|
95
|
+
*/
|
|
96
|
+
meta: Meta;
|
|
97
|
+
/**
|
|
98
|
+
* Takes and manages screenshots.
|
|
99
|
+
* @type {Screenshot}
|
|
100
|
+
*/
|
|
101
|
+
screenshot: Screenshot;
|
|
102
|
+
/**
|
|
103
|
+
* Use the Chrome DevTools Protocol, available in Chrome and Edge.
|
|
104
|
+
* @type {ChromeDevelopmentToolsProtocol}
|
|
105
|
+
*/
|
|
106
|
+
cdp: ChromeDevelopmentToolsProtocol;
|
|
107
|
+
/**
|
|
108
|
+
* Provides commands for interacting with an Android device.
|
|
109
|
+
* @type {AndroidCommand}
|
|
110
|
+
*/
|
|
111
|
+
android: AndroidCommand;
|
|
112
|
+
/**
|
|
113
|
+
* Provides debugging capabilities within a browser automation script.
|
|
114
|
+
* It allows setting breakpoints to pause script execution and inspect the current state.
|
|
115
|
+
* @type {Debug}
|
|
116
|
+
*/
|
|
117
|
+
debug: Debug;
|
|
118
|
+
/**
|
|
119
|
+
* Interact with the page using the mouse.
|
|
120
|
+
* @type {Object}
|
|
121
|
+
*/
|
|
122
|
+
mouse: any;
|
|
123
|
+
/**
|
|
124
|
+
* Interact with a select element.
|
|
125
|
+
* @type {Select}
|
|
126
|
+
*/
|
|
127
|
+
select: Select;
|
|
128
|
+
/**
|
|
129
|
+
* Selenium's action sequence functionality.
|
|
130
|
+
* @type {Actions}
|
|
131
|
+
* @see https://www.selenium.dev/documentation/webdriver/actions_api/
|
|
132
|
+
*/
|
|
133
|
+
action: Actions;
|
|
134
|
+
/**
|
|
135
|
+
* Get Selenium's WebElements.
|
|
136
|
+
* @type {Element}
|
|
137
|
+
*/
|
|
138
|
+
element: Element;
|
|
139
|
+
}
|
|
140
|
+
import { GeckoProfiler as GeckoProfilerCommand } from './command/geckoProfiler.js';
|
|
141
|
+
import { ChromeTrace } from './command/chromeTrace.js';
|
|
142
|
+
import { Click } from './command/click.js';
|
|
143
|
+
import { Scroll } from './command/scroll.js';
|
|
144
|
+
import { AddText } from './command/addText.js';
|
|
145
|
+
import { Wait } from './command/wait.js';
|
|
146
|
+
import { Measure } from './command/measure.js';
|
|
147
|
+
import { Navigation } from './command/navigation.js';
|
|
148
|
+
import { JavaScript } from './command/javaScript.js';
|
|
149
|
+
import { Switch } from './command/switch.js';
|
|
150
|
+
import { Set } from './command/set.js';
|
|
151
|
+
import { Watch as StopWatch } from './command/stopWatch.js';
|
|
152
|
+
import { Cache } from './command/cache.js';
|
|
153
|
+
import { Meta } from './command/meta.js';
|
|
154
|
+
import { Screenshot } from './command/screenshot.js';
|
|
155
|
+
import { ChromeDevelopmentToolsProtocol } from './command/chromeDevToolsProtocol.js';
|
|
156
|
+
import { AndroidCommand } from './command/android.js';
|
|
157
|
+
import { Debug } from './command/debug.js';
|
|
158
|
+
import { Select } from './command/select.js';
|
|
159
|
+
import { Actions } from './command/actions.js';
|
|
160
|
+
import { Element } from './command/element.js';
|
|
161
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/commands.js"],"names":[],"mappings":"AA6BA;;;GAGG;AACH;IACE,sRAuOC;IApMC,+BAMC;IAMD;;;OAGG;IACH,OAFU,WAAW,CAE+C;IAEpE;;;OAGG;IACH,OAFU,KAAK,CAEmC;IAElD;;;OAGG;IACH,QAFU,MAAM,CAE0B;IAE1C;;;OAGG;IACH,SAFU,OAAO,CAEkB;IAEnC;;;OAGG;IACH,MAFU,IAAI,CAEkC;IAEhD;;;OAGG;IACH,SAFU,OAAO,CAEK;IAEtB;;;;;;;;OAQG;IACH,mBAA+C;IAE/C;;;OAGG;IACH,YAFU,UAAU,CAEwC;IAE5D;;;;;OAKG;IACH,gBAAyC;IAEzC;;;;;OAKG;IACH,wBAAmD;IAEnD;;;OAGG;IACH,IAFU,UAAU,CAEgC;IAEpD;;;OAGG;IACH,QAFU,MAAM,CAMf;IAED;;;OAGG;IACH,KAFU,GAAG,CAEc;IAE3B;;;OAGG;IACH,WAFU,SAAS,CAEoB;IAEvC;;;OAGG;IACH,OAFU,KAAK,CAEuD;IAEtE;;;OAGG;IACH,MAFU,IAAI,CAEQ;IAEtB;;;OAGG;IACH,YAFU,UAAU,CAE+C;IAEnE;;;OAGG;IACH,KAFU,8BAA8B,CAE1B;IAEd;;;OAGG;IACH,SAFU,cAAc,CAEkB;IAE1C;;;;OAIG;IACH,OAFW,KAAK,CAEwB;IAExC;;;OAGG;IACH,WA0BC;IAED;;;OAGG;IACH,QAFU,MAAM,CAEiB;IAEjC;;;;OAIG;IACH,QAHU,OAAO,CAGiB;IAElC;;;OAGG;IACH,SAFU,OAAO,CAEkB;CAEtC;sDA9OqD,4BAA4B;4BAXtD,0BAA0B;sBAfhC,oBAAoB;uBAuBnB,qBAAqB;wBAxBpB,sBAAsB;qBAGzB,mBAAmB;wBAChB,sBAAsB;2BAqBnB,yBAAyB;2BApBzB,yBAAyB;uBAC7B,qBAAqB;oBAExB,kBAAkB;mCAGH,wBAAwB;sBAFrC,oBAAoB;qBACrB,mBAAmB;2BAHb,yBAAyB;+CAQL,qCAAqC;+BADrD,sBAAsB;sBAD/B,oBAAoB;uBADnB,qBAAqB;wBAbpB,sBAAsB;wBAGtB,sBAAsB"}
|