From f3e2018919fdee8f37ed58def05474561e533995 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 3 Jan 2024 10:17:22 +0100 Subject: [PATCH] First step to prepare to add just a little bit of typescript (#2047) * First step to add just a little bit typescript * First go adding types for scripting * docs: better cache docs --- lib/core/engine/command/cache.js | 32 ++++- lib/core/engine/commands.js | 115 ++++++++++++++++ lib/core/engine/context.js | 65 +++++++++ lib/core/engine/iteration.js | 123 +++--------------- package-lock.json | 107 +++++++++++++-- package.json | 14 +- tsconfig.json | 15 +++ types/android/index.d.ts | 70 ++++++++++ types/android/index.d.ts.map | 1 + types/chrome/parseCpuTrace.d.ts | 21 +++ types/chrome/parseCpuTrace.d.ts.map | 1 + types/chrome/traceCategoriesParser.d.ts | 2 + types/chrome/traceCategoriesParser.d.ts.map | 1 + types/chrome/webdriver/traceUtilities.d.ts | 8 ++ .../chrome/webdriver/traceUtilities.d.ts.map | 1 + types/core/engine/command/addText.d.ts | 50 +++++++ types/core/engine/command/addText.d.ts.map | 1 + types/core/engine/command/android.d.ts | 14 ++ types/core/engine/command/android.d.ts.map | 1 + types/core/engine/command/cache.d.ts | 44 +++++++ types/core/engine/command/cache.d.ts.map | 1 + .../command/chromeDevToolsProtocol.d.ts | 10 ++ .../command/chromeDevToolsProtocol.d.ts.map | 1 + types/core/engine/command/chromeTrace.d.ts | 11 ++ .../core/engine/command/chromeTrace.d.ts.map | 1 + types/core/engine/command/click.d.ts | 102 +++++++++++++++ types/core/engine/command/click.d.ts.map | 1 + types/core/engine/command/debug.d.ts | 11 ++ types/core/engine/command/debug.d.ts.map | 1 + types/core/engine/command/geckoProfiler.d.ts | 11 ++ .../engine/command/geckoProfiler.d.ts.map | 1 + types/core/engine/command/javaScript.d.ts | 41 ++++++ types/core/engine/command/javaScript.d.ts.map | 1 + types/core/engine/command/measure.d.ts | 61 +++++++++ types/core/engine/command/measure.d.ts.map | 1 + types/core/engine/command/meta.d.ts | 7 + types/core/engine/command/meta.d.ts.map | 1 + .../engine/command/mouse/clickAndHold.d.ts | 56 ++++++++ .../command/mouse/clickAndHold.d.ts.map | 1 + .../engine/command/mouse/contextClick.d.ts | 26 ++++ .../command/mouse/contextClick.d.ts.map | 1 + .../engine/command/mouse/doubleClick.d.ts | 27 ++++ .../engine/command/mouse/doubleClick.d.ts.map | 1 + types/core/engine/command/mouse/index.d.ts | 6 + .../core/engine/command/mouse/index.d.ts.map | 1 + .../core/engine/command/mouse/mouseMove.d.ts | 34 +++++ .../engine/command/mouse/mouseMove.d.ts.map | 1 + .../engine/command/mouse/singleClick.d.ts | 28 ++++ .../engine/command/mouse/singleClick.d.ts.map | 1 + types/core/engine/command/navigation.d.ts | 18 +++ types/core/engine/command/navigation.d.ts.map | 1 + types/core/engine/command/screenshot.d.ts | 8 ++ types/core/engine/command/screenshot.d.ts.map | 1 + types/core/engine/command/scroll.d.ts | 31 +++++ types/core/engine/command/scroll.d.ts.map | 1 + types/core/engine/command/select.d.ts | 62 +++++++++ types/core/engine/command/select.d.ts.map | 1 + types/core/engine/command/set.d.ts | 59 +++++++++ types/core/engine/command/set.d.ts.map | 1 + types/core/engine/command/stopWatch.d.ts | 32 +++++ types/core/engine/command/stopWatch.d.ts.map | 1 + types/core/engine/command/switch.d.ts | 39 ++++++ types/core/engine/command/switch.d.ts.map | 1 + .../command/util/lcpHighlightScript.d.ts | 2 + .../command/util/lcpHighlightScript.d.ts.map | 1 + .../command/util/lsHighlightScript.d.ts | 2 + .../command/util/lsHighlightScript.d.ts.map | 1 + types/core/engine/command/wait.d.ts | 49 +++++++ types/core/engine/command/wait.d.ts.map | 1 + types/core/engine/commands.d.ts | 61 +++++++++ types/core/engine/commands.d.ts.map | 1 + types/core/engine/context.d.ts | 51 ++++++++ types/core/engine/context.d.ts.map | 1 + types/firefox/geckoProfiler.d.ts | 11 ++ types/firefox/geckoProfiler.d.ts.map | 1 + .../settings/geckoProfilerDefaults.d.ts | 8 ++ .../settings/geckoProfilerDefaults.d.ts.map | 1 + types/scripting.d.ts | 2 + types/support/engineUtils.d.ts | 5 + types/support/engineUtils.d.ts.map | 1 + types/support/errors.d.ts | 15 +++ types/support/errors.d.ts.map | 1 + types/support/fileUtil.d.ts | 10 ++ types/support/fileUtil.d.ts.map | 1 + types/support/filters.d.ts | 7 + types/support/filters.d.ts.map | 1 + types/support/getViewPort.d.ts | 2 + types/support/getViewPort.d.ts.map | 1 + types/support/pathToFolder.d.ts | 2 + types/support/pathToFolder.d.ts.map | 1 + types/support/storageManager.d.ts | 17 +++ types/support/storageManager.d.ts.map | 1 + types/support/tcpdump.d.ts | 10 ++ types/support/tcpdump.d.ts.map | 1 + types/support/userTiming.d.ts | 2 + types/support/userTiming.d.ts.map | 1 + types/support/util.d.ts | 6 + types/support/util.d.ts.map | 1 + types/video/defaults.d.ts | 7 + types/video/defaults.d.ts.map | 1 + .../finetune/addTextToVideo.d.ts | 2 + .../finetune/addTextToVideo.d.ts.map | 1 + .../postprocessing/finetune/convertFps.d.ts | 2 + .../finetune/convertFps.d.ts.map | 1 + .../postprocessing/finetune/getFont.d.ts | 2 + .../postprocessing/finetune/getFont.d.ts.map | 1 + .../finetune/getTimingMetrics.d.ts | 2 + .../finetune/getTimingMetrics.d.ts.map | 1 + .../video/postprocessing/finetune/index.d.ts | 2 + .../postprocessing/finetune/index.d.ts.map | 1 + .../postprocessing/finetune/removeOrange.d.ts | 2 + .../finetune/removeOrange.d.ts.map | 1 + .../visualmetrics/extraMetrics.d.ts | 5 + .../visualmetrics/extraMetrics.d.ts.map | 1 + .../visualmetrics/getVideoMetrics.d.ts | 5 + .../visualmetrics/getVideoMetrics.d.ts.map | 1 + .../visualmetrics/visualMetrics.d.ts | 3 + .../visualmetrics/visualMetrics.d.ts.map | 1 + .../screenRecording/android/recorder.d.ts | 11 ++ .../screenRecording/android/recorder.d.ts.map | 1 + .../screenRecording/desktop/convert.d.ts | 2 + .../screenRecording/desktop/convert.d.ts.map | 1 + .../desktop/desktopRecorder.d.ts | 28 ++++ .../desktop/desktopRecorder.d.ts.map | 1 + .../desktop/ffmpegRecorder.d.ts | 17 +++ .../desktop/ffmpegRecorder.d.ts.map | 1 + .../desktop/osx/getSPDisplaysDataType.d.ts | 2 + .../osx/getSPDisplaysDataType.d.ts.map | 1 + .../desktop/osx/getScreen.d.ts | 2 + .../desktop/osx/getScreen.d.ts.map | 1 + .../firefox/firefoxWindowRecorder.d.ts | 13 ++ .../firefox/firefoxWindowRecorder.d.ts.map | 1 + .../screenRecording/ios/convertToMp4.d.ts | 2 + .../screenRecording/ios/convertToMp4.d.ts.map | 1 + .../screenRecording/ios/iosRecorder.d.ts | 14 ++ .../screenRecording/ios/iosRecorder.d.ts.map | 1 + .../iosSimulator/convertToMp4.d.ts | 2 + .../iosSimulator/convertToMp4.d.ts.map | 1 + .../iosSimulator/recorder.d.ts | 9 ++ .../iosSimulator/recorder.d.ts.map | 1 + types/video/screenRecording/recorder.d.ts | 7 + types/video/screenRecording/recorder.d.ts.map | 1 + .../screenRecording/setOrangeBackground.d.ts | 2 + .../setOrangeBackground.d.ts.map | 1 + types/video/video.d.ts | 41 ++++++ types/video/video.d.ts.map | 1 + 146 files changed, 1757 insertions(+), 118 deletions(-) create mode 100644 lib/core/engine/commands.js create mode 100644 lib/core/engine/context.js create mode 100644 tsconfig.json create mode 100644 types/android/index.d.ts create mode 100644 types/android/index.d.ts.map create mode 100644 types/chrome/parseCpuTrace.d.ts create mode 100644 types/chrome/parseCpuTrace.d.ts.map create mode 100644 types/chrome/traceCategoriesParser.d.ts create mode 100644 types/chrome/traceCategoriesParser.d.ts.map create mode 100644 types/chrome/webdriver/traceUtilities.d.ts create mode 100644 types/chrome/webdriver/traceUtilities.d.ts.map create mode 100644 types/core/engine/command/addText.d.ts create mode 100644 types/core/engine/command/addText.d.ts.map create mode 100644 types/core/engine/command/android.d.ts create mode 100644 types/core/engine/command/android.d.ts.map create mode 100644 types/core/engine/command/cache.d.ts create mode 100644 types/core/engine/command/cache.d.ts.map create mode 100644 types/core/engine/command/chromeDevToolsProtocol.d.ts create mode 100644 types/core/engine/command/chromeDevToolsProtocol.d.ts.map create mode 100644 types/core/engine/command/chromeTrace.d.ts create mode 100644 types/core/engine/command/chromeTrace.d.ts.map create mode 100644 types/core/engine/command/click.d.ts create mode 100644 types/core/engine/command/click.d.ts.map create mode 100644 types/core/engine/command/debug.d.ts create mode 100644 types/core/engine/command/debug.d.ts.map create mode 100644 types/core/engine/command/geckoProfiler.d.ts create mode 100644 types/core/engine/command/geckoProfiler.d.ts.map create mode 100644 types/core/engine/command/javaScript.d.ts create mode 100644 types/core/engine/command/javaScript.d.ts.map create mode 100644 types/core/engine/command/measure.d.ts create mode 100644 types/core/engine/command/measure.d.ts.map create mode 100644 types/core/engine/command/meta.d.ts create mode 100644 types/core/engine/command/meta.d.ts.map create mode 100644 types/core/engine/command/mouse/clickAndHold.d.ts create mode 100644 types/core/engine/command/mouse/clickAndHold.d.ts.map create mode 100644 types/core/engine/command/mouse/contextClick.d.ts create mode 100644 types/core/engine/command/mouse/contextClick.d.ts.map create mode 100644 types/core/engine/command/mouse/doubleClick.d.ts create mode 100644 types/core/engine/command/mouse/doubleClick.d.ts.map create mode 100644 types/core/engine/command/mouse/index.d.ts create mode 100644 types/core/engine/command/mouse/index.d.ts.map create mode 100644 types/core/engine/command/mouse/mouseMove.d.ts create mode 100644 types/core/engine/command/mouse/mouseMove.d.ts.map create mode 100644 types/core/engine/command/mouse/singleClick.d.ts create mode 100644 types/core/engine/command/mouse/singleClick.d.ts.map create mode 100644 types/core/engine/command/navigation.d.ts create mode 100644 types/core/engine/command/navigation.d.ts.map create mode 100644 types/core/engine/command/screenshot.d.ts create mode 100644 types/core/engine/command/screenshot.d.ts.map create mode 100644 types/core/engine/command/scroll.d.ts create mode 100644 types/core/engine/command/scroll.d.ts.map create mode 100644 types/core/engine/command/select.d.ts create mode 100644 types/core/engine/command/select.d.ts.map create mode 100644 types/core/engine/command/set.d.ts create mode 100644 types/core/engine/command/set.d.ts.map create mode 100644 types/core/engine/command/stopWatch.d.ts create mode 100644 types/core/engine/command/stopWatch.d.ts.map create mode 100644 types/core/engine/command/switch.d.ts create mode 100644 types/core/engine/command/switch.d.ts.map create mode 100644 types/core/engine/command/util/lcpHighlightScript.d.ts create mode 100644 types/core/engine/command/util/lcpHighlightScript.d.ts.map create mode 100644 types/core/engine/command/util/lsHighlightScript.d.ts create mode 100644 types/core/engine/command/util/lsHighlightScript.d.ts.map create mode 100644 types/core/engine/command/wait.d.ts create mode 100644 types/core/engine/command/wait.d.ts.map create mode 100644 types/core/engine/commands.d.ts create mode 100644 types/core/engine/commands.d.ts.map create mode 100644 types/core/engine/context.d.ts create mode 100644 types/core/engine/context.d.ts.map create mode 100644 types/firefox/geckoProfiler.d.ts create mode 100644 types/firefox/geckoProfiler.d.ts.map create mode 100644 types/firefox/settings/geckoProfilerDefaults.d.ts create mode 100644 types/firefox/settings/geckoProfilerDefaults.d.ts.map create mode 100644 types/scripting.d.ts create mode 100644 types/support/engineUtils.d.ts create mode 100644 types/support/engineUtils.d.ts.map create mode 100644 types/support/errors.d.ts create mode 100644 types/support/errors.d.ts.map create mode 100644 types/support/fileUtil.d.ts create mode 100644 types/support/fileUtil.d.ts.map create mode 100644 types/support/filters.d.ts create mode 100644 types/support/filters.d.ts.map create mode 100644 types/support/getViewPort.d.ts create mode 100644 types/support/getViewPort.d.ts.map create mode 100644 types/support/pathToFolder.d.ts create mode 100644 types/support/pathToFolder.d.ts.map create mode 100644 types/support/storageManager.d.ts create mode 100644 types/support/storageManager.d.ts.map create mode 100644 types/support/tcpdump.d.ts create mode 100644 types/support/tcpdump.d.ts.map create mode 100644 types/support/userTiming.d.ts create mode 100644 types/support/userTiming.d.ts.map create mode 100644 types/support/util.d.ts create mode 100644 types/support/util.d.ts.map create mode 100644 types/video/defaults.d.ts create mode 100644 types/video/defaults.d.ts.map create mode 100644 types/video/postprocessing/finetune/addTextToVideo.d.ts create mode 100644 types/video/postprocessing/finetune/addTextToVideo.d.ts.map create mode 100644 types/video/postprocessing/finetune/convertFps.d.ts create mode 100644 types/video/postprocessing/finetune/convertFps.d.ts.map create mode 100644 types/video/postprocessing/finetune/getFont.d.ts create mode 100644 types/video/postprocessing/finetune/getFont.d.ts.map create mode 100644 types/video/postprocessing/finetune/getTimingMetrics.d.ts create mode 100644 types/video/postprocessing/finetune/getTimingMetrics.d.ts.map create mode 100644 types/video/postprocessing/finetune/index.d.ts create mode 100644 types/video/postprocessing/finetune/index.d.ts.map create mode 100644 types/video/postprocessing/finetune/removeOrange.d.ts create mode 100644 types/video/postprocessing/finetune/removeOrange.d.ts.map create mode 100644 types/video/postprocessing/visualmetrics/extraMetrics.d.ts create mode 100644 types/video/postprocessing/visualmetrics/extraMetrics.d.ts.map create mode 100644 types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts create mode 100644 types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts.map create mode 100644 types/video/postprocessing/visualmetrics/visualMetrics.d.ts create mode 100644 types/video/postprocessing/visualmetrics/visualMetrics.d.ts.map create mode 100644 types/video/screenRecording/android/recorder.d.ts create mode 100644 types/video/screenRecording/android/recorder.d.ts.map create mode 100644 types/video/screenRecording/desktop/convert.d.ts create mode 100644 types/video/screenRecording/desktop/convert.d.ts.map create mode 100644 types/video/screenRecording/desktop/desktopRecorder.d.ts create mode 100644 types/video/screenRecording/desktop/desktopRecorder.d.ts.map create mode 100644 types/video/screenRecording/desktop/ffmpegRecorder.d.ts create mode 100644 types/video/screenRecording/desktop/ffmpegRecorder.d.ts.map create mode 100644 types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts create mode 100644 types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts.map create mode 100644 types/video/screenRecording/desktop/osx/getScreen.d.ts create mode 100644 types/video/screenRecording/desktop/osx/getScreen.d.ts.map create mode 100644 types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts create mode 100644 types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts.map create mode 100644 types/video/screenRecording/ios/convertToMp4.d.ts create mode 100644 types/video/screenRecording/ios/convertToMp4.d.ts.map create mode 100644 types/video/screenRecording/ios/iosRecorder.d.ts create mode 100644 types/video/screenRecording/ios/iosRecorder.d.ts.map create mode 100644 types/video/screenRecording/iosSimulator/convertToMp4.d.ts create mode 100644 types/video/screenRecording/iosSimulator/convertToMp4.d.ts.map create mode 100644 types/video/screenRecording/iosSimulator/recorder.d.ts create mode 100644 types/video/screenRecording/iosSimulator/recorder.d.ts.map create mode 100644 types/video/screenRecording/recorder.d.ts create mode 100644 types/video/screenRecording/recorder.d.ts.map create mode 100644 types/video/screenRecording/setOrangeBackground.d.ts create mode 100644 types/video/screenRecording/setOrangeBackground.d.ts.map create mode 100644 types/video/video.d.ts create mode 100644 types/video/video.d.ts.map diff --git a/lib/core/engine/command/cache.js b/lib/core/engine/command/cache.js index 805fc726c..aa8a7b590 100644 --- a/lib/core/engine/command/cache.js +++ b/lib/core/engine/command/cache.js @@ -2,14 +2,34 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.cache'); export class Cache { constructor(browser, browserName, extensionServer, cdp) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.browserName = browserName; + /** + * @private + */ this.extensionServer = extensionServer; + /** + * @private + */ this.cdp = cdp; } /** - * Clear the browser cache. Will clear browser cache and cookies. + * Clears the browser cache. This includes both cache and cookies. + * + * For Firefox, it uses the extensionServer setup with specific options. + * For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) commands. + * If the browser is not supported, logs an error message. + * + * @async + * @throws Will throw an error if the browser is not supported. + * @returns {Promise} A promise that resolves when the cache and cookies are cleared. */ async clear() { if (this.browserName === 'firefox') { @@ -28,7 +48,15 @@ export class Cache { } /** - * Clear the browser cache but keep cookies. + * Clears the browser cache while keeping the cookies. + * + * For Firefox, it uses the extensionServer setup with specific options. + * For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) command to clear the cache. + * If the browser is not supported, logs an error message. + * + * @async + * @throws Will throw an error if the browser is not supported. + * @returns {Promise} A promise that resolves when the cache is cleared but cookies are kept. */ async clearKeepCookies() { if (this.browserName === 'firefox') { diff --git a/lib/core/engine/commands.js b/lib/core/engine/commands.js new file mode 100644 index 000000000..879b17f01 --- /dev/null +++ b/lib/core/engine/commands.js @@ -0,0 +1,115 @@ +import { AddText } from './command/addText.js'; +import { Click } from './command/click.js'; +import { Wait } from './command/wait.js'; +import { Measure } from './command/measure.js'; +import { JavaScript } from './command/javaScript.js'; +import { Switch } from './command/switch.js'; +import { Screenshot } from './command/screenshot.js'; +import { Set } from './command/set.js'; +import { Cache } from './command/cache.js'; +import { Meta } from './command/meta.js'; +import { Watch as StopWatch } from './command/stopWatch.js'; +import { Select } from './command/select.js'; +import { Debug } from './command/debug.js'; +import { AndroidCommand } from './command/android.js'; +import { Android } from '../../android/index.js'; +import { ChromeDevelopmentToolsProtocol } from './command/chromeDevToolsProtocol.js'; +import { ChromeTrace } from './command/chromeTrace.js'; +import { + SingleClick, + DoubleClick, + ClickAndHold, + ContextClick, + MouseMove +} from './command/mouse/index.js'; +import { Scroll } from './command/scroll.js'; +import { Navigation } from './command/navigation.js'; +import { GeckoProfiler } from '../../firefox/geckoProfiler.js'; +import { GeckoProfiler as GeckoProfilerCommand } from './command/geckoProfiler.js'; +/** + * Represents the set of commands available in a Browsertime script. + * + */ +export class Commands { + constructor( + browser, + engineDelegate, + index, + result, + storageManager, + pageCompleteCheck, + extensionServer, + context, + videos, + screenshotManager, + scriptsByCategory, + asyncScriptsByCategory, + postURLScripts, + options + ) { + const measure = new Measure( + browser, + index, + pageCompleteCheck, + result, + engineDelegate, + extensionServer, + storageManager, + videos, + scriptsByCategory, + asyncScriptsByCategory, + postURLScripts, + context, + screenshotManager, + options + ); + + const browserProfiler = new GeckoProfiler(browser, storageManager, options); + // Profiler + this.profiler = new GeckoProfilerCommand( + browserProfiler, + browser, + index, + options, + result + ); + const cdp = new ChromeDevelopmentToolsProtocol( + engineDelegate, + options.browser + ); + this.trace = new ChromeTrace(engineDelegate, index, options, result); + this.android = new Android(options); + this.debug = new Debug(browser, options); + this.click = new Click(browser, pageCompleteCheck); + this.scroll = new Scroll(browser, options); + this.addText = new AddText(browser); + this.wait = new Wait(browser, pageCompleteCheck); + this.measure = measure; + this.navigate = measure._navigate.bind(measure); + this.navigation = new Navigation(browser, pageCompleteCheck); + this.error = measure._error.bind(measure); + this.markAsFailure = measure._failure.bind(measure); + this.js = new JavaScript(browser, pageCompleteCheck); + this.switch = new Switch( + browser, + pageCompleteCheck, + measure._navigate.bind(measure) + ); + this.set = new Set(browser); + this.stopWatch = new StopWatch(measure); + this.cache = new Cache(browser, options.browser, extensionServer, cdp); + this.meta = new Meta(); + this.screenshot = new Screenshot(screenshotManager, browser, index); + this.cdp = cdp; + this.android = new AndroidCommand(options); + this.debug = new Debug(browser, options); + this.mouse = { + moveTo: new MouseMove(browser), + contextClick: new ContextClick(browser), + singleClick: new SingleClick(browser, pageCompleteCheck), + doubleClick: new DoubleClick(browser, pageCompleteCheck), + clickAndHold: new ClickAndHold(browser) + }; + this.select = new Select(browser); + } +} diff --git a/lib/core/engine/context.js b/lib/core/engine/context.js new file mode 100644 index 000000000..b2791ff37 --- /dev/null +++ b/lib/core/engine/context.js @@ -0,0 +1,65 @@ +/** + * Class representing the context of a Browsertime run. + * + * @class + */ +export class Context { + /** + * Creates an instance of Context. + * + * @param {Object} options - Configuration options for the Browsertime run. + * @param {Object} result - Object to store the results of the Browsertime run. + * @param {intel.Logger} log - Logger for recording events or errors. + * @param {import('../../support/storageManager.js').StorageManager} storageManager - Manages storage for the Browsertime run. + * @param {number} index - Index representing the current iteration or run. + * @param {import('selenium-webdriver').WebDriver} webdriver - WebDriver instance from Selenium for browser automation. + * @param {import('selenium-webdriver').WebDriver} instantiatedDriver - WebDriver instance returned by Selenium's `builder.build()`. + */ + constructor( + options, + result, + log, + storageManager, + index, + webdriver, + instantiatedDriver + ) { + /** + * @type {Object} + */ + this.options = options; + + /** + * @type {Object} + */ + this.result = result; + + /** + * @type {intel.Logger} + */ + this.log = log; + + /** + * @type {number} + */ + this.index = index; + + /** + * @type {import('../../support/storageManager.js').StorageManager} + */ + this.storageManager = storageManager; + + /** + * @type {Object} + */ + this.taskData = {}; + + /** + * @type {{webdriver: import('selenium-webdriver').WebDriver, driver: import('selenium-webdriver').WebDriver}} + */ + this.selenium = { + webdriver, + driver: instantiatedDriver + }; + } +} diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 6aed77ad7..94e0beca4 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -2,6 +2,8 @@ import { platform } from 'node:os'; import webdriver from 'selenium-webdriver'; import intel from 'intel'; +import { Context } from './context.js'; +import { Commands } from './commands.js'; import { SeleniumRunner } from '../seleniumRunner.js'; import { preURL } from '../../support/preURL.js'; import { setResourceTimingBufferSize } from '../../support/setResourceTimingBufferSize.js'; @@ -9,41 +11,16 @@ import { ScreenshotManager } from '../../screenshot/index.js'; import { ExtensionServer } from '../../extensionserver/index.js'; import { Video } from '../../video/video.js'; import { stop } from '../../support/stop.js'; -import { AddText } from './command/addText.js'; -import { Click } from './command/click.js'; -import { Wait } from './command/wait.js'; -import { Measure } from './command/measure.js'; -import { JavaScript } from './command/javaScript.js'; -import { Switch } from './command/switch.js'; -import { Screenshot } from './command/screenshot.js'; -import { Set } from './command/set.js'; -import { Cache } from './command/cache.js'; -import { Meta } from './command/meta.js'; -import { Watch as StopWatch } from './command/stopWatch.js'; -import { Select } from './command/select.js'; -import { Debug } from './command/debug.js'; -import { AndroidCommand } from './command/android.js'; -import { ChromeDevelopmentToolsProtocol } from './command/chromeDevToolsProtocol.js'; -import { ChromeTrace } from './command/chromeTrace.js'; + import { addConnectivity, removeConnectivity } from '../../connectivity/index.js'; import { jsonifyVisualProgress } from '../../support/util.js'; import { flushDNS } from '../../support/dns.js'; -import { - SingleClick, - DoubleClick, - ClickAndHold, - ContextClick, - MouseMove -} from './command/mouse/index.js'; + import { getNumberOfRunningProcesses } from '../../support/processes.js'; -import { isAndroidConfigured, Android } from '../../android/index.js'; -import { Scroll } from './command/scroll.js'; -import { Navigation } from './command/navigation.js'; -import { GeckoProfiler } from '../../firefox/geckoProfiler.js'; -import { GeckoProfiler as GeckoProfilerCommand } from './command/geckoProfiler.js'; +import { isAndroidConfigured } from '../../android/index.js'; const log = intel.getLogger('browsertime'); const delay = ms => new Promise(res => setTimeout(res, ms)); @@ -118,93 +95,33 @@ export class Iteration { await engineDelegate.afterBrowserStart(browser); // The data we push to all selenium scripts - const context = { - // TODO we want to have the URL here so we can use scripts to login - // and then access the supplied URL + const context = new Context( options, result, log, - storageManager: this.storageManager, - taskData: {}, + this.storageManager, index, - selenium: { - webdriver, // The Selenium WebDriver public API object https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index.html - driver: browser.getDriver() // The instantiated version of the WebDriver https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html - } - }; + webdriver, + browser.getDriver() + ); - const measure = new Measure( + const commands = new Commands( browser, + engineDelegate, index, - this.pageCompleteCheck, result, - engineDelegate, - extensionServer, this.storageManager, + this.pageCompleteCheck, + extensionServer, + context, videos, + screenshotManager, this.scriptsByCategory, this.asyncScriptsByCategory, this.postURLScripts, - context, - screenshotManager, options ); - const browserProfiler = new GeckoProfiler( - browser, - this.storageManager, - this.options - ); - const profiler = new GeckoProfilerCommand( - browserProfiler, - browser, - index, - this.options, - result - ); - const cdp = new ChromeDevelopmentToolsProtocol( - engineDelegate, - options.browser - ); - const trace = new ChromeTrace(engineDelegate, index, options, result); - const android = new Android(options); - const debug = new Debug(browser, options); - const commands = { - profiler: profiler, - trace: trace, - click: new Click(browser, this.pageCompleteCheck), - scroll: new Scroll(browser, options), - addText: new AddText(browser), - wait: new Wait(browser, this.pageCompleteCheck), - measure: measure, - navigate: measure._navigate.bind(measure), - navigation: new Navigation(browser, this.pageCompleteCheck), - error: measure._error.bind(measure), - markAsFailure: measure._failure.bind(measure), - js: new JavaScript(browser, this.pageCompleteCheck), - switch: new Switch( - browser, - this.pageCompleteCheck, - measure._navigate.bind(measure) - ), - set: new Set(browser), - stopWatch: new StopWatch(measure), - cache: new Cache(browser, options.browser, extensionServer, cdp), - meta: new Meta(), - screenshot: new Screenshot(screenshotManager, browser, index), - cdp, - android: new AndroidCommand(options), - debug: debug, - mouse: { - moveTo: new MouseMove(browser), - contextClick: new ContextClick(browser), - singleClick: new SingleClick(browser, this.pageCompleteCheck), - doubleClick: new DoubleClick(browser, this.pageCompleteCheck), - clickAndHold: new ClickAndHold(browser) - }, - select: new Select(browser) - }; - // Safari can't load data:text URLs at startup, so you can either choose // your own URL or use the blank one const startURL = @@ -223,7 +140,7 @@ export class Iteration { // browser to get ready if (isAndroidConfigured(options)) { await delay(ANDROID_DELAY_TIME); - batteryTemperature.start = await android.getTemperature(); + batteryTemperature.start = await commands.android.getTemperature(); } await delay(options.timeToSettle || 100); @@ -270,7 +187,7 @@ export class Iteration { // if we are in debig mode we wait on a continue command if (options.debug) { - await debug.breakpoint('End-of-iteration'); + await commands.debug.breakpoint('End-of-iteration'); } if (options.browser === 'firefox' && options.debug) { @@ -293,8 +210,8 @@ export class Iteration { await engineDelegate.afterBrowserStopped(); if (isAndroidConfigured(options)) { - batteryTemperature.stop = await android.getTemperature(); - await android.removeDevtoolsFw(); + batteryTemperature.stop = await commands.android.getTemperature(); + await commands.android.removeDevtoolsFw(); } if (options.visualMetrics && !options.videoParams.debug) { diff --git a/package-lock.json b/package-lock.json index d9b373dfc..d129966b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,7 @@ "browsertime": "bin/browsertime.js" }, "devDependencies": { + "@types/selenium-webdriver": "4.1.21", "ava": "6.0.1", "eslint": "8.55.0", "eslint-config-prettier": "9.1.0", @@ -47,7 +48,8 @@ "eslint-plugin-unicorn": "49.0.0", "prettier": "3.1.1", "serve": "14.2.1", - "serve-handler": "6.1.5" + "serve-handler": "6.1.5", + "typescript": "5.3.3" }, "engines": { "node": ">=18.0.0" @@ -971,10 +973,13 @@ "optional": true }, "node_modules/@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", - "optional": true + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -982,6 +987,24 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, + "node_modules/@types/selenium-webdriver": { + "version": "4.1.21", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-4.1.21.tgz", + "integrity": "sha512-QGURnImvxYlIQz5DVhvHdqpYNLBjhJ2Vm+cnQI2G9QZzkWlZm0LkLcvDcHp+qE6N2KBz4CeuvXgPO7W3XQ0Tyw==", + "dev": true, + "dependencies": { + "@types/ws": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -3583,6 +3606,12 @@ "@types/node": "16.9.1" } }, + "node_modules/image-q/node_modules/@types/node": { + "version": "16.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", + "optional": true + }, "node_modules/immediate": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", @@ -6135,6 +6164,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", @@ -7268,10 +7316,13 @@ "optional": true }, "@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", - "optional": true + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } }, "@types/normalize-package-data": { "version": "2.4.1", @@ -7279,6 +7330,24 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, + "@types/selenium-webdriver": { + "version": "4.1.21", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-4.1.21.tgz", + "integrity": "sha512-QGURnImvxYlIQz5DVhvHdqpYNLBjhJ2Vm+cnQI2G9QZzkWlZm0LkLcvDcHp+qE6N2KBz4CeuvXgPO7W3XQ0Tyw==", + "dev": true, + "requires": { + "@types/ws": "*" + } + }, + "@types/ws": { + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -9129,6 +9198,14 @@ "optional": true, "requires": { "@types/node": "16.9.1" + }, + "dependencies": { + "@types/node": { + "version": "16.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", + "optional": true + } } }, "immediate": { @@ -10963,6 +11040,18 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, + "typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", diff --git a/package.json b/package.json index c6f7f93e5..12b1cfb80 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "20.0.0", "bin": "./bin/browsertime.js", "type": "module", + "types": "./types/scripting.d.ts", "dependencies": { "@cypress/xvfb": "1.2.4", "@devicefarmer/adbkit": "3.2.5", @@ -12,13 +13,13 @@ "@sitespeed.io/geckodriver": "0.33.0-c", "@sitespeed.io/throttle": "5.0.0", "@sitespeed.io/tracium": "0.3.3", - "ff-test-bidi-har-export": "0.0.12", "btoa": "1.2.1", "chrome-har": "0.13.2", "chrome-remote-interface": "0.33.0", "dayjs": "1.11.10", "execa": "8.0.1", "fast-stats": "0.0.6", + "ff-test-bidi-har-export": "0.0.12", "find-up": "7.0.0", "get-port": "7.0.0", "hasbin": "1.2.3", @@ -36,14 +37,16 @@ "jimp": "0.22.10" }, "devDependencies": { + "@types/selenium-webdriver": "4.1.21", "ava": "6.0.1", "eslint": "8.55.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.0.1", "eslint-plugin-unicorn": "49.0.0", "prettier": "3.1.1", + "serve": "14.2.1", "serve-handler": "6.1.5", - "serve": "14.2.1" + "typescript": "5.3.3" }, "engines": { "node": ">=18.0.0" @@ -61,7 +64,8 @@ "index.js", "lib", "package.json", - "vendor" + "vendor", + "types" ], "exports": "./index.js", "scripts": { @@ -69,7 +73,9 @@ "start-server": "serve test/data/html/", "stop-server": "sudo pkill serve", "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "tsc": "tsc", + "prepublishOnly": "npm run lint && npm run tsc" }, "author": "Peter Hedenskog", "contributors": [ diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..26e15f987 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "include": [ + "lib/core/engine/command/**/*", + "lib/core/engine/context.js", + "lib/core/engine/commands.js" + ], + "compilerOptions": { + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "types", + "declarationMap": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/android/index.d.ts b/types/android/index.d.ts new file mode 100644 index 000000000..1891eb4d9 --- /dev/null +++ b/types/android/index.d.ts @@ -0,0 +1,70 @@ +export function isAndroidConfigured(options: any): boolean; +export class Android { + constructor(options: any); + client: any; + id: any; + port: any; + screenBrightnessMode: number; + screenBrightness: number; + tmpDir: string; + _init(): Promise; + device: any; + sdcard: any; + _runCommand(command: any): Promise; + _runCommandAndGet(command: any): Promise; + _runAsRootAndGet(command: any): Promise; + _runAsRoot(command: any): Promise; + _downloadFile(sourcePath: any, destinationPath: any): Promise; + _downloadDir(sourcePath: any, destinationPath: any): Promise; + getFullPathOnSdCard(path: any): string; + mkDirOnSdCard(dirName: any): Promise; + removeFileOnSdCard(file: any): Promise; + removePathOnSdCard(path: any): Promise; + reboot(): Promise; + getTemperature(): Promise; + getMeta(): Promise<{ + model: any; + name: any; + device: any; + androidVersion: any; + id: any; + wifi: any; + }>; + pullNetLog(destination: any): Promise; + addDevtoolsFw(): Promise; + removeDevtoolsFw(): Promise<({ + all?: string; + isCanceled: boolean; + } & import("execa").ExecaReturnBase)[]>; + startVideo(): Promise; + ping(address: any): Promise; + clickPowerButton(): Promise; + getWifi(): Promise; + closeAppNotRespondingPopup(): Promise; + pressHomeButton(): Promise; + stopVideo(): Promise; + getPhoneState(): Promise; + pullVideo(destinationPath: any): Promise; + removeVideo(): Promise; + pidof(packageName: any): Promise; + _pidofWithPidof(packageName: any): Promise; + _pidofWithPs(packageName: any): Promise; + _processStartTime(pid: any): Promise<{ + dateInMs: number; + systemUptimeInSeconds: any; + utilStartTimeAfterSystemStartTimeInJiffies: any; + processStartTimeAfterSystemStartTimeInJiffies: any; + jiffesPerSeconds: number; + processStartTimeInMs: number; + }>; + processStartTime(pid: any, count?: number): Promise; + startPowerTesting(): Promise; + stopPowerTesting(): Promise; + resetPowerUsage(): Promise; + measurePowerUsage(packageName: any): Promise<{ + 'full-screen': number; + 'full-wifi': number; + total: number; + }>; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/android/index.d.ts.map b/types/android/index.d.ts.map new file mode 100644 index 000000000..443123a1f --- /dev/null +++ b/types/android/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/android/index.js"],"names":[],"mappings":"AAiiBA,2DAWC;AA/hBD;IACE,0BAwBC;IAfC,YAAgC;IAEhC,QAIC;IACD,UAAgC;IAGhC,6BAA6B;IAC7B,yBAA2B;IAC3B,eAAgC;IAKlC,uBAgBC;IALC,YAA4C;IAG1C,YAAoE;IAIxE,wCAEC;IAED,8CAIC;IAED,6CAIC;IAED,2CAUC;IAED,mEAYC;IAED,mEAcC;IAED,uCAEC;IAED,0CAGC;IAED,4CAMC;IAED,4CAMC;IAED,uBAGC;IAED,kCAOC;IAED;;;;;;;OAuBC;IAED,2CAKC;IAED,8BAKC;IAED;;;oDAuBC;IAED,2BAIC;IAED,qCAGC;IAED,iCAGC;IAED,wBASC;IAED,2CAOC;IAED,gCAEC;IAED,0BAIC;IAED,iCAGC;IAED,8CAIC;IAED,4BAEC;IAED,sCAYC;IAED,mDAsBC;IAED,gDA+CC;IAED;;;;;;;OAqDC;IAED,4DAQC;IAED,mCAcC;IAED,kCAQC;IAED,iCAIC;IAED;;;;OAGC;CACF"} \ No newline at end of file diff --git a/types/chrome/parseCpuTrace.d.ts b/types/chrome/parseCpuTrace.d.ts new file mode 100644 index 000000000..66f9811a1 --- /dev/null +++ b/types/chrome/parseCpuTrace.d.ts @@ -0,0 +1,21 @@ +export function parseCPUTrace(tracelog: any, url: any): Promise<{ + categories: { + parseHTML: number; + styleLayout: number; + paintCompositeRender: number; + scriptParseCompile: number; + scriptEvaluation: number; + garbageCollection: number; + other: number; + }; + events: {}; + urls: { + url: string; + value: number; + }[]; +} | { + categories?: undefined; + events?: undefined; + urls?: undefined; +}>; +//# sourceMappingURL=parseCpuTrace.d.ts.map \ No newline at end of file diff --git a/types/chrome/parseCpuTrace.d.ts.map b/types/chrome/parseCpuTrace.d.ts.map new file mode 100644 index 000000000..a94bd19c7 --- /dev/null +++ b/types/chrome/parseCpuTrace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parseCpuTrace.d.ts","sourceRoot":"","sources":["../../lib/chrome/parseCpuTrace.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;GA4EC"} \ No newline at end of file diff --git a/types/chrome/traceCategoriesParser.d.ts b/types/chrome/traceCategoriesParser.d.ts new file mode 100644 index 000000000..0304b4320 --- /dev/null +++ b/types/chrome/traceCategoriesParser.d.ts @@ -0,0 +1,2 @@ +export function parse(events: any, url: any): any; +//# sourceMappingURL=traceCategoriesParser.d.ts.map \ No newline at end of file diff --git a/types/chrome/traceCategoriesParser.d.ts.map b/types/chrome/traceCategoriesParser.d.ts.map new file mode 100644 index 000000000..968eaeb62 --- /dev/null +++ b/types/chrome/traceCategoriesParser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"traceCategoriesParser.d.ts","sourceRoot":"","sources":["../../lib/chrome/traceCategoriesParser.js"],"names":[],"mappings":"AA2JA,kDAQC"} \ No newline at end of file diff --git a/types/chrome/webdriver/traceUtilities.d.ts b/types/chrome/webdriver/traceUtilities.d.ts new file mode 100644 index 000000000..b8114a970 --- /dev/null +++ b/types/chrome/webdriver/traceUtilities.d.ts @@ -0,0 +1,8 @@ +export function getRenderBlocking(trace: any): Promise<{ + renderBlockingInfo: {}; + renderBlocking: { + recalculateStyle: {}; + requests: {}; + }; +}>; +//# sourceMappingURL=traceUtilities.d.ts.map \ No newline at end of file diff --git a/types/chrome/webdriver/traceUtilities.d.ts.map b/types/chrome/webdriver/traceUtilities.d.ts.map new file mode 100644 index 000000000..39f6e22f0 --- /dev/null +++ b/types/chrome/webdriver/traceUtilities.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"traceUtilities.d.ts","sourceRoot":"","sources":["../../../lib/chrome/webdriver/traceUtilities.js"],"names":[],"mappings":"AA8DA;;;;;;GAoCC"} \ No newline at end of file diff --git a/types/core/engine/command/addText.d.ts b/types/core/engine/command/addText.d.ts new file mode 100644 index 000000000..6c8bf8daf --- /dev/null +++ b/types/core/engine/command/addText.d.ts @@ -0,0 +1,50 @@ +export class AddText { + constructor(browser: any); + browser: any; + /** + * Add text to an element with Selenium sendKeys. + * @param {string} text The text string that you want to add + * @param {string} id The id of the element + * @returns {Promise} Promise object represents when the text has been + * added to the field + * @throws Will throw an error if the element is not found + */ + byId(text: string, id: string): Promise; + /** + * Add text to an element with Selenium sendKeys. + * @param {string} text The text string that you want to add + * @param {string} xpath The xpath to the element + * @returns {Promise} Promise object represents when the text has been + * added to the field + * @throws Will throw an error if the element is not found + */ + byXpath(text: string, xpath: string): Promise; + /** + * Add text to an element with Selenium sendKeys. + * @param {string} text The text string that you want to add + * @param {string} selector The CSS selector to the element + * @returns {Promise} Promise object represents when the text has been + * added to the field + * @throws Will throw an error if the element is not found + */ + bySelector(text: string, selector: string): Promise; + /** + * Add text to an element with Selenium sendKeys. + * @param {string} text The text string that you want to add + * @param {string} className A specific class name + * @returns {Promise} Promise object represents when the text has been + * added to the field + * @throws Will throw an error if the element is not found + */ + byClassName(text: string, className: string): Promise; + /** + * Add text to an element with Selenium sendKeys. + * @param {string} text The text string that you want to add + * @param {string} name Element whose name attribute has the given value. + * @returns {Promise} Promise object represents when the text has been + * added to the field + * @throws Will throw an error if the element is not found + */ + byName(text: string, name: string): Promise; +} +//# sourceMappingURL=addText.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/addText.d.ts.map b/types/core/engine/command/addText.d.ts.map new file mode 100644 index 000000000..a4bc785cd --- /dev/null +++ b/types/core/engine/command/addText.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"addText.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/addText.js"],"names":[],"mappings":"AAIA;IACE,0BAEC;IADC,aAAsB;IAGxB;;;;;;;OAOG;IACH,WANW,MAAM,MACN,MAAM,gBAiBhB;IAED;;;;;;;OAOG;IACH,cANW,MAAM,SACN,MAAM,gBAiBhB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,YACN,MAAM,gBAiBhB;IAED;;;;;;;OAOG;IACH,kBANW,MAAM,aACN,MAAM,gBAiBhB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,QACN,MAAM,gBAiBhB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/android.d.ts b/types/core/engine/command/android.d.ts new file mode 100644 index 000000000..cbc5b1c76 --- /dev/null +++ b/types/core/engine/command/android.d.ts @@ -0,0 +1,14 @@ +export class AndroidCommand { + constructor(options: any); + options: any; + /** + * Run a shell command on your Android phone. + * @param {string} command The shell command to run on your phone. + * @returns {Promise} Promise object represents the outcome of the command or when the command has finished + * @throws Will throw an error Android isn't configured or something goes wrong + */ + shell(command: string): Promise; + a: Android; +} +import { Android } from '../../../android/index.js'; +//# sourceMappingURL=android.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/android.d.ts.map b/types/core/engine/command/android.d.ts.map new file mode 100644 index 000000000..d96ec6747 --- /dev/null +++ b/types/core/engine/command/android.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/android.js"],"names":[],"mappings":"AAGA;IACE,0BAEC;IADC,aAAsB;IAGxB;;;;;OAKG;IACH,eAJW,MAAM,gBAehB;IAPK,WAAkC;CAQzC;wBAzB4C,2BAA2B"} \ No newline at end of file diff --git a/types/core/engine/command/cache.d.ts b/types/core/engine/command/cache.d.ts new file mode 100644 index 000000000..de5cb2cc5 --- /dev/null +++ b/types/core/engine/command/cache.d.ts @@ -0,0 +1,44 @@ +export class Cache { + constructor(browser: any, browserName: any, extensionServer: any, cdp: any); + /** + * @private + */ + private browser; + /** + * @private + */ + private browserName; + /** + * @private + */ + private extensionServer; + /** + * @private + */ + private cdp; + /** + * Clears the browser cache. This includes both cache and cookies. + * + * For Firefox, it uses the extensionServer setup with specific options. + * For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) commands. + * If the browser is not supported, logs an error message. + * + * @async + * @throws Will throw an error if the browser is not supported. + * @returns {Promise} A promise that resolves when the cache and cookies are cleared. + */ + clear(): Promise; + /** + * Clears the browser cache while keeping the cookies. + * + * For Firefox, it uses the extensionServer setup with specific options. + * For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) command to clear the cache. + * If the browser is not supported, logs an error message. + * + * @async + * @throws Will throw an error if the browser is not supported. + * @returns {Promise} A promise that resolves when the cache is cleared but cookies are kept. + */ + clearKeepCookies(): Promise; +} +//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/cache.d.ts.map b/types/core/engine/command/cache.d.ts.map new file mode 100644 index 000000000..10c01ed12 --- /dev/null +++ b/types/core/engine/command/cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/cache.js"],"names":[],"mappings":"AAEA;IACE,4EAiBC;IAhBC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,oBAA8B;IAC9B;;OAEG;IACH,wBAAsC;IACtC;;OAEG;IACH,YAAc;IAGhB;;;;;;;;;;OAUG;IACH,SAFa,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;;;;OAUG;IACH,oBAFa,QAAQ,IAAI,CAAC,CAezB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/chromeDevToolsProtocol.d.ts b/types/core/engine/command/chromeDevToolsProtocol.d.ts new file mode 100644 index 000000000..cafd6855d --- /dev/null +++ b/types/core/engine/command/chromeDevToolsProtocol.d.ts @@ -0,0 +1,10 @@ +export class ChromeDevelopmentToolsProtocol { + constructor(engineDelegate: any, browserName: any); + engineDelegate: any; + browserName: any; + on(event: any, f: any): Promise; + sendAndGet(command: any, arguments_: any): Promise; + getRawClient(): any; + send(command: any, arguments_: any): Promise; +} +//# sourceMappingURL=chromeDevToolsProtocol.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/chromeDevToolsProtocol.d.ts.map b/types/core/engine/command/chromeDevToolsProtocol.d.ts.map new file mode 100644 index 000000000..afab486d4 --- /dev/null +++ b/types/core/engine/command/chromeDevToolsProtocol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"chromeDevToolsProtocol.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/chromeDevToolsProtocol.js"],"names":[],"mappings":"AAIA;IACE,mDAGC;IAFC,oBAAoC;IACpC,iBAA8B;IAGhC,sCAmBC;IAED,wDAoBC;IAED,oBAMC;IAED,kDAiBC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/chromeTrace.d.ts b/types/core/engine/command/chromeTrace.d.ts new file mode 100644 index 000000000..b4d754d02 --- /dev/null +++ b/types/core/engine/command/chromeTrace.d.ts @@ -0,0 +1,11 @@ +export class ChromeTrace { + constructor(engineDelegate: any, index: any, options: any, result: any); + engineDelegate: any; + options: any; + result: any; + index: any; + start(): Promise; + stop(): Promise; + events: any; +} +//# sourceMappingURL=chromeTrace.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/chromeTrace.d.ts.map b/types/core/engine/command/chromeTrace.d.ts.map new file mode 100644 index 000000000..9072b0516 --- /dev/null +++ b/types/core/engine/command/chromeTrace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"chromeTrace.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/chromeTrace.js"],"names":[],"mappings":"AAMA;IACE,wEAKC;IAJC,oBAAoC;IACpC,aAAsB;IACtB,YAAoB;IACpB,WAAkB;IAGpB,sBAYC;IAED,sBAoCC;IA/BK,YAAgB;CAgCvB"} \ No newline at end of file diff --git a/types/core/engine/command/click.d.ts b/types/core/engine/command/click.d.ts new file mode 100644 index 000000000..27cd95fe1 --- /dev/null +++ b/types/core/engine/command/click.d.ts @@ -0,0 +1,102 @@ +export class Click { + constructor(browser: any, pageCompleteCheck: any); + browser: any; + pageCompleteCheck: any; + /** + * Click on element that is found by specific class name. + * https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName + * ; + * @param {string} className + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byClassName(className: string): Promise; + /** + * Click on element that is found by specific class name and wait for page load complete check to finish. + * @param {string} className + * @returns {Promise} Promise object represents when the element has been clicked and the pageCompleteCheck has finisshed. + * @throws Will throw an error if the element is not found + */ + byClassNameAndWait(className: string): Promise; + /** + * Click on link whose visible text matches the given string. + * @param {string} text + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byLinkText(text: string): Promise; + /** + * Click on link whose visible text matches the given string and wait for pageCompleteCheck to finish. + * @param {string} text + * @returns {Promise} Promise object represents when the element has been clicked and the pageCompleteCheck has finished. + * @throws Will throw an error if the element is not found + */ + byLinkTextAndWait(text: string): Promise; + /** + * Click on link whose visible text contains the given substring. + * @param {string} text + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byPartialLinkText(text: string): Promise; + /** + * Click on link whose visible text contains the given substring and wait for pageCompleteCheck to finish. + * @param {string} text + * @returns {Promise} Promise object represents when the element has been clicked and the pageCompleteCheck has finished. + * @throws Will throw an error if the element is not found + */ + byPartialLinkTextAndWait(text: string): Promise; + /** + * Click on link that matches a XPath selector. + * @param {string} xpath + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byXpath(xpath: string): Promise; + /**. + * Click on link that matches a XPath selector and wait for page load complete check to finish + * + * @param {string} xpath + * @returns {Promise} Promise object represents when the element has been clicked and the pageCompleteCheck has finished. + * @throws Will throw an error if the element is not found + */ + byXpathAndWait(xpath: string): Promise; + /** + * Click on a link located by evaluating a JavaScript expression. The result of this expression must be an element or list of elements. + * @param {string} js + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byJs(js: string): Promise; + /** + * Click on a link located by evaluating a JavaScript expression. The result of this expression must be an element or list of elements. And wait for page complete check to finish. + * @param {string} js + * @returns {Promise} Promise object represents when the element has been clicked and the pageCompleteCheck has finished. + * @throws Will throw an error if the element is not found + */ + byJsAndWait(js: string): Promise; + /** + * Click on link located by the ID attribute. Uses document.getElementById(). + * @param {string} id + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byId(id: string): Promise; + /** + * Click on element located by the name, Uses document.querySelector. + * @param {string} name the name of the element + * @returns {Promise} Promise object represents when the element has been clicked + * @throws Will throw an error if the element is not found + */ + byName(name: string): Promise; + /** + * Click on link located by the ID attribute. Uses document.getElementById() to find the element. And wait for page complete check to finish. + * @param {string} id + * @returns {Promise} Promise object represents when the element has been clicked and the pageCompleteCheck has finished. + * @throws Will throw an error if the element is not found + */ + byIdAndWait(id: string): Promise; + bySelector(selector: any): Promise; + bySelectorAndWait(selector: any): Promise; +} +//# sourceMappingURL=click.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/click.d.ts.map b/types/core/engine/command/click.d.ts.map new file mode 100644 index 000000000..d2f91fba6 --- /dev/null +++ b/types/core/engine/command/click.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/click.js"],"names":[],"mappings":"AAYA;IACE,kDAGC;IAFC,aAAsB;IACtB,uBAA0C;IAG5C;;;;;;;OAOG;IACH,uBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,8BAJW,MAAM,gBAchB;IAED;;;;;OAKG;IACH,iBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,+BAJW,MAAM,gBAahB;IACD;;;;;OAKG;IACH,eAJW,MAAM,gBAehB;IACD;;;;;;OAMG;IACH,sBAJW,MAAM,gBAgBhB;IAED;;;;;OAKG;IACH,SAJY,MAAM,gBAajB;IAED;;;;;OAKG;IACH,gBAJY,MAAM,gBAcjB;IAED;;;;;OAKG;IACH,SAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,aAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,gBAchB;IAED,yCASC;IAED,+CAUC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/debug.d.ts b/types/core/engine/command/debug.d.ts new file mode 100644 index 000000000..d60c2770c --- /dev/null +++ b/types/core/engine/command/debug.d.ts @@ -0,0 +1,11 @@ +export class Debug { + constructor(browser: any, options: any); + browser: any; + options: any; + /** + * Add a breakpoint to script. The browser will wait at the breakpoint for user input. + * @returns {Promise} Promise object that is fulfilled when the user move on from the breakpoint. + */ + breakpoint(name: any): Promise; +} +//# sourceMappingURL=debug.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/debug.d.ts.map b/types/core/engine/command/debug.d.ts.map new file mode 100644 index 000000000..bf28ab37b --- /dev/null +++ b/types/core/engine/command/debug.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/debug.js"],"names":[],"mappings":"AAIA;IACE,wCAGC;IAFC,aAAsB;IACtB,aAAsB;IAGxB;;;OAGG;IACH,oCA6BC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/geckoProfiler.d.ts b/types/core/engine/command/geckoProfiler.d.ts new file mode 100644 index 000000000..bc8542fe7 --- /dev/null +++ b/types/core/engine/command/geckoProfiler.d.ts @@ -0,0 +1,11 @@ +export class GeckoProfiler { + constructor(GeckoProfiler: any, browser: any, index: any, options: any, result: any); + GeckoProfiler: any; + browser: any; + index: any; + options: any; + result: any; + start(): Promise; + stop(): Promise; +} +//# sourceMappingURL=geckoProfiler.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/geckoProfiler.d.ts.map b/types/core/engine/command/geckoProfiler.d.ts.map new file mode 100644 index 000000000..99dedc076 --- /dev/null +++ b/types/core/engine/command/geckoProfiler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geckoProfiler.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/geckoProfiler.js"],"names":[],"mappings":"AAEA;IACE,qFAMC;IALC,mBAAkC;IAClC,aAAsB;IACtB,WAAkB;IAClB,aAAsB;IACtB,YAAoB;IAGtB,sBAYC;IAED,qBAYC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/javaScript.d.ts b/types/core/engine/command/javaScript.d.ts new file mode 100644 index 000000000..75e8e7b88 --- /dev/null +++ b/types/core/engine/command/javaScript.d.ts @@ -0,0 +1,41 @@ +export class JavaScript { + constructor(browser: any, pageCompleteCheck: any); + browser: any; + pageCompleteCheck: any; + /** + * Run JavaScript. + * @param {string} js + * @returns {Promise} Promise object represents when the JavaScript has been executed by the browser + * @throws Will throw an error if the JavsScript can't run + */ + run(js: string): Promise; + /** + * Run JavaScript and wait for page complete check to finish. + * @param {string} js + * @returns {Promise} Promise object represents when the JavaScript has been executed by the browser and the page complete check is done. + * @throws Will throw an error if the JavsScript can't run + */ + runAndWait(js: string): Promise; + /** + * Run synchronous privileged JavaScript. + * @param {string} js + * @returns {Promise} Promise object represents when the JavaScript has been executed by the browser + * @throws Will throw an error if the JavsScript can't run + */ + runPrivileged(js: string): Promise; + /** + * Run synchronous privileged JavaScript and wait for page complete check to finish. + * @param {string} js + * @returns {Promise} Promise object represents when the JavaScript has been executed by the browser and the page complete check is done. + * @throws Will throw an error if the JavsScript can't run + */ + runPrivilegedAndWait(js: string): Promise; + /** + * Run asynchronous privileged JavaScript. + * @param {string} js + * @returns {Promise} Promise object represents when the JavaScript has been executed by the browser + * @throws Will throw an error if the JavsScript can't run + */ + runPrivilegedAsync(js: string): Promise; +} +//# sourceMappingURL=javaScript.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/javaScript.d.ts.map b/types/core/engine/command/javaScript.d.ts.map new file mode 100644 index 000000000..dcd1a8557 --- /dev/null +++ b/types/core/engine/command/javaScript.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaScript.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/javaScript.js"],"names":[],"mappings":"AAEA;IACE,kDAGC;IAFC,aAAsB;IACtB,uBAA0C;IAG5C;;;;;OAKG;IACH,QAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,eAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,gBAgBhB;IAED;;;;;OAKG;IACH,yBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,gBAgBhB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/measure.d.ts b/types/core/engine/command/measure.d.ts new file mode 100644 index 000000000..26c6a3c7a --- /dev/null +++ b/types/core/engine/command/measure.d.ts @@ -0,0 +1,61 @@ +export class Measure { + constructor(browser: any, index: any, pageCompleteCheck: any, result: any, engineDelegate: any, extensionServer: any, storageManager: any, videos: any, scriptsByCategory: any, asyncScriptsByCategory: any, postURLScripts: any, context: any, screenshotManager: any, options: any); + browser: any; + pageCompleteCheck: any; + index: any; + result: any; + engineDelegate: any; + options: any; + screenshotManager: any; + storageManager: any; + recordVideo: any; + extensionServer: any; + videos: any; + scriptsByCategory: any; + asyncScriptsByCategory: any; + postURLScripts: any; + context: any; + numberOfMeasuredPages: number; + numberOfVisitedPages: number; + areWeMeasuring: boolean; + testedURLs: {}; + tcpDump: TCPDump; + ANDROID_DELAY_TIME: any; + IOS_DELAY_TIME: any; + DESKTOP_DELAY_TIME: any; + _startVideo(numberOfMeasuredPages: any, index: any): Promise; + video: Video; + _stopVideo(url: any): Promise; + _error(message: any): void; + _failure(message: any): void; + _navigate(url: any): Promise; + /** + * Start collecting metrics for a URL. If you supply a URL to this method, the browser will navigate to that URL. + * If you do not use an URL (start()) everything is prepared for a new page to measure except the browser do not + * navigate to a new URL. You can also add an alias for the URL. + * @param {string} urlOrAlias + * @param {string} optionalAlias + * @returns {Promise} Promise object represents when the URL has been navigated and finished loading according to the pageCompleteCheck or when everything is setup for measuring a new URL (if no URL is supplied). + */ + start(urlOrAlias: string, optionalAlias: string): Promise; + /** + * Stop measuring and collect all the metrics. + * @returns {Promise} Promise object represents all the metrics has been collected. + */ + stop(testedStartUrl: any): Promise; + /** + * Add your own metric. + * @param {string} name + * @param {*} value + */ + add(name: string, value: any): void; + /** + * Add your own metrics. You can add an object witch multiple keys and they will all be collected. + * @param {*} object + */ + addObject(object: any): void; + collect(url: any): Promise; +} +import { TCPDump } from '../../../support/tcpdump.js'; +import { Video } from '../../../video/video.js'; +//# sourceMappingURL=measure.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/measure.d.ts.map b/types/core/engine/command/measure.d.ts.map new file mode 100644 index 000000000..b9b41e82c --- /dev/null +++ b/types/core/engine/command/measure.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/measure.js"],"names":[],"mappings":"AA6BA;IACE,sRAwCC;IAxBC,aAAsB;IACtB,uBAA0C;IAC1C,WAAkB;IAClB,YAAoB;IACpB,oBAAoC;IACpC,aAAsB;IACtB,uBAA0C;IAC1C,oBAAoC;IACpC,iBAAyD;IACzD,qBAAsC;IACtC,YAAoB;IACpB,uBAA0C;IAC1C,4BAAoD;IACpD,oBAAoC;IACpC,aAAsB;IACtB,8BAA8B;IAC9B,6BAA6B;IAC7B,wBAA2B;IAC3B,eAAoB;IACpB,iBAA6D;IAE7D,wBAAsE;IACtE,oBAA8D;IAC9D,wBAAqE;IAIvE,kEAsBC;IArBC,aAAuE;IAuBzE,oCAKC;IAED,2BAsBC;IAED,6BAQC;IAED,kCAuBC;IAED;;;;;;;OAOG;IACH,kBAJW,MAAM,iBACN,MAAM,gBAyFhB;IAED;;;OAGG;IACH,wCA8DC;IAED;;;;OAIG;IACH,UAHW,MAAM,oBAWhB;IAED;;;OAGG;IACH,6BAOC;IAED,iCA+KC;CACF;wBAzgBuB,6BAA6B;sBAL/B,yBAAyB"} \ No newline at end of file diff --git a/types/core/engine/command/meta.d.ts b/types/core/engine/command/meta.d.ts new file mode 100644 index 000000000..1a0dce177 --- /dev/null +++ b/types/core/engine/command/meta.d.ts @@ -0,0 +1,7 @@ +export class Meta { + setDescription(text: any): void; + description: any; + setTitle(text: any): void; + title: any; +} +//# sourceMappingURL=meta.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/meta.d.ts.map b/types/core/engine/command/meta.d.ts.map new file mode 100644 index 000000000..f05a9505a --- /dev/null +++ b/types/core/engine/command/meta.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/meta.js"],"names":[],"mappings":"AAAA;IAGE,gCAEC;IADC,iBAAuB;IAEzB,0BAEC;IADC,WAAiB;CAEpB"} \ No newline at end of file diff --git a/types/core/engine/command/mouse/clickAndHold.d.ts b/types/core/engine/command/mouse/clickAndHold.d.ts new file mode 100644 index 000000000..2167cd792 --- /dev/null +++ b/types/core/engine/command/mouse/clickAndHold.d.ts @@ -0,0 +1,56 @@ +export class ClickAndHold { + constructor(browser: any); + driver: any; + actions: any; + /** + * Click and hold an element that matches a XPath selector. + * @param {string} xpath + * @returns {Promise} Promise object represents when mouse is pressed. + * @throws Will throw an error if the element is not found. + */ + byXpath(xpath: string): Promise; + /** + * Click and hold an element that matches a CSS selector. + * @param {string} selector + * @returns {Promise} Promise object represents when mouse is pressed. + * @throws Will throw an error if the element is not found. + */ + bySelector(selector: string): Promise; + /** + * Click and hold an element at the cursor's position. + * @returns {Promise} Promise object represents when mouse is pressed. + * @throws Will throw an error if action cannot be performed. + */ + atCursor(): Promise; + /** + * Click and hold an element at the given coordinates. + * @param {integer} xPos + * @param {integer} yPos + * @returns {Promise} Promise object represents when mouse is pressed. + * @throws Will throw an error if action cannot be performed. + */ + atPosition(xPos: integer, yPos: integer): Promise; + /** + * Release mouse on element that matches the specified Xpath. + * @param {string} xpath + * @returns {Promise} Promise object represents when mouse is released. + * @throws Will throw an error if action cannot be performed. + */ + releaseAtXpath(xpath: string): Promise; + /** + * Release mouse on element that matches the specified CSS selector. + * @param {string} selector + * @returns {Promise} Promise object represents when mouse is released. + * @throws Will throw an error if action cannot be performed. + */ + releaseAtSelector(selector: string): Promise; + /** + * Release mouse at specified coordinates. + * @param {integer} xPos + * @param {integer} yPos + * @returns {Promise} Promise object represents when mouse is released. + * @throws Will throw an error if action cannot be performed. + */ + releaseAtPosition(xPos: integer, yPos: integer): Promise; +} +//# sourceMappingURL=clickAndHold.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/mouse/clickAndHold.d.ts.map b/types/core/engine/command/mouse/clickAndHold.d.ts.map new file mode 100644 index 000000000..91ed09d31 --- /dev/null +++ b/types/core/engine/command/mouse/clickAndHold.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clickAndHold.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/clickAndHold.js"],"names":[],"mappings":"AAGA;IACE,0BAGC;IAFC,YAAiC;IACjC,aAAmD;IAGrD;;;;;OAKG;IACH,eAJW,MAAM,gBAehB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,gBAkBhB;IAED;;;;OAIG;IACH,yBAQC;IAED;;;;;;OAMG;IACH,uDAaC;IAED;;;;;OAKG;IACH,sBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,4BAJW,MAAM,gBAahB;IAED;;;;;;OAMG;IACH,8DAaC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/mouse/contextClick.d.ts b/types/core/engine/command/mouse/contextClick.d.ts new file mode 100644 index 000000000..a2ec900c8 --- /dev/null +++ b/types/core/engine/command/mouse/contextClick.d.ts @@ -0,0 +1,26 @@ +export class ContextClick { + constructor(browser: any); + driver: any; + actions: any; + /** + * Perform ContextClick on an element that matches a XPath selector. + * @param {string} xpath + * @returns {Promise} Promise object represents when context click occurs. + * @throws Will throw an error if the element is not found + */ + byXpath(xpath: string): Promise; + /** + * Perform ContextClick on an element that matches a CSS selector. + * @param {string} css selector + * @returns {Promise} Promise object represents when context click occurs. + * @throws Will throw an error if the element is not found + */ + bySelector(selector: any): Promise; + /** + * Perform ContextClick at the cursor's position. + * @returns {Promise} Promise object represents when context click occurs. + * @throws Will throw an error if context click cannot be performed. + */ + atCursor(): Promise; +} +//# sourceMappingURL=contextClick.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/mouse/contextClick.d.ts.map b/types/core/engine/command/mouse/contextClick.d.ts.map new file mode 100644 index 000000000..7a321b9a8 --- /dev/null +++ b/types/core/engine/command/mouse/contextClick.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"contextClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/contextClick.js"],"names":[],"mappings":"AAGA;IACE,0BAGC;IAFC,YAAiC;IACjC,aAAmD;IAGrD;;;;;OAKG;IACH,eAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,wCAWC;IAED;;;;OAIG;IACH,yBAQC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/mouse/doubleClick.d.ts b/types/core/engine/command/mouse/doubleClick.d.ts new file mode 100644 index 000000000..ef13983ad --- /dev/null +++ b/types/core/engine/command/mouse/doubleClick.d.ts @@ -0,0 +1,27 @@ +export class DoubleClick { + constructor(browser: any, pageCompleteCheck: any); + browser: any; + actions: any; + pageCompleteCheck: any; + /** + * Perform mouse double click on an element matches a XPath selector. + * @param {string} xpath + * @returns {Promise} Promise object represents when the element has been double clicked. + * @throws Will throw an error if the element is not found. + */ + byXpath(xpath: string, options: any): Promise; + /** + * Perform mouse double click on an element matches a CSS selector. + * @param {string} selector + * @returns {Promise} Promise object represents when the element has been double clicked. + * @throws Will throw an error if the element is not found. + */ + bySelector(selector: string, options: any): Promise; + /** + * Perform mouse double click at the cursor's position. + * @returns {Promise} Promise object represents when double click occurs. + * @throws Will throw an error if double click cannot be performed. + */ + atCursor(options: any): Promise; +} +//# sourceMappingURL=doubleClick.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/mouse/doubleClick.d.ts.map b/types/core/engine/command/mouse/doubleClick.d.ts.map new file mode 100644 index 000000000..98eb75236 --- /dev/null +++ b/types/core/engine/command/mouse/doubleClick.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"doubleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/doubleClick.js"],"names":[],"mappings":"AAGA;IACE,kDAIC;IAHC,aAAsB;IACtB,aAAgE;IAChE,uBAA0C;IAG5C;;;;;OAKG;IACH,eAJW,MAAM,8BAkBhB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,8BAoBhB;IAED;;;;OAIG;IACH,qCAWC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/mouse/index.d.ts b/types/core/engine/command/mouse/index.d.ts new file mode 100644 index 000000000..12ea872f5 --- /dev/null +++ b/types/core/engine/command/mouse/index.d.ts @@ -0,0 +1,6 @@ +export { ClickAndHold } from "./clickAndHold.js"; +export { DoubleClick } from "./doubleClick.js"; +export { ContextClick } from "./contextClick.js"; +export { SingleClick } from "./singleClick.js"; +export { MouseMove } from "./mouseMove.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/mouse/index.d.ts.map b/types/core/engine/command/mouse/index.d.ts.map new file mode 100644 index 000000000..6ecf8ff1a --- /dev/null +++ b/types/core/engine/command/mouse/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/index.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/core/engine/command/mouse/mouseMove.d.ts b/types/core/engine/command/mouse/mouseMove.d.ts new file mode 100644 index 000000000..571249a1b --- /dev/null +++ b/types/core/engine/command/mouse/mouseMove.d.ts @@ -0,0 +1,34 @@ +export class MouseMove { + constructor(browser: any); + driver: any; + actions: any; + /** + * Move mouse to an element that matches a XPath selector. + * @param {string} xpath + * @returns {Promise} Promise object represents when the mouse has moved + * @throws Will throw an error if the element is not found + */ + byXpath(xpath: string): Promise; + /** + * Move mouse to an element that matches a CSS selector. + * @param {string} selector + * @returns {Promise} Promise object represents when the mouse has moved + * @throws Will throw an error if the element is not found + */ + bySelector(selector: string): Promise; + /** + * Move mouse to a position + * @param {number} xPos, {number} yPos + * @returns {Promise} Promise object represents when the mouse has moved + * @throws Will throw an error if the element is not found + */ + toPosition(xPos: number, yPos: any): Promise; + /** + * Move mouse by an offset + * @param {number} xOffset, {number} yOffset + * @returns {Promise} Promise object represents when the mouse has moved + * @throws Will throw an error if the element is not found + */ + byOffset(xOffset: number, yOffset: any): Promise; +} +//# sourceMappingURL=mouseMove.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/mouse/mouseMove.d.ts.map b/types/core/engine/command/mouse/mouseMove.d.ts.map new file mode 100644 index 000000000..19e787c44 --- /dev/null +++ b/types/core/engine/command/mouse/mouseMove.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mouseMove.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/mouseMove.js"],"names":[],"mappings":"AAGA;IACE,0BAGC;IAFC,YAAiC;IACjC,aAAmD;IAGrD;;;;;OAKG;IACH,eAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,gBAahB;IAED;;;;;OAKG;IACH,iBAJW,MAAM,2BAYhB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,8BAchB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/mouse/singleClick.d.ts b/types/core/engine/command/mouse/singleClick.d.ts new file mode 100644 index 000000000..4a753fa78 --- /dev/null +++ b/types/core/engine/command/mouse/singleClick.d.ts @@ -0,0 +1,28 @@ +export class SingleClick { + constructor(browser: any, pageCompleteCheck: any); + browser: any; + actions: any; + pageCompleteCheck: any; + /** + * Perform mouse single click on an element matches a XPath selector. + * @param {string} xpath + * @returns {Promise} Promise object represents when the element has been clicked. + * @throws Will throw an error if the element is not found. + */ + byXpath(xpath: string, options: any): Promise; + /** + * Perform mouse single click on an element matches a CSS selector. + * @param {string} selector + * @returns {Promise} Promise object represents when the element has been clicked. + * @throws Will throw an error if the element is not found. + */ + bySelector(selector: string, options: any): Promise; + /** + * Perform mouse single click at the cursor's position. + * @param {string} xpath + * @returns {Promise} Promise object represents when double click occurs. + * @throws Will throw an error if double click cannot be performed. + */ + atCursor(options: any): Promise; +} +//# sourceMappingURL=singleClick.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/mouse/singleClick.d.ts.map b/types/core/engine/command/mouse/singleClick.d.ts.map new file mode 100644 index 000000000..3375462d6 --- /dev/null +++ b/types/core/engine/command/mouse/singleClick.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"singleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/singleClick.js"],"names":[],"mappings":"AAGA;IACE,kDAIC;IAHC,aAAsB;IACtB,aAAgE;IAChE,uBAA0C;IAG5C;;;;;OAKG;IACH,eAJW,MAAM,8BAkBhB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,8BAoBhB;IAED;;;;;OAKG;IACH,qCAWC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/navigation.d.ts b/types/core/engine/command/navigation.d.ts new file mode 100644 index 000000000..b48b7894c --- /dev/null +++ b/types/core/engine/command/navigation.d.ts @@ -0,0 +1,18 @@ +export class Navigation { + constructor(browser: any, pageCompleteCheck: any); + browser: any; + pageCompleteCheck: any; + /** + * Navigate backward in history + */ + back(options: any): Promise; + /** + * Navigate forward in history + */ + forward(options: any): Promise; + /** + * Refresh page + */ + refresh(options: any): Promise; +} +//# sourceMappingURL=navigation.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/navigation.d.ts.map b/types/core/engine/command/navigation.d.ts.map new file mode 100644 index 000000000..ebc3c884d --- /dev/null +++ b/types/core/engine/command/navigation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/navigation.js"],"names":[],"mappings":"AAGA;IACE,kDAGC;IAFC,aAAsB;IACtB,uBAA0C;IAG5C;;OAEG;IACH,iCAYC;IAED;;OAEG;IACH,oCAYC;IAED;;OAEG;IACH,oCAYC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/screenshot.d.ts b/types/core/engine/command/screenshot.d.ts new file mode 100644 index 000000000..0577a8dfc --- /dev/null +++ b/types/core/engine/command/screenshot.d.ts @@ -0,0 +1,8 @@ +export class Screenshot { + constructor(screenshotManager: any, browser: any, index: any); + screenshotManager: any; + browser: any; + index: any; + take(name: any): Promise; +} +//# sourceMappingURL=screenshot.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/screenshot.d.ts.map b/types/core/engine/command/screenshot.d.ts.map new file mode 100644 index 000000000..bbb9cbb20 --- /dev/null +++ b/types/core/engine/command/screenshot.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/screenshot.js"],"names":[],"mappings":"AAAA;IACE,8DAIC;IAHC,uBAA0C;IAC1C,aAAsB;IACtB,WAAkB;IAGpB,8BAMC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/scroll.d.ts b/types/core/engine/command/scroll.d.ts new file mode 100644 index 000000000..c21fbc81a --- /dev/null +++ b/types/core/engine/command/scroll.d.ts @@ -0,0 +1,31 @@ +export class Scroll { + constructor(browser: any, options: any); + browser: any; + options: any; + /** + * Scroll the page by the specified pixels. + * @param {number} X pixels and Y pixels + * @returns {Promise} Promise object represents when scrolling the page has been + */ + byPixels(Xpixels: any, Ypixels: any): Promise; + /** + * Scroll the page by the specified lines. Only supported by Firefox. + * @param {number} Lines + * @returns {Promise} Promise object represents when scrolling the page has been finished. + * @throws Will throw an error if window.scrollByLines generates an error. + */ + byLines(lines: any): Promise; + /** + * Scroll the page by the specified pages. + * @param {number} Pages + * @returns {Promise} Promise object represents when scrolling the page has been finished. + */ + byPages(pages: any): Promise; + /** + * Scroll to the bottom of the page. Will scroll page by page and wait the delayTime between each scroll. Default delay time is 250 ms + * @param {number} delayTime + * @returns {Promise} Promise object represents when scrolling the page has been finished. + */ + toBottom(delayTime?: number): Promise; +} +//# sourceMappingURL=scroll.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/scroll.d.ts.map b/types/core/engine/command/scroll.d.ts.map new file mode 100644 index 000000000..d1e785bc1 --- /dev/null +++ b/types/core/engine/command/scroll.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/scroll.js"],"names":[],"mappings":"AAGA;IACE,wCAGC;IAFC,aAAsB;IACtB,aAAsB;IAGxB;;;;OAIG;IACH,mDAGC;IAED;;;;;OAKG;IACH,kCAYC;IAED;;;;OAIG;IACH,kCAUC;IAED;;;;OAIG;IACH,qBAHW,MAAM,gBAgBhB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/select.d.ts b/types/core/engine/command/select.d.ts new file mode 100644 index 000000000..72a4bcbe7 --- /dev/null +++ b/types/core/engine/command/select.d.ts @@ -0,0 +1,62 @@ +export class Select { + constructor(browser: any); + browser: any; + /** + * Select value of a select by the selects id + * @param {string} selectId The id of the select + * @param {string} value The value of the option you want to set + * @returns {Promise} Promise object represents when the option has been + * set to the element + * @throws Will throw an error if the select is not found + */ + selectByIdAndValue(selectId: string, value: string): Promise; + /** + * Select value of a select by the selects name + * @param {string} selectName The name of the select + * @param {string} value The value of the option you want to set + * @returns {Promise} Promise object represents when the option has been + * set to the element + * @throws Will throw an error if the select is not found + */ + selectByNameAndValue(selectName: string, value: string): Promise; + /** + * Select value of a select index and by the selects id + * @param {string} selectId The id of the select + * @param {number} index the index of the option you want to set + * @returns {Promise} Promise object represents when the option has been + * set to the element + * @throws Will throw an error if the select is not found + */ + selectByIdAndIndex(selectId: string, index: number): Promise; + /** + * Select value of a select index and by the selects name + * @param {string} selectName - the name of the select + * @param {number} index - the index of the option you want to set + * @returns {Promise} Promise object represents when the option has been + * set to the element + * @throws Will throw an error if the select is not found + */ + selectByNameAndIndex(selectName: string, index: number): Promise; + /** + * Deselect all options in a select. + * @param {string} selectId + * @returns {Promise} Promise object represents when options been deselected + * @throws Will throw an error if the select is not found + */ + deselectById(selectId: string): Promise; + /** + * Get all option values in a select. + * @param {string} selectId - the id of the select. + * @returns {Promise} Promise object tha will return an array with the values of the select + * @throws Will throw an error if the select is not found + */ + getValuesById(selectId: string): Promise; + /** + * Get the selected option value in a select. + * @param {select} selectId the id of the select. + * @returns {Promise} Promise object tha will return the value of the selected option. + * @throws Will throw an error if the select is not found. + */ + getSelectedValueById(selectId: select): Promise; +} +//# sourceMappingURL=select.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/select.d.ts.map b/types/core/engine/command/select.d.ts.map new file mode 100644 index 000000000..ae44ce482 --- /dev/null +++ b/types/core/engine/command/select.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/select.js"],"names":[],"mappings":"AAGA;IACE,0BAEC;IADC,aAAsB;IAGxB;;;;;;;OAOG;IACH,6BANW,MAAM,SACN,MAAM,gBAchB;IAED;;;;;;;OAOG;IACH,iCANW,MAAM,SACN,MAAM,gBAgBhB;IAED;;;;;;;OAOG;IACH,6BANW,MAAM,SACN,MAAM,gBAkBhB;IAED;;;;;;;OAOG;IACH,iCANW,MAAM,SACN,MAAM,gBAkBhB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,gBAchB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBAqBhB;IAED;;;;;OAKG;IACH,qDAUC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/set.d.ts b/types/core/engine/command/set.d.ts new file mode 100644 index 000000000..7b60724a3 --- /dev/null +++ b/types/core/engine/command/set.d.ts @@ -0,0 +1,59 @@ +export class Set { + constructor(browser: any); + browser: any; + /** + * Set innerHtml to an element using a specific CSS selector. + * @param {string} html The html string that you want to set + * @param {string} selector The selector of the element + * @returns {Promise} Promise object represents when the html has been + * set to the element + * @throws Will throw an error if the element is not found + */ + innerHtml(html: string, selector: string): Promise; + /** + * Set innerHtml to an element using a id + * @param {string} html The html string that you want to set + * @param {string} id The id of the element + * @returns {Promise} Promise object represents when the html has been + * set to the element + * @throws Will throw an error if the element is not found + */ + innerHtmlById(html: string, id: string): Promise; + /** + * Set innerText to an element using a specific CSS selector. + * @param {string} html The html string that you want to set + * @param {string} selector The selector of the element + * @returns {Promise} Promise object represents when the text has been + * set to the element + * @throws Will throw an error if the element is not found + */ + innerText(text: any, selector: string): Promise; + /** + * Set innerText to an element using a id. + * @param {string} html The html string that you want to set + * @param {string} id The id of the element + * @returns {Promise} Promise object represents when the text has been + * set to the element + * @throws Will throw an error if the element is not found + */ + innerTextById(text: any, id: string): Promise; + /** + * Set value to an element using a specific CSS selector. + * @param {string} value The value that you want to set + * @param {string} selector The selector of the element + * @returns {Promise} Promise object represents when the value has been + * added to element + * @throws Will throw an error if the element is not found + */ + value(value: string, selector: string): Promise; + /** + * Set value to an element using a id. + * @param {string} value The value that you want to set + * @param {string} selector The selector of the element + * @returns {Promise} Promise object represents when the value has been + * added to element + * @throws Will throw an error if the element is not found + */ + valueById(value: string, id: any): Promise; +} +//# sourceMappingURL=set.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/set.d.ts.map b/types/core/engine/command/set.d.ts.map new file mode 100644 index 000000000..0b0b8bd89 --- /dev/null +++ b/types/core/engine/command/set.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/set.js"],"names":[],"mappings":"AAGA;IACE,0BAEC;IADC,aAAsB;IAGxB;;;;;;;OAOG;IACH,gBANW,MAAM,YACN,MAAM,gBAgBhB;IAED;;;;;;;OAOG;IACH,oBANW,MAAM,MACN,MAAM,gBAchB;IAED;;;;;;;OAOG;IACH,+BALW,MAAM,gBAgBhB;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,gBAchB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,YACN,MAAM,gBAchB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,yBAehB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/stopWatch.d.ts b/types/core/engine/command/stopWatch.d.ts new file mode 100644 index 000000000..12061eb69 --- /dev/null +++ b/types/core/engine/command/stopWatch.d.ts @@ -0,0 +1,32 @@ +export class StopWatch { + constructor(name: any, measure: any); + name: any; + measure: any; + /** + * Start the the stop watch + */ + start(): void; + /** + * Stop the watch and automatically add the time to the + * last measured page. If no page has been measured you will get + * an error in your log. + * @returns the measured time + */ + stopAndAdd(): number; + /** + * Stop the watch + * @returns the measured time + */ + stop(): number; + /** + * Get the name of the watch. + * @returns The name of the watch + */ + getName(): any; +} +export class Watch { + constructor(measure: any); + measure: any; + get(name: any): StopWatch; +} +//# sourceMappingURL=stopWatch.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/stopWatch.d.ts.map b/types/core/engine/command/stopWatch.d.ts.map new file mode 100644 index 000000000..b74edd6be --- /dev/null +++ b/types/core/engine/command/stopWatch.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stopWatch.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/stopWatch.js"],"names":[],"mappings":"AAGA;IACE,qCAIC;IAHC,UAAgB;IAChB,aAAsB;IAIxB;;OAEG;IACH,cAEC;IAED;;;;;OAKG;IACH,qBAKC;IAED;;;OAGG;IACH,eAIC;IAED;;;OAGG;IACH,eAEC;CACF;AAED;IACE,0BAEC;IADC,aAAsB;IAGxB,0BAEC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/switch.d.ts b/types/core/engine/command/switch.d.ts new file mode 100644 index 000000000..7491b964d --- /dev/null +++ b/types/core/engine/command/switch.d.ts @@ -0,0 +1,39 @@ +export class Switch { + constructor(browser: any, pageCompleteCheck: any, navigate: any); + browser: any; + pageCompleteCheck: any; + navigate: any; + /** + * Switch to frame by id + * @param {*} id + */ + toFrame(id: any): Promise; + /** + * Switch to frame by xpath + * @param {*} xpath + */ + toFrameByXpath(xpath: any): Promise; + /** + * Switch to frame by xpath + * @param {*} xpath + */ + toFrameBySelector(selector: any): Promise; + /** + * Switch to a window by name + * @param {*} name + */ + toWindow(name: any): Promise; + /** + * Switch to parent frame + */ + toParentFrame(): Promise; + /** + * Create a new tab and switch to it. Optionally, navigate to a given url. + */ + toNewTab(url: any): Promise; + /** + * Create a new window and switch to it. Optionally, navigate to a given url. + */ + toNewWindow(url: any): Promise; +} +//# sourceMappingURL=switch.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/switch.d.ts.map b/types/core/engine/command/switch.d.ts.map new file mode 100644 index 000000000..e5df361bd --- /dev/null +++ b/types/core/engine/command/switch.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/switch.js"],"names":[],"mappings":"AAIA;IACE,iEAIC;IAHC,aAAsB;IACtB,uBAA0C;IAC1C,cAAwB;IAG1B;;;OAGG;IACH,gCASC;IAED;;;OAGG;IACH,0CAeC;IAED;;;OAGG;IACH,gDAeC;IAED;;;OAGG;IACH,mCASC;IAED;;OAEG;IACH,+BASC;IAED;;OAEG;IACH,kCAcC;IAED;;OAEG;IACH,qCAcC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/util/lcpHighlightScript.d.ts b/types/core/engine/command/util/lcpHighlightScript.d.ts new file mode 100644 index 000000000..75312e030 --- /dev/null +++ b/types/core/engine/command/util/lcpHighlightScript.d.ts @@ -0,0 +1,2 @@ +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"; +//# sourceMappingURL=lcpHighlightScript.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/util/lcpHighlightScript.d.ts.map b/types/core/engine/command/util/lcpHighlightScript.d.ts.map new file mode 100644 index 000000000..616f7cc3d --- /dev/null +++ b/types/core/engine/command/util/lcpHighlightScript.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lcpHighlightScript.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/util/lcpHighlightScript.js"],"names":[],"mappings":"AAAA,o8DAwCE"} \ No newline at end of file diff --git a/types/core/engine/command/util/lsHighlightScript.d.ts b/types/core/engine/command/util/lsHighlightScript.d.ts new file mode 100644 index 000000000..cab78fa26 --- /dev/null +++ b/types/core/engine/command/util/lsHighlightScript.d.ts @@ -0,0 +1,2 @@ +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"; +//# sourceMappingURL=lsHighlightScript.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/util/lsHighlightScript.d.ts.map b/types/core/engine/command/util/lsHighlightScript.d.ts.map new file mode 100644 index 000000000..bc05472e5 --- /dev/null +++ b/types/core/engine/command/util/lsHighlightScript.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lsHighlightScript.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/util/lsHighlightScript.js"],"names":[],"mappings":"AAAA,0+FAyEE"} \ No newline at end of file diff --git a/types/core/engine/command/wait.d.ts b/types/core/engine/command/wait.d.ts new file mode 100644 index 000000000..688dceb66 --- /dev/null +++ b/types/core/engine/command/wait.d.ts @@ -0,0 +1,49 @@ +export class Wait { + constructor(browser: any, pageCompleteCheck: any); + browser: any; + pageCompleteCheck: any; + /** + * Wait for an element with id to appear for maxTime. + * @param {string} id The id to wait for + * @param {number} maxTime Max time to wait in ms + * @returns {Promise} Promise object represents when the element is found or the time times out + * @throws Will throw an error if the element is not found + */ + byId(id: string, maxTime: number): Promise; + /** + * Wait for an element with xpath to appear for maxTime. + * @param {string} xpath The xpath to wait for + * @param {number} maxTime Max time to wait in ms + * @returns {Promise} Promise object represents when the element is found or the time times out + * @throws Will throw an error if the element is not found + */ + byXpath(xpath: string, maxTime: number): Promise; + /** + * Wait for an element that you find by a selector to appear for maxTime. + * @param {string} selector The selector to find the element to wait for + * @param {number} maxTime Max time to wait in ms + * @returns {Promise} Promise object represents when the element is found or the time times out + * @throws Will throw an error if the element is not found + */ + bySelector(selector: string, maxTime: number): Promise; + /** + * Wait for x ms. + * @param {number} ms The tine in ms to wait. + * @returns {Promise} Promise object represents when the time has timed out. + */ + byTime(ms: number): Promise; + /** + * Wait for the page to finish loading. + * @returns {Promise} Promise object represents when the pageCompleteCheck has finished. + */ + byPageToComplete(): Promise; + /** + * Wait for an condition that will eventually return a truthy-value for maxTime. + * @param {string} jsExpression The js code condition to wait for + * @param {number} maxTime Max time to wait in ms + * @returns {Promise} Promise object represents when the expression becomes truthy or the time times out + * @throws Will throw an error if the condition returned false + */ + byCondition(jsExpression: string, maxTime: number): Promise; +} +//# sourceMappingURL=wait.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/wait.d.ts.map b/types/core/engine/command/wait.d.ts.map new file mode 100644 index 000000000..1eee342da --- /dev/null +++ b/types/core/engine/command/wait.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;IACE,kDAGC;IAFC,aAAsB;IACtB,uBAA0C;IAG5C;;;;;;OAMG;IACH,SALW,MAAM,WACN,MAAM,gBAkBhB;IAED;;;;;;OAMG;IACH,eALW,MAAM,WACN,MAAM,gBAoBhB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,WACN,MAAM,gBAwBhB;IAED;;;;OAIG;IACH,WAHW,MAAM,gBAKhB;IAED;;;OAGG;IACH,iCAEC;IAED;;;;;;OAMG;IACH,0BALW,MAAM,WACN,MAAM,gBAkBhB;CACF"} \ No newline at end of file diff --git a/types/core/engine/commands.d.ts b/types/core/engine/commands.d.ts new file mode 100644 index 000000000..491c5905e --- /dev/null +++ b/types/core/engine/commands.d.ts @@ -0,0 +1,61 @@ +/** + * Represents the set of commands available in a Browsertime script. + * + */ +export class Commands { + 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); + profiler: GeckoProfilerCommand; + trace: ChromeTrace; + android: AndroidCommand; + debug: Debug; + click: Click; + scroll: Scroll; + addText: AddText; + wait: Wait; + measure: Measure; + navigate: any; + navigation: Navigation; + error: any; + markAsFailure: any; + js: JavaScript; + switch: Switch; + set: Set; + stopWatch: StopWatch; + cache: Cache; + meta: Meta; + screenshot: Screenshot; + cdp: ChromeDevelopmentToolsProtocol; + mouse: { + moveTo: MouseMove; + contextClick: ContextClick; + singleClick: SingleClick; + doubleClick: DoubleClick; + clickAndHold: ClickAndHold; + }; + select: Select; +} +import { GeckoProfiler as GeckoProfilerCommand } from './command/geckoProfiler.js'; +import { ChromeTrace } from './command/chromeTrace.js'; +import { AndroidCommand } from './command/android.js'; +import { Debug } from './command/debug.js'; +import { Click } from './command/click.js'; +import { Scroll } from './command/scroll.js'; +import { AddText } from './command/addText.js'; +import { Wait } from './command/wait.js'; +import { Measure } from './command/measure.js'; +import { Navigation } from './command/navigation.js'; +import { JavaScript } from './command/javaScript.js'; +import { Switch } from './command/switch.js'; +import { Set } from './command/set.js'; +import { Watch as StopWatch } from './command/stopWatch.js'; +import { Cache } from './command/cache.js'; +import { Meta } from './command/meta.js'; +import { Screenshot } from './command/screenshot.js'; +import { ChromeDevelopmentToolsProtocol } from './command/chromeDevToolsProtocol.js'; +import { MouseMove } from './command/mouse/index.js'; +import { ContextClick } from './command/mouse/index.js'; +import { SingleClick } from './command/mouse/index.js'; +import { DoubleClick } from './command/mouse/index.js'; +import { ClickAndHold } from './command/mouse/index.js'; +import { Select } from './command/select.js'; +//# sourceMappingURL=commands.d.ts.map \ No newline at end of file diff --git a/types/core/engine/commands.d.ts.map b/types/core/engine/commands.d.ts.map new file mode 100644 index 000000000..057ff015c --- /dev/null +++ b/types/core/engine/commands.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/commands.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH;IACE,sRAgFC;IA7CC,+BAMC;IAKD,mBAAoE;IACpE,wBAAmC;IACnC,aAAwC;IACxC,aAAkD;IAClD,eAA0C;IAC1C,iBAAmC;IACnC,WAAgD;IAChD,iBAAsB;IACtB,cAA+C;IAC/C,uBAA4D;IAC5D,WAAyC;IACzC,mBAAmD;IACnD,eAAoD;IACpD,eAIC;IACD,SAA2B;IAC3B,qBAAuC;IACvC,aAAsE;IACtE,WAAsB;IACtB,uBAAmE;IACnE,oCAAc;IAGd;;;;;;MAMC;IACD,eAAiC;CAEpC;sDAvFqD,4BAA4B;4BAXtD,0BAA0B;+BAHvB,sBAAsB;sBAD/B,oBAAoB;sBAXpB,oBAAoB;uBAuBnB,qBAAqB;wBAxBpB,sBAAsB;qBAEzB,mBAAmB;wBAChB,sBAAsB;2BAsBnB,yBAAyB;2BArBzB,yBAAyB;uBAC7B,qBAAqB;oBAExB,kBAAkB;mCAGH,wBAAwB;sBAFrC,oBAAoB;qBACrB,mBAAmB;2BAHb,yBAAyB;+CASL,qCAAqC;0BAQ7E,0BAA0B;6BAA1B,0BAA0B;4BAA1B,0BAA0B;4BAA1B,0BAA0B;6BAA1B,0BAA0B;uBAZV,qBAAqB"} \ No newline at end of file diff --git a/types/core/engine/context.d.ts b/types/core/engine/context.d.ts new file mode 100644 index 000000000..77c8be512 --- /dev/null +++ b/types/core/engine/context.d.ts @@ -0,0 +1,51 @@ +/** + * Class representing the context of a Browsertime run. + * + * @class + */ +export class Context { + /** + * Creates an instance of Context. + * + * @param {Object} options - Configuration options for the Browsertime run. + * @param {Object} result - Object to store the results of the Browsertime run. + * @param {intel.Logger} log - Logger for recording events or errors. + * @param {import('../../support/storageManager.js').StorageManager} storageManager - Manages storage for the Browsertime run. + * @param {number} index - Index representing the current iteration or run. + * @param {import('selenium-webdriver').WebDriver} webdriver - WebDriver instance from Selenium for browser automation. + * @param {import('selenium-webdriver').WebDriver} instantiatedDriver - WebDriver instance returned by Selenium's `builder.build()`. + */ + constructor(options: any, result: any, log: intel.Logger, storageManager: import('../../support/storageManager.js').StorageManager, index: number, webdriver: import('selenium-webdriver').WebDriver, instantiatedDriver: import('selenium-webdriver').WebDriver); + /** + * @type {Object} + */ + options: any; + /** + * @type {Object} + */ + result: any; + /** + * @type {intel.Logger} + */ + log: intel.Logger; + /** + * @type {number} + */ + index: number; + /** + * @type {import('../../support/storageManager.js').StorageManager} + */ + storageManager: import('../../support/storageManager.js').StorageManager; + /** + * @type {Object} + */ + taskData: any; + /** + * @type {{webdriver: import('selenium-webdriver').WebDriver, driver: import('selenium-webdriver').WebDriver}} + */ + selenium: { + webdriver: import('selenium-webdriver').WebDriver; + driver: import('selenium-webdriver').WebDriver; + }; +} +//# sourceMappingURL=context.d.ts.map \ No newline at end of file diff --git a/types/core/engine/context.d.ts.map b/types/core/engine/context.d.ts.map new file mode 100644 index 000000000..227e09827 --- /dev/null +++ b/types/core/engine/context.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/context.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;IACE;;;;;;;;;;OAUG;IACH,0EALW,OAAO,iCAAiC,EAAE,cAAc,SACxD,MAAM,aACN,OAAO,oBAAoB,EAAE,SAAS,sBACtC,OAAO,oBAAoB,EAAE,SAAS,EAgDhD;IArCC;;OAEG;IACH,aAAsB;IAEtB;;OAEG;IACH,YAAoB;IAEpB;;OAEG;IACH,kBAAc;IAEd;;OAEG;IACH,OAFU,MAAM,CAEE;IAElB;;OAEG;IACH,gBAFU,OAAO,iCAAiC,EAAE,cAAc,CAE9B;IAEpC;;OAEG;IACH,cAAkB;IAElB;;OAEG;IACH;mBAFsB,OAAO,oBAAoB,EAAE,SAAS;gBAAU,OAAO,oBAAoB,EAAE,SAAS;MAK3G;CAEJ"} \ No newline at end of file diff --git a/types/firefox/geckoProfiler.d.ts b/types/firefox/geckoProfiler.d.ts new file mode 100644 index 000000000..64c0f4949 --- /dev/null +++ b/types/firefox/geckoProfiler.d.ts @@ -0,0 +1,11 @@ +export class GeckoProfiler { + constructor(runner: any, storageManager: any, options: any); + runner: any; + storageManager: any; + firefoxConfig: any; + options: any; + start(): Promise; + stop(index: any, url: any, result: any): Promise; + addMetaData(): void; +} +//# sourceMappingURL=geckoProfiler.d.ts.map \ No newline at end of file diff --git a/types/firefox/geckoProfiler.d.ts.map b/types/firefox/geckoProfiler.d.ts.map new file mode 100644 index 000000000..2142f64aa --- /dev/null +++ b/types/firefox/geckoProfiler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geckoProfiler.d.ts","sourceRoot":"","sources":["../../lib/firefox/geckoProfiler.js"],"names":[],"mappings":"AAmDA;IACE,4DAKC;IAJC,YAAoB;IACpB,oBAAoC;IACpC,mBAAoC;IACpC,aAAsB;IAGxB,sBA2FC;IAED,uDAgGC;IAED,oBAAgB;CACjB"} \ No newline at end of file diff --git a/types/firefox/settings/geckoProfilerDefaults.d.ts b/types/firefox/settings/geckoProfilerDefaults.d.ts new file mode 100644 index 000000000..330e723a1 --- /dev/null +++ b/types/firefox/settings/geckoProfilerDefaults.d.ts @@ -0,0 +1,8 @@ +export namespace geckoProfilerDefaults { + let features: string; + let threads: string; + let desktopSamplingInterval: number; + let androidSamplingInterval: number; + let bufferSize: number; +} +//# sourceMappingURL=geckoProfilerDefaults.d.ts.map \ No newline at end of file diff --git a/types/firefox/settings/geckoProfilerDefaults.d.ts.map b/types/firefox/settings/geckoProfilerDefaults.d.ts.map new file mode 100644 index 000000000..fb4177f35 --- /dev/null +++ b/types/firefox/settings/geckoProfilerDefaults.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geckoProfilerDefaults.d.ts","sourceRoot":"","sources":["../../../lib/firefox/settings/geckoProfilerDefaults.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/scripting.d.ts b/types/scripting.d.ts new file mode 100644 index 000000000..df3cab801 --- /dev/null +++ b/types/scripting.d.ts @@ -0,0 +1,2 @@ +export { Context as BrowsertimeContext } from './core/engine/context'; +export { Commands as BrowsertimeCommands } from './core/engine/commands'; \ No newline at end of file diff --git a/types/support/engineUtils.d.ts b/types/support/engineUtils.d.ts new file mode 100644 index 000000000..d25495110 --- /dev/null +++ b/types/support/engineUtils.d.ts @@ -0,0 +1,5 @@ +export function loadPrePostScripts(scripts: any, options: any): Promise; +export function loadPageCompleteScript(script: any): Promise; +export function loadScript(script: any, options: any, throwError: any): Promise; +export function timestamp(): string; +//# sourceMappingURL=engineUtils.d.ts.map \ No newline at end of file diff --git a/types/support/engineUtils.d.ts.map b/types/support/engineUtils.d.ts.map new file mode 100644 index 000000000..28ae59573 --- /dev/null +++ b/types/support/engineUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"engineUtils.d.ts","sourceRoot":"","sources":["../../lib/support/engineUtils.js"],"names":[],"mappings":"AAgFA,+EAOC;AAED,kEAKC;AAED,qFAKC;AACD,oCAEC"} \ No newline at end of file diff --git a/types/support/errors.d.ts b/types/support/errors.d.ts new file mode 100644 index 000000000..bc2af1335 --- /dev/null +++ b/types/support/errors.d.ts @@ -0,0 +1,15 @@ +export class BrowsertimeError extends Error { + constructor(message: any, extra: any); + extra: any; +} +export class BrowserError extends BrowsertimeError { +} +export class UrlLoadError extends BrowsertimeError { + constructor(message: any, url: any, extra: any); + url: any; +} +export class TimeoutError extends BrowsertimeError { + constructor(message: any, url: any, extra: any); + url: any; +} +//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/types/support/errors.d.ts.map b/types/support/errors.d.ts.map new file mode 100644 index 000000000..cab78c68f --- /dev/null +++ b/types/support/errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../lib/support/errors.js"],"names":[],"mappings":"AAAA;IACE,sCAIC;IAFC,WAAwB;CAG3B;AAED;CAIC;AAED;IACE,gDAGC;IADC,SAAc;CAEjB;AAED;IACE,gDAGC;IADC,SAAc;CAEjB"} \ No newline at end of file diff --git a/types/support/fileUtil.d.ts b/types/support/fileUtil.d.ts new file mode 100644 index 000000000..405fb091d --- /dev/null +++ b/types/support/fileUtil.d.ts @@ -0,0 +1,10 @@ +export function rename(old: any, newName: any): Promise; +export function copyFileSync(source: any, destination: any): void; +export function removeFileSync(fileName: any): Promise; +export function copyFile(source: any, destination: any): Promise; +export function removeFile(fileName: any): Promise; +export function readFile(fileName: any): Promise; +export function removeDirAndFiles(dirName: any): Promise; +export function removeByType(dir: any, type: any): Promise; +export function findFiles(dir: any, filter: any): Promise; +//# sourceMappingURL=fileUtil.d.ts.map \ No newline at end of file diff --git a/types/support/fileUtil.d.ts.map b/types/support/fileUtil.d.ts.map new file mode 100644 index 000000000..cd7b3f60c --- /dev/null +++ b/types/support/fileUtil.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fileUtil.d.ts","sourceRoot":"","sources":["../../lib/support/fileUtil.js"],"names":[],"mappings":"AAwBA,8DAEC;AAED,kEAEC;AAED,6DAEC;AAED,uEAEC;AACD,yDAEC;AACD,yDAEC;AACD,+DAqBC;AACD,iEAUC;AACD,oEAMC"} \ No newline at end of file diff --git a/types/support/filters.d.ts b/types/support/filters.d.ts new file mode 100644 index 000000000..92a29d7b9 --- /dev/null +++ b/types/support/filters.d.ts @@ -0,0 +1,7 @@ +/** + * Filters to use with Array.prototype.filter, e.g. ['/a/path', '/another/path'].filter(onlyFiles) + */ +export function onlyWithExtension(extension: any): (filepath: any) => boolean; +export function onlyFiles(filepath: any): Promise; +export function onlyDirectories(filepath: any): Promise; +//# sourceMappingURL=filters.d.ts.map \ No newline at end of file diff --git a/types/support/filters.d.ts.map b/types/support/filters.d.ts.map new file mode 100644 index 000000000..7a57cb576 --- /dev/null +++ b/types/support/filters.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../lib/support/filters.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,8EAEC;AACD,2DAGC;AACD,iEAGC"} \ No newline at end of file diff --git a/types/support/getViewPort.d.ts b/types/support/getViewPort.d.ts new file mode 100644 index 000000000..f83c37620 --- /dev/null +++ b/types/support/getViewPort.d.ts @@ -0,0 +1,2 @@ +export function getViewPort(options: any): any; +//# sourceMappingURL=getViewPort.d.ts.map \ No newline at end of file diff --git a/types/support/getViewPort.d.ts.map b/types/support/getViewPort.d.ts.map new file mode 100644 index 000000000..48369bddc --- /dev/null +++ b/types/support/getViewPort.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getViewPort.d.ts","sourceRoot":"","sources":["../../lib/support/getViewPort.js"],"names":[],"mappings":"AA+BA,+CAkCC"} \ No newline at end of file diff --git a/types/support/pathToFolder.d.ts b/types/support/pathToFolder.d.ts new file mode 100644 index 000000000..3c98c2f6b --- /dev/null +++ b/types/support/pathToFolder.d.ts @@ -0,0 +1,2 @@ +export function pathToFolder(url: any, options: any): string; +//# sourceMappingURL=pathToFolder.d.ts.map \ No newline at end of file diff --git a/types/support/pathToFolder.d.ts.map b/types/support/pathToFolder.d.ts.map new file mode 100644 index 000000000..e3833511a --- /dev/null +++ b/types/support/pathToFolder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pathToFolder.d.ts","sourceRoot":"","sources":["../../lib/support/pathToFolder.js"],"names":[],"mappings":"AAWA,6DAwDC"} \ No newline at end of file diff --git a/types/support/storageManager.d.ts b/types/support/storageManager.d.ts new file mode 100644 index 000000000..4d8ded5c1 --- /dev/null +++ b/types/support/storageManager.d.ts @@ -0,0 +1,17 @@ +export class StorageManager { + constructor(url: any, { resultDir, prettyPrint }?: { + resultDir: any; + prettyPrint?: boolean; + }); + baseDir: string; + jsonIndentation: number; + createDataDir(): Promise; + createSubDataDir(...name: any[]): Promise; + rm(filename: any): Promise; + writeData(filename: any, data: any, subdir: any): Promise; + writeJson(filename: any, json: any, shouldGzip: any): Promise; + readData(filename: any, subdir: any): Promise; + gzip(inputFile: any, outputFile: any, removeInput: any): Promise; + get directory(): string; +} +//# sourceMappingURL=storageManager.d.ts.map \ No newline at end of file diff --git a/types/support/storageManager.d.ts.map b/types/support/storageManager.d.ts.map new file mode 100644 index 000000000..aca2d1924 --- /dev/null +++ b/types/support/storageManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"storageManager.d.ts","sourceRoot":"","sources":["../../lib/support/storageManager.js"],"names":[],"mappings":"AAmDA;IACE;;;OAKC;IAJC,gBAEyD;IACzD,wBAA0C;IAG5C,iCAGC;IAED,kDAIC;IAED,iCAEC;IAED,kEASC;IAED,sEAQC;IAED,+DAcC;IAED,sEAmBC;IAED,wBAEC;CACF"} \ No newline at end of file diff --git a/types/support/tcpdump.d.ts b/types/support/tcpdump.d.ts new file mode 100644 index 000000000..0abc55491 --- /dev/null +++ b/types/support/tcpdump.d.ts @@ -0,0 +1,10 @@ +export class TCPDump { + constructor(directory: any, options: any); + baseDir: any; + options: any; + start(iteration: any): Promise; + tcpdumpProcess: import("execa").ExecaChildProcess; + stop(): Promise>; + mv(url: any, iteration: any): Promise; +} +//# sourceMappingURL=tcpdump.d.ts.map \ No newline at end of file diff --git a/types/support/tcpdump.d.ts.map b/types/support/tcpdump.d.ts.map new file mode 100644 index 000000000..93212a6ec --- /dev/null +++ b/types/support/tcpdump.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tcpdump.d.ts","sourceRoot":"","sources":["../../lib/support/tcpdump.js"],"names":[],"mappings":"AAKA;IACE,0CAGC;IAFC,aAAwB;IACxB,aAAsB;IAExB,qCAsBC;IADC,0DAA+C;IAEjD,0DAEC;IAED,4CAQC;CACF"} \ No newline at end of file diff --git a/types/support/userTiming.d.ts b/types/support/userTiming.d.ts new file mode 100644 index 000000000..edd972ec1 --- /dev/null +++ b/types/support/userTiming.d.ts @@ -0,0 +1,2 @@ +export function filterAllowlisted(userTimings: any, allowlistRegex: any): void; +//# sourceMappingURL=userTiming.d.ts.map \ No newline at end of file diff --git a/types/support/userTiming.d.ts.map b/types/support/userTiming.d.ts.map new file mode 100644 index 000000000..058e6fef5 --- /dev/null +++ b/types/support/userTiming.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"userTiming.d.ts","sourceRoot":"","sources":["../../lib/support/userTiming.js"],"names":[],"mappings":"AAAA,+EAMC"} \ No newline at end of file diff --git a/types/support/util.d.ts b/types/support/util.d.ts new file mode 100644 index 000000000..e8e416102 --- /dev/null +++ b/types/support/util.d.ts @@ -0,0 +1,6 @@ +export function formatMetric(name: any, metric: any, multiple: any, inMs: any, extras: any): string; +export function logResultLogLine(results: any): void; +export function toArray(arrayLike: any): any[]; +export function jsonifyVisualProgress(visualProgress: any): any; +export function adjustVisualProgressTimestamps(visualProgress: any, profilerStartTime: any, recordingStartTime: any): any; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/types/support/util.d.ts.map b/types/support/util.d.ts.map new file mode 100644 index 000000000..beeff4cc8 --- /dev/null +++ b/types/support/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../lib/support/util.js"],"names":[],"mappings":"AAIA,oGAeC;AACD,qDA0LC;AACD,+CAQC;AACD,gEAeC;AACD,0HAWC"} \ No newline at end of file diff --git a/types/video/defaults.d.ts b/types/video/defaults.d.ts new file mode 100644 index 000000000..885348a1c --- /dev/null +++ b/types/video/defaults.d.ts @@ -0,0 +1,7 @@ +export const framerate: 30; +export const crf: 23; +export const xvfbDisplay: 99; +export const addTimer: true; +export const convert: true; +export const threads: 0; +//# sourceMappingURL=defaults.d.ts.map \ No newline at end of file diff --git a/types/video/defaults.d.ts.map b/types/video/defaults.d.ts.map new file mode 100644 index 000000000..e00937fd0 --- /dev/null +++ b/types/video/defaults.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../lib/video/defaults.js"],"names":[],"mappings":"AAAA,2BAA4B;AAC5B,qBAAsB;AACtB,6BAA8B;AAC9B,4BAA6B;AAC7B,2BAA4B;AAC5B,wBAAyB"} \ No newline at end of file diff --git a/types/video/postprocessing/finetune/addTextToVideo.d.ts b/types/video/postprocessing/finetune/addTextToVideo.d.ts new file mode 100644 index 000000000..0f2f5731d --- /dev/null +++ b/types/video/postprocessing/finetune/addTextToVideo.d.ts @@ -0,0 +1,2 @@ +export function addTextToVideo(inputFile: any, outputFile: any, videoMetrics: any, timingMetrics: any, options: any): Promise>; +//# sourceMappingURL=addTextToVideo.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/finetune/addTextToVideo.d.ts.map b/types/video/postprocessing/finetune/addTextToVideo.d.ts.map new file mode 100644 index 000000000..ab4d7151f --- /dev/null +++ b/types/video/postprocessing/finetune/addTextToVideo.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"addTextToVideo.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/finetune/addTextToVideo.js"],"names":[],"mappings":"AAgBA,wKAiCC"} \ No newline at end of file diff --git a/types/video/postprocessing/finetune/convertFps.d.ts b/types/video/postprocessing/finetune/convertFps.d.ts new file mode 100644 index 000000000..d2485480e --- /dev/null +++ b/types/video/postprocessing/finetune/convertFps.d.ts @@ -0,0 +1,2 @@ +export function convert(source: any, destination: any, framerate: any): Promise>; +//# sourceMappingURL=convertFps.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/finetune/convertFps.d.ts.map b/types/video/postprocessing/finetune/convertFps.d.ts.map new file mode 100644 index 000000000..562e600d1 --- /dev/null +++ b/types/video/postprocessing/finetune/convertFps.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convertFps.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/finetune/convertFps.js"],"names":[],"mappings":"AAIA,0HAWC"} \ No newline at end of file diff --git a/types/video/postprocessing/finetune/getFont.d.ts b/types/video/postprocessing/finetune/getFont.d.ts new file mode 100644 index 000000000..378df409c --- /dev/null +++ b/types/video/postprocessing/finetune/getFont.d.ts @@ -0,0 +1,2 @@ +export function getFont(options: any): string; +//# sourceMappingURL=getFont.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/finetune/getFont.d.ts.map b/types/video/postprocessing/finetune/getFont.d.ts.map new file mode 100644 index 000000000..048b11760 --- /dev/null +++ b/types/video/postprocessing/finetune/getFont.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getFont.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/finetune/getFont.js"],"names":[],"mappings":"AACA,8CA6BC"} \ No newline at end of file diff --git a/types/video/postprocessing/finetune/getTimingMetrics.d.ts b/types/video/postprocessing/finetune/getTimingMetrics.d.ts new file mode 100644 index 000000000..e498faf37 --- /dev/null +++ b/types/video/postprocessing/finetune/getTimingMetrics.d.ts @@ -0,0 +1,2 @@ +export function getTimingMetrics(videoMetrics: any, timingMetrics: any, options: any): string; +//# sourceMappingURL=getTimingMetrics.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/finetune/getTimingMetrics.d.ts.map b/types/video/postprocessing/finetune/getTimingMetrics.d.ts.map new file mode 100644 index 000000000..ed13cd0bc --- /dev/null +++ b/types/video/postprocessing/finetune/getTimingMetrics.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getTimingMetrics.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/finetune/getTimingMetrics.js"],"names":[],"mappings":"AAgCA,8FAsDC"} \ No newline at end of file diff --git a/types/video/postprocessing/finetune/index.d.ts b/types/video/postprocessing/finetune/index.d.ts new file mode 100644 index 000000000..a82ddb325 --- /dev/null +++ b/types/video/postprocessing/finetune/index.d.ts @@ -0,0 +1,2 @@ +export function finetuneVideo(videoDir: any, videoPath: any, index: any, videoMetrics: any, timingMetrics: any, options: any): Promise; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/finetune/index.d.ts.map b/types/video/postprocessing/finetune/index.d.ts.map new file mode 100644 index 000000000..b7361c871 --- /dev/null +++ b/types/video/postprocessing/finetune/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/finetune/index.js"],"names":[],"mappings":"AAmBA,6IAmEC"} \ No newline at end of file diff --git a/types/video/postprocessing/finetune/removeOrange.d.ts b/types/video/postprocessing/finetune/removeOrange.d.ts new file mode 100644 index 000000000..ac5e54653 --- /dev/null +++ b/types/video/postprocessing/finetune/removeOrange.d.ts @@ -0,0 +1,2 @@ +export function removeOrange(inputFile: any, outputFile: any, newStart: any, visualMetrics: any, options: any): Promise>; +//# sourceMappingURL=removeOrange.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/finetune/removeOrange.d.ts.map b/types/video/postprocessing/finetune/removeOrange.d.ts.map new file mode 100644 index 000000000..4ec7cbef2 --- /dev/null +++ b/types/video/postprocessing/finetune/removeOrange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removeOrange.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/finetune/removeOrange.js"],"names":[],"mappings":"AAIA,kKAkBC"} \ No newline at end of file diff --git a/types/video/postprocessing/visualmetrics/extraMetrics.d.ts b/types/video/postprocessing/visualmetrics/extraMetrics.d.ts new file mode 100644 index 000000000..486c52c21 --- /dev/null +++ b/types/video/postprocessing/visualmetrics/extraMetrics.d.ts @@ -0,0 +1,5 @@ +export function extraMetrics(metrics: any): { + videoRecordingStart: any; + visualMetrics: any; +}; +//# sourceMappingURL=extraMetrics.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/visualmetrics/extraMetrics.d.ts.map b/types/video/postprocessing/visualmetrics/extraMetrics.d.ts.map new file mode 100644 index 000000000..35fc1d87a --- /dev/null +++ b/types/video/postprocessing/visualmetrics/extraMetrics.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"extraMetrics.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/visualmetrics/extraMetrics.js"],"names":[],"mappings":"AAAA;;;EA8CC"} \ No newline at end of file diff --git a/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts b/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts new file mode 100644 index 000000000..07134b4b3 --- /dev/null +++ b/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts @@ -0,0 +1,5 @@ +export function getVideoMetrics(videoDir: any, filmstripDir: any, videoPath: any, index: any, visualElements: any, storageManager: any, pageNumber: any, visitedPageNumber: any, options: any): Promise<{ + videoRecordingStart: any; + visualMetrics: any; +}>; +//# sourceMappingURL=getVideoMetrics.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts.map b/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts.map new file mode 100644 index 000000000..8d24b37eb --- /dev/null +++ b/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getVideoMetrics.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/visualmetrics/getVideoMetrics.js"],"names":[],"mappings":"AAMA;;;GA+CC"} \ No newline at end of file diff --git a/types/video/postprocessing/visualmetrics/visualMetrics.d.ts b/types/video/postprocessing/visualmetrics/visualMetrics.d.ts new file mode 100644 index 000000000..158f6320a --- /dev/null +++ b/types/video/postprocessing/visualmetrics/visualMetrics.d.ts @@ -0,0 +1,3 @@ +export function checkDependencies(options: any): Promise>; +export function run(videoPath: any, imageDirPath: any, elementsFile: any, videoDir: any, index: any, pageNumber: any, visitedPageNumber: any, options: any): Promise; +//# sourceMappingURL=visualMetrics.d.ts.map \ No newline at end of file diff --git a/types/video/postprocessing/visualmetrics/visualMetrics.d.ts.map b/types/video/postprocessing/visualmetrics/visualMetrics.d.ts.map new file mode 100644 index 000000000..e296f3986 --- /dev/null +++ b/types/video/postprocessing/visualmetrics/visualMetrics.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"visualMetrics.d.ts","sourceRoot":"","sources":["../../../../lib/video/postprocessing/visualmetrics/visualMetrics.js"],"names":[],"mappings":"AAsCA,mGAEC;AACD,0KAiHC"} \ No newline at end of file diff --git a/types/video/screenRecording/android/recorder.d.ts b/types/video/screenRecording/android/recorder.d.ts new file mode 100644 index 000000000..456f996b9 --- /dev/null +++ b/types/video/screenRecording/android/recorder.d.ts @@ -0,0 +1,11 @@ +export class AndroidRecorder { + constructor(options: any); + waitTime: any; + framerate: any; + options: any; + start(): Promise; + android: Android; + stop(destination: any): Promise; +} +import { Android } from '../../../android/index.js'; +//# sourceMappingURL=recorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/android/recorder.d.ts.map b/types/video/screenRecording/android/recorder.d.ts.map new file mode 100644 index 000000000..b14e95d77 --- /dev/null +++ b/types/video/screenRecording/android/recorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/android/recorder.js"],"names":[],"mappings":"AAUA;IACE,0BAIC;IAHC,cAAsE;IACtE,eAAiE;IACjE,aAAsB;IAGxB,sBAGC;IAFC,iBAAwC;IAI1C,qCAgBC;CACF;wBAlCuB,2BAA2B"} \ No newline at end of file diff --git a/types/video/screenRecording/desktop/convert.d.ts b/types/video/screenRecording/desktop/convert.d.ts new file mode 100644 index 000000000..7606d9b8a --- /dev/null +++ b/types/video/screenRecording/desktop/convert.d.ts @@ -0,0 +1,2 @@ +export function convert(source: any, destination: any, crf: any, threads: any): Promise>; +//# sourceMappingURL=convert.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/desktop/convert.d.ts.map b/types/video/screenRecording/desktop/convert.d.ts.map new file mode 100644 index 000000000..3ada5a6b7 --- /dev/null +++ b/types/video/screenRecording/desktop/convert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/desktop/convert.js"],"names":[],"mappings":"AAIA,kIAwBC"} \ No newline at end of file diff --git a/types/video/screenRecording/desktop/desktopRecorder.d.ts b/types/video/screenRecording/desktop/desktopRecorder.d.ts new file mode 100644 index 000000000..38b65782e --- /dev/null +++ b/types/video/screenRecording/desktop/desktopRecorder.d.ts @@ -0,0 +1,28 @@ +export class DesktopRecorder { + constructor(options: any); + display: any; + framerate: any; + nice: any; + crf: any; + convert: any; + threads: any; + viewPort: any; + taskset: any; + origin: string; + offset: { + x: number; + y: number; + }; + options: any; + start(file: any): Promise<{ + filePath: any; + ffmpegProcess: any; + }>; + filePath: any; + recording: Promise<{ + filePath: any; + ffmpegProcess: any; + }>; + stop(destination: any): Promise; +} +//# sourceMappingURL=desktopRecorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/desktop/desktopRecorder.d.ts.map b/types/video/screenRecording/desktop/desktopRecorder.d.ts.map new file mode 100644 index 000000000..7a111ecdb --- /dev/null +++ b/types/video/screenRecording/desktop/desktopRecorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"desktopRecorder.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/desktop/desktopRecorder.js"],"names":[],"mappings":"AAkBA;IACE,0BAYC;IAXC,aAA8D;IAC9D,eAAkE;IAClE,UAA+C;IAC/C,SAAgD;IAChD,aAA4D;IAC5D,aAA4D;IAC5D,cAAoC;IACpC,aAAkD;IAClD,eAAmB;IACnB;;;MAA4B;IAC5B,aAAsB;IAGxB;;;OAiBC;IAhBC,cAAoB;IAEpB;;;OAWE;IAKJ,sCA8BC;CACF"} \ No newline at end of file diff --git a/types/video/screenRecording/desktop/ffmpegRecorder.d.ts b/types/video/screenRecording/desktop/ffmpegRecorder.d.ts new file mode 100644 index 000000000..dcecc24c1 --- /dev/null +++ b/types/video/screenRecording/desktop/ffmpegRecorder.d.ts @@ -0,0 +1,17 @@ +export function start({ display, origin, size, filePath, offset, framerate, crf, nice, threads, taskset }: { + display: any; + origin: any; + size: any; + filePath: any; + offset: any; + framerate: any; + crf: any; + nice: any; + threads: any; + taskset: any; +}): Promise<{ + filePath: any; + ffmpegProcess: any; +}>; +export function stop(recording: any): Promise; +//# sourceMappingURL=ffmpegRecorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/desktop/ffmpegRecorder.d.ts.map b/types/video/screenRecording/desktop/ffmpegRecorder.d.ts.map new file mode 100644 index 000000000..2efba6e47 --- /dev/null +++ b/types/video/screenRecording/desktop/ffmpegRecorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ffmpegRecorder.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/desktop/ffmpegRecorder.js"],"names":[],"mappings":"AAsIA;;;;;;;;;;;;;;GAiCC;AACD,mDAaC"} \ No newline at end of file diff --git a/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts b/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts new file mode 100644 index 000000000..9d33cb768 --- /dev/null +++ b/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts @@ -0,0 +1,2 @@ +export function getSPDisplaysDataType(): Promise; +//# sourceMappingURL=getSPDisplaysDataType.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts.map b/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts.map new file mode 100644 index 000000000..46614f521 --- /dev/null +++ b/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getSPDisplaysDataType.d.ts","sourceRoot":"","sources":["../../../../../lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js"],"names":[],"mappings":"AAEA,yDAKC"} \ No newline at end of file diff --git a/types/video/screenRecording/desktop/osx/getScreen.d.ts b/types/video/screenRecording/desktop/osx/getScreen.d.ts new file mode 100644 index 000000000..dfabed18a --- /dev/null +++ b/types/video/screenRecording/desktop/osx/getScreen.d.ts @@ -0,0 +1,2 @@ +export function getScreenOnOSX(): Promise; +//# sourceMappingURL=getScreen.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/desktop/osx/getScreen.d.ts.map b/types/video/screenRecording/desktop/osx/getScreen.d.ts.map new file mode 100644 index 000000000..78ac3c687 --- /dev/null +++ b/types/video/screenRecording/desktop/osx/getScreen.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getScreen.d.ts","sourceRoot":"","sources":["../../../../../lib/video/screenRecording/desktop/osx/getScreen.js"],"names":[],"mappings":"AAIA,kDA0BC"} \ No newline at end of file diff --git a/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts b/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts new file mode 100644 index 000000000..3bdb231af --- /dev/null +++ b/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts @@ -0,0 +1,13 @@ +export class FirefoxWindowRecorder { + constructor(options: any, browser: any, baseDir: any); + options: any; + browser: any; + baseDir: any; + recordingStartTime: any; + timeToFirstFrame: number; + start(): Promise; + android: Android; + stop(destination: any): Promise; +} +import { Android } from '../../../android/index.js'; +//# sourceMappingURL=firefoxWindowRecorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts.map b/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts.map new file mode 100644 index 000000000..ef86c79a3 --- /dev/null +++ b/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"firefoxWindowRecorder.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/firefox/firefoxWindowRecorder.js"],"names":[],"mappings":"AAqJA;IACE,sDAMC;IALC,aAAsB;IACtB,aAAsB;IACtB,aAAsB;IACtB,wBAAmC;IACnC,yBAAiC;IAGnC,sBAYC;IARG,iBAAwC;IAU5C,sCAgCC;CACF;wBAjM4C,2BAA2B"} \ No newline at end of file diff --git a/types/video/screenRecording/ios/convertToMp4.d.ts b/types/video/screenRecording/ios/convertToMp4.d.ts new file mode 100644 index 000000000..308afb540 --- /dev/null +++ b/types/video/screenRecording/ios/convertToMp4.d.ts @@ -0,0 +1,2 @@ +export function convert(source: any, destination: any): Promise>; +//# sourceMappingURL=convertToMp4.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/ios/convertToMp4.d.ts.map b/types/video/screenRecording/ios/convertToMp4.d.ts.map new file mode 100644 index 000000000..6621af35c --- /dev/null +++ b/types/video/screenRecording/ios/convertToMp4.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convertToMp4.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/ios/convertToMp4.js"],"names":[],"mappings":"AAIA,0GAiBC"} \ No newline at end of file diff --git a/types/video/screenRecording/ios/iosRecorder.d.ts b/types/video/screenRecording/ios/iosRecorder.d.ts new file mode 100644 index 000000000..c7070b5dc --- /dev/null +++ b/types/video/screenRecording/ios/iosRecorder.d.ts @@ -0,0 +1,14 @@ +export class IOSRecorder { + static activate(): Promise; + constructor(options: any, baseDir: any); + options: any; + uuid: any; + tmpVideo: string; + tmpSound: string; + start(): Promise; + qvhProcessProcess: import("execa").ExecaChildProcess; + stop(destination: any): Promise>; +} +//# sourceMappingURL=iosRecorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/ios/iosRecorder.d.ts.map b/types/video/screenRecording/ios/iosRecorder.d.ts.map new file mode 100644 index 000000000..ad0e545ca --- /dev/null +++ b/types/video/screenRecording/ios/iosRecorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"iosRecorder.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/ios/iosRecorder.js"],"names":[],"mappings":"AAeA;IAQE;;OAMC;IAbD,wCAKC;IAJC,aAAsB;IACtB,UAAqC;IACrC,iBAAyC;IACzC,iBAAwC;IAW1C,uBAqBC;IAlBC,6DAQC;IAYH,0EAaC;CACF"} \ No newline at end of file diff --git a/types/video/screenRecording/iosSimulator/convertToMp4.d.ts b/types/video/screenRecording/iosSimulator/convertToMp4.d.ts new file mode 100644 index 000000000..308afb540 --- /dev/null +++ b/types/video/screenRecording/iosSimulator/convertToMp4.d.ts @@ -0,0 +1,2 @@ +export function convert(source: any, destination: any): Promise>; +//# sourceMappingURL=convertToMp4.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/iosSimulator/convertToMp4.d.ts.map b/types/video/screenRecording/iosSimulator/convertToMp4.d.ts.map new file mode 100644 index 000000000..f3a67d588 --- /dev/null +++ b/types/video/screenRecording/iosSimulator/convertToMp4.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convertToMp4.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/iosSimulator/convertToMp4.js"],"names":[],"mappings":"AAIA,0GAiBC"} \ No newline at end of file diff --git a/types/video/screenRecording/iosSimulator/recorder.d.ts b/types/video/screenRecording/iosSimulator/recorder.d.ts new file mode 100644 index 000000000..4d60acd74 --- /dev/null +++ b/types/video/screenRecording/iosSimulator/recorder.d.ts @@ -0,0 +1,9 @@ +export class IOSSimulatorRecorder { + constructor(options: any, baseDir: any); + options: any; + tmpVideo: string; + start(): Promise; + xcrunProcess: import("execa").ExecaChildProcess; + stop(destination: any): Promise>; +} +//# sourceMappingURL=recorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/iosSimulator/recorder.d.ts.map b/types/video/screenRecording/iosSimulator/recorder.d.ts.map new file mode 100644 index 000000000..a4538b032 --- /dev/null +++ b/types/video/screenRecording/iosSimulator/recorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../lib/video/screenRecording/iosSimulator/recorder.js"],"names":[],"mappings":"AAUA;IACE,wCAGC;IAFC,aAAsB;IACtB,iBAA6C;IAG/C,uBAUC;IAPC,wDAMC;IAGH,0EAWC;CACF"} \ No newline at end of file diff --git a/types/video/screenRecording/recorder.d.ts b/types/video/screenRecording/recorder.d.ts new file mode 100644 index 000000000..789deef85 --- /dev/null +++ b/types/video/screenRecording/recorder.d.ts @@ -0,0 +1,7 @@ +export function getRecorder(options: any, browser: any, baseDir: any): AndroidRecorder | DesktopRecorder | FirefoxWindowRecorder | IOSSimulatorRecorder | IOSRecorder; +import { AndroidRecorder } from './android/recorder.js'; +import { DesktopRecorder } from './desktop/desktopRecorder.js'; +import { FirefoxWindowRecorder } from './firefox/firefoxWindowRecorder.js'; +import { IOSSimulatorRecorder } from './iosSimulator/recorder.js'; +import { IOSRecorder } from './ios/iosRecorder.js'; +//# sourceMappingURL=recorder.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/recorder.d.ts.map b/types/video/screenRecording/recorder.d.ts.map new file mode 100644 index 000000000..404422d28 --- /dev/null +++ b/types/video/screenRecording/recorder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../lib/video/screenRecording/recorder.js"],"names":[],"mappings":"AAOA,sKA0BC;gCAhC+B,uBAAuB;gCACvB,8BAA8B;sCACxB,oCAAoC;qCACrC,4BAA4B;4BACrC,sBAAsB"} \ No newline at end of file diff --git a/types/video/screenRecording/setOrangeBackground.d.ts b/types/video/screenRecording/setOrangeBackground.d.ts new file mode 100644 index 000000000..ec5d1bf8a --- /dev/null +++ b/types/video/screenRecording/setOrangeBackground.d.ts @@ -0,0 +1,2 @@ +export function setOrangeBackground(driver: any): Promise; +//# sourceMappingURL=setOrangeBackground.d.ts.map \ No newline at end of file diff --git a/types/video/screenRecording/setOrangeBackground.d.ts.map b/types/video/screenRecording/setOrangeBackground.d.ts.map new file mode 100644 index 000000000..5f6d20eea --- /dev/null +++ b/types/video/screenRecording/setOrangeBackground.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setOrangeBackground.d.ts","sourceRoot":"","sources":["../../../lib/video/screenRecording/setOrangeBackground.js"],"names":[],"mappings":"AAGA,+DAyBC"} \ No newline at end of file diff --git a/types/video/video.d.ts b/types/video/video.d.ts new file mode 100644 index 000000000..fd05f3060 --- /dev/null +++ b/types/video/video.d.ts @@ -0,0 +1,41 @@ +/** + * Create a new Video that handles everything with the video + * @class + */ +export class Video { + constructor(storageManager: any, options: any, browser: any); + options: any; + storageManager: any; + tmpDir: any; + recorder: import("./screenRecording/android/recorder.js").AndroidRecorder | import("./screenRecording/desktop/desktopRecorder.js").DesktopRecorder | import("./screenRecording/firefox/firefoxWindowRecorder.js").FirefoxWindowRecorder | import("./screenRecording/iosSimulator/recorder.js").IOSSimulatorRecorder | import("./screenRecording/ios/iosRecorder.js").IOSRecorder; + isRecording: boolean; + setupDirs(index: any, url: any): Promise; + index: any; + videoDir: any; + filmstripDir: any; + /** + * Start recoding a video. + * @returns {Promise} Promise object that represents when the video started + */ + record(pageNumber: any, index: any, visitedPageNumber: any): Promise; + pageNumber: any; + visitedPageNumber: any; + /** + * Stop recording the video. + * @returns {Promise} Promise object that represents when the video stopped + */ + stop(url: any): Promise; + videoPath: string; + cleanup(): Promise; + /** + Post process video: get visual metrics, finetune the video and remove it + if you don't want it + */ + postProcessing(timingMetrics: any, visualElements: any): Promise<{ + videoRecordingStart: any; + visualMetrics: any; + }>; + getRecordingStartTime(): any; + getTimeToFirstFrame(): any; +} +//# sourceMappingURL=video.d.ts.map \ No newline at end of file diff --git a/types/video/video.d.ts.map b/types/video/video.d.ts.map new file mode 100644 index 000000000..a2a28d274 --- /dev/null +++ b/types/video/video.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../lib/video/video.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IACE,6DAMC;IALC,aAAsB;IACtB,oBAAoC;IACpC,YAAsC;IACtC,iXAA0D;IAC1D,qBAAwB;IAG1B,+CAeC;IAbC,WAAkB;IAElB,cAEC;IAMD,kBAEC;IAGH;;;OAGG;IACH,0EAUC;IATC,gBAA4B;IAE5B,uBAA0C;IAS5C;;;OAGG;IACH,6BAUC;IARC,kBAKC;IAKH,yBAUC;IAED;;;OAGG;IACH;;;OA0BC;IAED,6BAEC;IAED,2BAEC;CACF"} \ No newline at end of file