diff --git a/lib/core/engine/command/addText.js b/lib/core/engine/command/addText.js index 7e9804b8e..2e35745e6 100644 --- a/lib/core/engine/command/addText.js +++ b/lib/core/engine/command/addText.js @@ -2,18 +2,27 @@ import { By } from 'selenium-webdriver'; import intel from 'intel'; const log = intel.getLogger('browsertime.command.addText'); +/** + * Provides functionality to add text to elements on a web page using various selectors. + * + * @class + */ export class AddText { constructor(browser) { + /** + * @private + */ this.browser = browser; } /** - * 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 + * Adds text to an element identified by its ID. + * + * @async + * @param {string} text - The text string to add. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ async byId(text, id) { const driver = this.browser.getDriver(); @@ -30,12 +39,13 @@ export class AddText { } /** - * 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 + * Adds text to an element identified by its XPath. + * + * @async + * @param {string} text - The text string to add. + * @param {string} xpath - The XPath of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(text, xpath) { const driver = this.browser.getDriver(); @@ -52,12 +62,13 @@ export class AddText { } /** - * 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 + * Adds text to an element identified by its CSS selector. + * + * @async + * @param {string} text - The text string to add. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ async bySelector(text, selector) { const driver = this.browser.getDriver(); @@ -74,12 +85,13 @@ export class AddText { } /** - * 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 + * Adds text to an element identified by its class name. + * + * @async + * @param {string} text - The text string to add. + * @param {string} className - The class name of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ async byClassName(text, className) { const driver = this.browser.getDriver(); @@ -96,12 +108,13 @@ export class AddText { } /** - * 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 + * Adds text to an element identified by its name attribute. + * + * @async + * @param {string} text - The text string to add. + * @param {string} name - The name attribute of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ async byName(text, name) { const driver = this.browser.getDriver(); diff --git a/lib/core/engine/command/android.js b/lib/core/engine/command/android.js index ce251d5f4..699905c10 100644 --- a/lib/core/engine/command/android.js +++ b/lib/core/engine/command/android.js @@ -1,16 +1,27 @@ import intel from 'intel'; import { Android, isAndroidConfigured } from '../../../android/index.js'; const log = intel.getLogger('browsertime.command.android'); +/** + * Provides functionality to interact with an Android device through shell commands. + * + * @class + */ export class AndroidCommand { constructor(options) { + /** + * @private + */ this.options = options; } /** - * 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 + * Runs a shell command on the connected Android device. + * This method requires the Android device to be properly configured. + * + * @async + * @param {string} command - The shell command to run on the Android device. + * @returns {Promise} A promise that resolves with the result of the command or rejects if there's an error. + * @throws {Error} Throws an error if Android is not configured or if the command fails. */ async shell(command) { if (isAndroidConfigured(this.options)) { diff --git a/lib/core/engine/command/cache.js b/lib/core/engine/command/cache.js index aa8a7b590..d150c141e 100644 --- a/lib/core/engine/command/cache.js +++ b/lib/core/engine/command/cache.js @@ -1,5 +1,11 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.cache'); +/** + * Manage the browser cache. + * This class provides methods to clear the cache and cookies in different browsers. + * + * @class + */ export class Cache { constructor(browser, browserName, extensionServer, cdp) { /** diff --git a/lib/core/engine/command/chromeDevToolsProtocol.js b/lib/core/engine/command/chromeDevToolsProtocol.js index 64a509d4d..3683efb4f 100644 --- a/lib/core/engine/command/chromeDevToolsProtocol.js +++ b/lib/core/engine/command/chromeDevToolsProtocol.js @@ -1,13 +1,33 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.devtoolsprotocol'); -// https://chromedevtools.github.io/devtools-protocol/ +/** + * Manages interactions with the Chrome DevTools Protocol for Chrome and Edge browsers. + * Allows sending commands and setting up event listeners via the protocol. + * See https://chromedevtools.github.io/devtools-protocol/ + * + * @class + */ export class ChromeDevelopmentToolsProtocol { constructor(engineDelegate, browserName) { + /** + * @private + */ this.engineDelegate = engineDelegate; + /** + * @private + */ this.browserName = browserName; } + /** + * Sets up an event listener for a specific DevTools Protocol event. + * + * @async + * @param {string} event - The name of the event to listen for. + * @param {Function} f - The callback function to execute when the event is triggered. + * @throws {Error} Throws an error if the browser is not supported or if setting the listener fails. + */ async on(event, f) { if (this.browserName === 'chrome' || this.browserName === 'edge') { try { @@ -29,6 +49,15 @@ export class ChromeDevelopmentToolsProtocol { } } + /** + * Sends a command to the DevTools Protocol and returns the result. + * + * @async + * @param {string} command - The DevTools Protocol command to send. + * @param {Object} arguments_ - The arguments for the command. + * @throws {Error} Throws an error if the browser is not supported or if the command fails. + * @returns {Promise} The result of the command execution. + */ async sendAndGet(command, arguments_) { if (this.browserName === 'chrome' || this.browserName === 'edge') { try { @@ -51,6 +80,12 @@ export class ChromeDevelopmentToolsProtocol { } } + /** + * Retrieves the raw client for the DevTools Protocol. + * + * @returns {Object} The raw DevTools Protocol client. + * @throws {Error} Throws an error if the browser is not supported. + */ getRawClient() { if (this.browserName === 'chrome' || this.browserName === 'edge') { return this.engineDelegate.getCDPClient().getRawClient(); @@ -59,6 +94,15 @@ export class ChromeDevelopmentToolsProtocol { } } + /** + * Sends a command to the DevTools Protocol. + * + * @async + * @param {string} command - The DevTools Protocol command to send. + * @param {Object} arguments_ - The arguments for the command. + * @throws {Error} Throws an error if the browser is not supported or if the command fails. + * @returns {Promise} A promise that resolves when the command has been sent. + */ async send(command, arguments_) { if (this.browserName === 'chrome' || this.browserName === 'edge') { try { diff --git a/lib/core/engine/command/chromeTrace.js b/lib/core/engine/command/chromeTrace.js index 6d7ddc461..eee47d1ac 100644 --- a/lib/core/engine/command/chromeTrace.js +++ b/lib/core/engine/command/chromeTrace.js @@ -4,14 +4,38 @@ import { getRenderBlocking } from '../../../chrome/webdriver/traceUtilities.js'; import { parse } from '../../../chrome/traceCategoriesParser.js'; import { parseCPUTrace } from '../../../chrome/parseCpuTrace.js'; const log = intel.getLogger('browsertime.command.chrometrace'); +/** + * Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome. + * + * @class + */ export class ChromeTrace { constructor(engineDelegate, index, options, result) { + /** + * @private + */ this.engineDelegate = engineDelegate; + /** + * @private + */ this.options = options; + /** + * @private + */ this.result = result; + /** + * @private + */ this.index = index; } + /** + * Starts the Chrome trace collection. + * + * @async + * @returns {Promise} A promise that resolves when tracing is started. + * @throws {Error} Throws an error if not running Chrome or if configuration is not set for custom tracing. + */ async start() { if (this.options.browser === 'chrome') { if (this.options.chrome.timelineRecordingType === 'custom') { @@ -26,6 +50,13 @@ export class ChromeTrace { } } + /** + * Stops the Chrome trace collection, processes the collected data, and attaches it to the result object. + * + * @async + * @returns {Promise} A promise that resolves when tracing is stopped and data is processed. + * @throws {Error} Throws an error if not running Chrome or if custom tracing was not started. + */ async stop() { if (this.options.browser === 'chrome') { if (this.options.chrome.timelineRecordingType === 'custom') { diff --git a/lib/core/engine/command/click.js b/lib/core/engine/command/click.js index 70af0e6a2..b26082c13 100644 --- a/lib/core/engine/command/click.js +++ b/lib/core/engine/command/click.js @@ -10,19 +10,30 @@ function addClick(js) { return script; } +/** + * Provides functionality to perform click actions on elements in a web page using various selectors. + * + * @class + */ export class Click { constructor(browser, pageCompleteCheck) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; } /** - * 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 + * Clicks on an element identified by its class name. + * + * @async + * @param {string} className - The class name of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byClassName(className) { try { @@ -36,10 +47,12 @@ export class Click { } /** - * 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 + * Clicks on an element identified by its class name and waits for the page complete check to finish. + * + * @async + * @param {string} className - The class name of the element to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. */ async byClassNameAndWait(className) { try { @@ -54,10 +67,12 @@ export class Click { } /** - * 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 + * Clicks on a link whose visible text matches the given string. + * + * @async + * @param {string} text - The visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the link is not found. */ async byLinkText(text) { try { @@ -71,10 +86,12 @@ export class Click { } /** - * 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 + * Clicks on a link whose visible text matches the given string and waits for the page complete check to finish. + * + * @async + * @param {string} text - The visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the link is not found. */ async byLinkTextAndWait(text) { try { @@ -88,10 +105,12 @@ export class Click { } /** - * 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 + * Clicks on a link whose visible text contains the given substring. + * + * @async + * @param {string} text - The substring of the visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the link is not found. */ async byPartialLinkText(text) { try { @@ -105,10 +124,12 @@ export class Click { } /** - * 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 + * Clicks on a link whose visible text contains the given substring and waits for the page complete check to finish. + * + * @async + * @param {string} text - The substring of the visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the link is not found. */ async byPartialLinkTextAndWait(text) { try { @@ -120,11 +141,14 @@ export class Click { throw new Error('Could not find link by partial text ' + text); } } + /** - * 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 + * Clicks on an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(xpath) { try { @@ -138,12 +162,13 @@ export class Click { throw new Error('Could not find element by xpath ' + xpath); } } - /**. - * Click on link that matches a XPath selector and wait for page load complete check to finish + /** + * Clicks on an element that matches a given XPath selector and waits for the page 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 + * @async + * @param {string} xpath - The XPath selector of the element to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. */ async byXpathAndWait(xpath) { try { @@ -160,10 +185,12 @@ export class Click { } /** - * 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 + * Clicks on an element located by evaluating a JavaScript expression. + * + * @async + * @param {string} js - The JavaScript expression that evaluates to an element or list of elements. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byJs(js) { try { @@ -177,10 +204,12 @@ export class Click { } /** - * 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 + * Clicks on an element located by evaluating a JavaScript expression and waits for the page complete check to finish. + * + * @async + * @param {string} js - The JavaScript expression that evaluates to an element or list of elements. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. */ async byJsAndWait(js) { try { @@ -195,10 +224,12 @@ export class Click { } /** - * 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 + * Clicks on an element located by its ID. + * + * @async + * @param {string} id - The ID of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byId(id) { try { @@ -212,10 +243,12 @@ export class Click { } /** - * 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 + * Clicks on an element located by its name attribute. + * + * @async + * @param {string} name - The name attribute of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byName(name) { try { @@ -231,7 +264,7 @@ export class Click { /** * 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. + * @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 */ async byIdAndWait(id) { @@ -246,6 +279,14 @@ export class Click { } } + /** + * Clicks on an element located by its CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ async bySelector(selector) { try { const script = `document.querySelector('${selector}').click();`; @@ -257,6 +298,14 @@ export class Click { } } + /** + * Clicks on an element located by its CSS selector and waits for the page complete check to finish. + * + * @async + * @param {string} selector - The CSS selector of the element to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. + */ async bySelectorAndWait(selector) { try { const script = `document.querySelector('${selector}').click();`; diff --git a/lib/core/engine/command/debug.js b/lib/core/engine/command/debug.js index 5c05e73fe..ebd97f4fa 100644 --- a/lib/core/engine/command/debug.js +++ b/lib/core/engine/command/debug.js @@ -2,15 +2,31 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.debug'); const delay = ms => new Promise(res => setTimeout(res, ms)); +/** + * Provides debugging capabilities within a browser automation script. + * It allows setting breakpoints to pause script execution and inspect the current state. + * + * @class + */ export class Debug { constructor(browser, options) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.options = options; } /** - * 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. + * Adds a breakpoint to the script. The browser will pause at the breakpoint, waiting for user input to continue. + * This is useful for debugging and inspecting the browser state at a specific point in the script. + * + * @async + * @param {string} [name] - An optional name for the breakpoint for logging purposes. + * @returns {Promise} A promise that resolves when the user chooses to continue from the breakpoint. */ async breakpoint(name) { if (this.options.debug) { diff --git a/lib/core/engine/command/geckoProfiler.js b/lib/core/engine/command/geckoProfiler.js index c64640794..c346397f7 100644 --- a/lib/core/engine/command/geckoProfiler.js +++ b/lib/core/engine/command/geckoProfiler.js @@ -1,14 +1,42 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.geckoprofiler'); +/** + * Manages the Gecko Profiler for profiling Firefox performance. + * + * @class + */ + export class GeckoProfiler { constructor(GeckoProfiler, browser, index, options, result) { + /** + * @private + */ this.GeckoProfiler = GeckoProfiler; + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.index = index; + /** + * @private + */ this.options = options; + /** + * @private + */ this.result = result; } + /** + * Starts the Gecko Profiler. + * + * @async + * @returns {Promise} A promise that resolves when the profiler is started. + * @throws {Error} Throws an error if not running Firefox or if the configuration is not set for custom profiling. + */ async start() { if (this.options.browser === 'firefox') { if (this.options.firefox.geckoProfilerRecordingType === 'custom') { @@ -23,6 +51,13 @@ export class GeckoProfiler { } } + /** + * Stops the Gecko Profiler and processes the collected data. + * + * @async + * @returns {Promise} A promise that resolves when the profiler is stopped and the data is processed. + * @throws {Error} Throws an error if not running Firefox or if custom profiling was not started. + */ async stop() { if (this.options.browser === 'firefox') { if (this.options.firefox.geckoProfilerRecordingType === 'custom') { diff --git a/lib/core/engine/command/javaScript.js b/lib/core/engine/command/javaScript.js index 23c168e27..067baa73c 100644 --- a/lib/core/engine/command/javaScript.js +++ b/lib/core/engine/command/javaScript.js @@ -1,16 +1,30 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.javascript'); +/** + * Provides functionality to execute JavaScript code in the context of the current page. + * + * @class + */ + export class JavaScript { constructor(browser, pageCompleteCheck) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; } /** - * 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 + * Executes a JavaScript script. + * + * @async + * @param {string} js - The JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed script. + * @throws {Error} Throws an error if the JavaScript cannot be executed. */ async run(js) { try { @@ -24,10 +38,12 @@ export class JavaScript { } /** - * 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 + * Executes a JavaScript script and waits for the page complete check to finish. + * + * @async + * @param {string} js - The JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed script and the completion of the page load. + * @throws {Error} Throws an error if the JavaScript cannot be executed. */ async runAndWait(js) { try { @@ -41,10 +57,12 @@ export class JavaScript { } /** - * 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 + * Executes synchronous privileged JavaScript. + * + * @async + * @param {string} js - The privileged JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed privileged script. + * @throws {Error} Throws an error if the privileged JavaScript cannot be executed. */ async runPrivileged(js) { try { @@ -61,10 +79,12 @@ export class JavaScript { } /** - * 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 + * Executes synchronous privileged JavaScript and waits for the page complete check to finish. + * + * @async + * @param {string} js - The privileged JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed privileged script and the completion of the page load. + * @throws {Error} Throws an error if the privileged JavaScript cannot be executed. */ async runPrivilegedAndWait(js) { try { @@ -78,10 +98,12 @@ export class JavaScript { } /** - * 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 + * Executes asynchronous privileged JavaScript. + * + * @async + * @param {string} js - The asynchronous privileged JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed asynchronous privileged script. + * @throws {Error} Throws an error if the asynchronous privileged JavaScript cannot be executed. */ async runPrivilegedAsync(js) { try { diff --git a/lib/core/engine/command/measure.js b/lib/core/engine/command/measure.js index 7bb20a335..beb9809fc 100644 --- a/lib/core/engine/command/measure.js +++ b/lib/core/engine/command/measure.js @@ -27,6 +27,12 @@ function getNewResult() { }; } +/** + * A measurement tool for browser-based metrics, handling various aspects + * of metric collection including navigation, video recording, and data collection. + * + * @class + */ export class Measure { constructor( browser, @@ -44,33 +50,104 @@ export class Measure { screenshotManager, options ) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; + /** + * @private + */ this.index = index; + /** + * @private + */ this.result = result; + /** + * @private + */ this.engineDelegate = engineDelegate; + /** + * @private + */ this.options = options; + /** + * @private + */ this.screenshotManager = screenshotManager; + /** + * @private + */ this.storageManager = storageManager; + /** + * @private + */ this.recordVideo = options.visualMetrics || options.video; + /** + * @private + */ this.extensionServer = extensionServer; + /** + * @private + */ this.videos = videos; + /** + * @private + */ this.scriptsByCategory = scriptsByCategory; + /** + * @private + */ this.asyncScriptsByCategory = asyncScriptsByCategory; + /** + * @private + */ this.postURLScripts = postURLScripts; + /** + * @private + */ this.context = context; + /** + * @private + */ this.numberOfMeasuredPages = 0; + /** + * @private + */ this.numberOfVisitedPages = 0; + /** + * @private + */ this.areWeMeasuring = false; + /** + * @private + */ this.testedURLs = {}; + /** + * @private + */ this.tcpDump = new TCPDump(storageManager.directory, options); - + /** + * @private + */ this.ANDROID_DELAY_TIME = get(options, 'orangeAndroidDelayTime', 2000); + /** + * @private + */ this.IOS_DELAY_TIME = get(options, 'orangeIosDelayTime', 1000); + /** + * @private + */ this.DESKTOP_DELAY_TIME = get(options, 'orangeDesktopDelayTime', 800); } - // Have a consistent way of starting the video + /** + * Have a consistent way of starting the video + * @private + */ async _startVideo(numberOfMeasuredPages, index) { this.video = new Video(this.storageManager, this.options, this.browser); @@ -95,6 +172,10 @@ export class Measure { } } + /** + * Have a consistent way of starting stopping the video + * @private + */ async _stopVideo(url) { if (this.recordVideo && !this.options.videoParams.debug) { await this.video.stop(url); @@ -102,6 +183,10 @@ export class Measure { } } + /** + * Have a consistent way of adding an error + * @private + */ _error(message) { // If we already are measuring a page, associate the error woth that page if (this.areWeMeasuring === true) { @@ -126,6 +211,10 @@ export class Measure { } } + /** + * Have a consistent way of adding an failure + * @private + */ _failure(message) { log.debug('Mark run as failure with message %s', message); this.result.markedAsFailure = 1; @@ -136,6 +225,19 @@ export class Measure { } } + /** + * Navigates to a specified URL and handles additional setup for the first page visit. + * + * This function is responsible for setting up the browser with necessary configurations and + * navigating to the URL. It also waits for the page + * to load completely based on configured page completion check. + * + * @async + * @private + * @param {string} url - The URL to navigate to. + * @throws {Error} Throws an error if navigation or setup fails. + * @returns {Promise} A promise that resolves when the navigation and setup are complete. + */ async _navigate(url) { log.info('Navigating to url %s iteration %s', url, this.index); if (this.numberOfVisitedPages === 0) { @@ -169,6 +271,20 @@ export class Measure { * @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). */ + + /** + * Starts the measurement process for a given URL or an alias. + * + * It supports starting measurements by either directly providing a URL or using an alias. + * If a URL is provided, it navigates to that URL and performs the measurement. + * If an alias is provided, or no URL is available, it sets up the environment for a user-driven navigation. + * + * @async + * @param {string} urlOrAlias - The URL to navigate to, or an alias representing the test. + * @param {string} [optionalAlias] - An optional alias that can be used if the first parameter is a URL. + * @throws {Error} Throws an error if navigation fails or if there are issues in the setup process. + * @returns {Promise} A promise that resolves when the start process is complete, or rejects if there are errors. + */ async start(urlOrAlias, optionalAlias) { let url, alias; if ( @@ -258,8 +374,14 @@ export class Measure { } /** - * Stop measuring and collect all the metrics. - * @returns {Promise} Promise object represents all the metrics has been collected. + * Stops the measurement process, collects metrics, and handles any post-measurement tasks. + * It finalizes the URL being tested, manages any URL-specific metadata, stops any ongoing video recordings, + * and initiates the data collection process. + * + * @async + * @param {string} testedStartUrl - The URL that was initially tested. If not provided, it will be obtained from the browser. + * @throws {Error} Throws an error if there are issues in stopping the measurement or collecting data. + * @returns {Promise} A promise that resolves with the collected metrics data. */ async stop(testedStartUrl) { log.debug('Stop measuring'); @@ -326,9 +448,12 @@ export class Measure { } /** - * Add your own metric. - * @param {string} name - * @param {*} value + * Adds a custom metric to the current measurement result. + * This method should be called after a measurement has started and before it has stopped. + * + * @param {string} name - The name of the metric. + * @param {*} value - The value of the metric. + * @throws {Error} Throws an error if called before a measurement cycle has started. */ add(name, value) { if (this.result[this.numberOfMeasuredPages - 1]) { @@ -341,8 +466,12 @@ export class Measure { } /** - * Add your own metrics. You can add an object witch multiple keys and they will all be collected. - * @param {*} object + * Adds multiple custom metrics to the current measurement result. + * This method accepts an object containing multiple key-value pairs representing different metrics. + * Similar to `add`, it should be used within an active measurement cycle. + * + * @param {Object} object - An object containing key-value pairs of metrics to add. + * @throws {Error} Throws an error if called before a measurement cycle has started. */ addObject(object) { if (this.result[this.numberOfMeasuredPages - 1]) { @@ -353,6 +482,10 @@ export class Measure { ); } + /** + * + * @private + */ async collect(url) { if (this.options.tcpdump) { await this.tcpDump.stop(); diff --git a/lib/core/engine/command/meta.js b/lib/core/engine/command/meta.js index ee953bc6f..53ce22798 100644 --- a/lib/core/engine/command/meta.js +++ b/lib/core/engine/command/meta.js @@ -1,9 +1,25 @@ +/** + * Add meta data to your user journey. + * + * @class + */ export class Meta { constructor() {} + /** + * Sets the description for the user journey. + * + * @param {string} text - The text to set as the description. + */ setDescription(text) { this.description = text; } + + /** + * Sets the title for the user journey. + * + * @param {string} text - The text to set as the title. + */ setTitle(text) { this.title = text; } diff --git a/lib/core/engine/command/mouse/clickAndHold.js b/lib/core/engine/command/mouse/clickAndHold.js index 0079c94ff..1f0b9e51c 100644 --- a/lib/core/engine/command/mouse/clickAndHold.js +++ b/lib/core/engine/command/mouse/clickAndHold.js @@ -1,17 +1,31 @@ import intel from 'intel'; import { By, Origin } from 'selenium-webdriver'; const log = intel.getLogger('browsertime.command.mouse'); + +/** + * Provides functionality to click and hold elements on a web page using different strategies. + * + * @class + */ export class ClickAndHold { constructor(browser) { + /** + * @private + */ this.driver = browser.getDriver(); + /** + * @private + */ this.actions = this.driver.actions({ async: true }); } /** - * 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. + * Clicks and holds on an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to interact with. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(xpath) { try { @@ -27,10 +41,12 @@ export class ClickAndHold { } /** - * 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. + * Clicks and holds on an element that matches a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to interact with. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the element is not found. */ async bySelector(selector) { try { @@ -49,9 +65,11 @@ export class ClickAndHold { } /** - * 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. + * Clicks and holds at the current cursor position. + * + * @async + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ async atCursor() { try { @@ -64,11 +82,13 @@ export class ClickAndHold { } /** - * 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. + * Clicks and holds at the specified screen coordinates. + * + * @async + * @param {number} xPos - The x-coordinate on the screen. + * @param {number} yPos - The y-coordinate on the screen. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ async atPosition(xPos, yPos) { try { @@ -86,10 +106,12 @@ export class ClickAndHold { } /** - * 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. + * Releases the mouse button on an element matching the specified XPath. + * + * @async + * @param {string} xpath - The XPath selector of the element to release the mouse on. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ async releaseAtXpath(xpath) { try { @@ -103,10 +125,12 @@ export class ClickAndHold { } /** - * 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. + * Releases the mouse button on an element matching the specified CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to release the mouse on. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ async releaseAtSelector(selector) { try { @@ -120,11 +144,13 @@ export class ClickAndHold { } /** - * 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. + * Releases the mouse button at the specified screen coordinates. + * + * @async + * @param {number} xPos - The x-coordinate on the screen. + * @param {number} yPos - The y-coordinate on the screen. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ async releaseAtPosition(xPos, yPos) { try { diff --git a/lib/core/engine/command/mouse/contextClick.js b/lib/core/engine/command/mouse/contextClick.js index d3bea313e..cf7e34c45 100644 --- a/lib/core/engine/command/mouse/contextClick.js +++ b/lib/core/engine/command/mouse/contextClick.js @@ -1,17 +1,31 @@ import intel from 'intel'; import { By } from 'selenium-webdriver'; const log = intel.getLogger('browsertime.command.mouse'); + +/** + * Provides functionality to perform a context click (right-click) on elements in a web page. + * + * @class + */ export class ContextClick { constructor(browser) { + /** + * @private + */ this.driver = browser.getDriver(); + /** + * @private + */ this.actions = this.driver.actions({ async: true }); } /** - * 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 + * Performs a context click (right-click) on an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to context click. + * @returns {Promise} A promise that resolves when the context click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(xpath) { try { @@ -25,10 +39,12 @@ export class ContextClick { } /** - * 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 + * Performs a context click (right-click) on an element that matches a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to context click. + * @returns {Promise} A promise that resolves when the context click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async bySelector(selector) { try { @@ -44,9 +60,11 @@ export class ContextClick { } /** - * 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. + * Performs a context click (right-click) at the current cursor position. + * + * @async + * @returns {Promise} A promise that resolves when the context click action is performed. + * @throws {Error} Throws an error if the context click action cannot be performed. */ async atCursor() { try { diff --git a/lib/core/engine/command/mouse/doubleClick.js b/lib/core/engine/command/mouse/doubleClick.js index 951d96aee..0bb8f1195 100644 --- a/lib/core/engine/command/mouse/doubleClick.js +++ b/lib/core/engine/command/mouse/doubleClick.js @@ -1,18 +1,35 @@ import intel from 'intel'; import { By } from 'selenium-webdriver'; const log = intel.getLogger('browsertime.command.mouse'); +/** + * Provides functionality to perform a double-click action on elements in a web page. + * + * @class + */ export class DoubleClick { constructor(browser, pageCompleteCheck) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.actions = this.browser.getDriver().actions({ async: true }); + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; } /** - * 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. + * Performs a mouse double-click on an element matching a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to double-click. + * @param {Object} [options] - Additional options for the double-click action. + * @returns {Promise} A promise that resolves when the double-click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(xpath, options) { try { @@ -31,10 +48,13 @@ export class DoubleClick { } /** - * 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. + * Performs a mouse double-click on an element matching a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to double-click. + * @param {Object} [options] - Additional options for the double-click action. + * @returns {Promise} A promise that resolves when the double-click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async bySelector(selector, options) { try { @@ -55,9 +75,12 @@ export class DoubleClick { } /** - * 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. + * Performs a mouse double-click at the current cursor position. + * + * @async + * @param {Object} [options] - Additional options for the double-click action. + * @returns {Promise} A promise that resolves when the double-click occurs. + * @throws {Error} Throws an error if the double-click action cannot be performed. */ async atCursor(options) { try { diff --git a/lib/core/engine/command/mouse/mouseMove.js b/lib/core/engine/command/mouse/mouseMove.js index 6af8145a1..c70c10a29 100644 --- a/lib/core/engine/command/mouse/mouseMove.js +++ b/lib/core/engine/command/mouse/mouseMove.js @@ -1,17 +1,30 @@ import intel from 'intel'; import { By, Origin } from 'selenium-webdriver'; const log = intel.getLogger('browsertime.command.mouse'); +/** + * Provides functionality to move the mouse cursor to elements or specific positions on a web page. + * + * @class + */ export class MouseMove { constructor(browser) { + /** + * @private + */ this.driver = browser.getDriver(); + /** + * @private + */ this.actions = this.driver.actions({ async: true }); } /** - * 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 + * Moves the mouse cursor to an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to move to. + * @returns {Promise} A promise that resolves when the mouse has moved to the element. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(xpath) { try { @@ -25,10 +38,12 @@ export class MouseMove { } /** - * 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 + * Moves the mouse cursor to an element that matches a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to move to. + * @returns {Promise} A promise that resolves when the mouse has moved to the element. + * @throws {Error} Throws an error if the element is not found. */ async bySelector(selector) { try { @@ -42,10 +57,13 @@ export class MouseMove { } /** - * 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 + * Moves the mouse cursor to a specific position on the screen. + * + * @async + * @param {number} xPos - The x-coordinate on the screen to move to. + * @param {number} yPos - The y-coordinate on the screen to move to. + * @returns {Promise} A promise that resolves when the mouse has moved to the specified position. + * @throws {Error} Throws an error if the action cannot be performed. */ async toPosition(xPos, yPos) { try { @@ -58,10 +76,13 @@ export class MouseMove { } /** - * 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 + * Moves the mouse cursor by an offset from its current position. + * + * @async + * @param {number} xOffset - The x offset to move by. + * @param {number} yOffset - The y offset to move by. + * @returns {Promise} A promise that resolves when the mouse has moved by the specified offset. + * @throws {Error} Throws an error if the action cannot be performed. */ async byOffset(xOffset, yOffset) { try { diff --git a/lib/core/engine/command/mouse/singleClick.js b/lib/core/engine/command/mouse/singleClick.js index 7c6b1d10a..d45810342 100644 --- a/lib/core/engine/command/mouse/singleClick.js +++ b/lib/core/engine/command/mouse/singleClick.js @@ -1,18 +1,36 @@ import intel from 'intel'; import { By } from 'selenium-webdriver'; const log = intel.getLogger('browsertime.command.mouse'); + +/** + * Provides functionality to perform a single click action on elements or at specific positions in a web page. + * + * @class + */ export class SingleClick { constructor(browser, pageCompleteCheck) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.actions = this.browser.getDriver().actions({ async: true }); + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; } /** - * 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. + * Performs a single mouse click on an element matching a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to click. + * @param {Object} [options] - Additional options for the click action. + * @returns {Promise} A promise that resolves when the single click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async byXpath(xpath, options) { try { @@ -31,10 +49,13 @@ export class SingleClick { } /** - * 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. + * Performs a single mouse click on an element matching a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to click. + * @param {Object} [options] - Additional options for the click action. + * @returns {Promise} A promise that resolves when the single click action is performed. + * @throws {Error} Throws an error if the element is not found. */ async bySelector(selector, options) { try { @@ -55,10 +76,12 @@ export class SingleClick { } /** - * 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. + * Performs a single mouse click at the current cursor position. + * + * @async + * @param {Object} [options] - Additional options for the click action. + * @returns {Promise} A promise that resolves when the single click occurs. + * @throws {Error} Throws an error if the single click action cannot be performed. */ async atCursor(options) { try { diff --git a/lib/core/engine/command/navigation.js b/lib/core/engine/command/navigation.js index 0226b464a..0f2b9b25c 100644 --- a/lib/core/engine/command/navigation.js +++ b/lib/core/engine/command/navigation.js @@ -1,14 +1,31 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.navigation'); +/** + * Provides functionality to control browser navigation such as back, forward, and refresh actions. + * + * @class + */ + export class Navigation { constructor(browser, pageCompleteCheck) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; } /** - * Navigate backward in history + * Navigates backward in the browser's history. + * + * @async + * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run. + * @returns {Promise} A promise that resolves when the navigation action is completed. + * @throws {Error} Throws an error if navigation fails. */ async back(options) { const driver = this.browser.getDriver(); @@ -25,7 +42,12 @@ export class Navigation { } /** - * Navigate forward in history + * Navigates forward in the browser's history. + * + * @async + * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run. + * @returns {Promise} A promise that resolves when the navigation action is completed. + * @throws {Error} Throws an error if navigation fails. */ async forward(options) { const driver = this.browser.getDriver(); @@ -42,7 +64,12 @@ export class Navigation { } /** - * Refresh page + * Refreshes the current page. + * + * @async + * @param {Object} [options] - Additional options for refresh action. Set {wait:true} to wait for the page complete check to run. + * @returns {Promise} A promise that resolves when the page has been refreshed. + * @throws {Error} Throws an error if refreshing the page fails. */ async refresh(options) { const driver = this.browser.getDriver(); diff --git a/lib/core/engine/command/screenshot.js b/lib/core/engine/command/screenshot.js index f8bc3c3b2..f4db10501 100644 --- a/lib/core/engine/command/screenshot.js +++ b/lib/core/engine/command/screenshot.js @@ -1,11 +1,42 @@ +import intel from 'intel'; +const log = intel.getLogger('browsertime.command.screenshot'); + +/** + * Take a screenshot. The screenshot will be stored to disk, + * named by the name provided to the take function. + * + * @class + */ export class Screenshot { constructor(screenshotManager, browser, index) { + /** + * @private + */ this.screenshotManager = screenshotManager; + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.index = index; } + /** + * Takes a screenshot and saves it using the screenshot manager. + * + * @async + * @param {string} name The name to assign to the screenshot file. + * @throws {Error} Throws an error if the name parameter is not provided. + * @returns {Promise} A promise that resolves with the screenshot details. + */ + async take(name) { + if (!name) { + log.error('Missing name for the screenshot'); + throw new Error(`Could not store screenshot for missing name`); + } const url = await this.browser .getDriver() .executeScript('return document.documentURI;'); diff --git a/lib/core/engine/command/scroll.js b/lib/core/engine/command/scroll.js index ed1ad0d78..e009fb14f 100644 --- a/lib/core/engine/command/scroll.js +++ b/lib/core/engine/command/scroll.js @@ -1,16 +1,31 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.scroll'); const delay = ms => new Promise(res => setTimeout(res, ms)); + +/** + * Provides functionality to control page scrolling in the browser. + * + * @class + */ export class Scroll { constructor(browser, options) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.options = options; } /** - * 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 + * Scrolls the page by the specified number of pixels. + * + * @async + * @param {number} Xpixels - The number of pixels to scroll horizontally. + * @param {number} Ypixels - The number of pixels to scroll vertically. + * @returns {Promise} A promise that resolves when the scrolling action is completed. */ async byPixels(Xpixels, Ypixels) { const script = `window.scrollBy(${Xpixels}, ${Ypixels});`; @@ -18,10 +33,12 @@ export class Scroll { } /** - * 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. + * Scrolls the page by the specified number of lines. This method is only supported in Firefox. + * + * @async + * @param {number} lines - The number of lines to scroll. + * @returns {Promise} A promise that resolves when the scrolling action is completed. + * @throws {Error} Throws an error if not used in Firefox. */ async byLines(lines) { if (this.options.browser !== 'firefox') { @@ -38,9 +55,11 @@ export class Scroll { } /** - * Scroll the page by the specified pages. - * @param {number} Pages - * @returns {Promise} Promise object represents when scrolling the page has been finished. + * Scrolls the page by the specified number of pages. + * + * @async + * @param {number} pages - The number of pages to scroll. + * @returns {Promise} A promise that resolves when the scrolling action is completed. */ async byPages(pages) { if (this.options.browser === 'firefox') { @@ -55,9 +74,11 @@ export class Scroll { } /** - * 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. + * Scrolls to the bottom of the page, scrolling page by page with a delay between each scroll. + * + * @async + * @param {number} [delayTime=250] - The delay time in milliseconds between each scroll. + * @returns {Promise} A promise that resolves when the scrolling to the bottom is completed. */ async toBottom(delayTime = 250) { const pages = await this.browser.runScript( diff --git a/lib/core/engine/command/select.js b/lib/core/engine/command/select.js index d105c69d9..9d0a76a2e 100644 --- a/lib/core/engine/command/select.js +++ b/lib/core/engine/command/select.js @@ -1,18 +1,27 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.select'); +/** + * Provides functionality to interact with `` element by its ID and the value of the option. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ async selectByIdAndValue(selectId, value) { try { @@ -26,12 +35,13 @@ export class Select { } /** - * 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 + * Selects an option in a `` element. + * @param {string} value - The value of the option to select. + * @returns {Promise} A promise that resolves when the option is selected. + * @throws {Error} Throws an error if the `` element by its ID and the index of the option. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ async selectByIdAndIndex(selectId, index) { try { @@ -70,12 +81,13 @@ export class Select { } /** - * 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 + * Selects an option in a `` element. + * @param {number} index - The index of the option to select. + * @returns {Promise} A promise that resolves when the option is selected. + * @throws {Error} Throws an error if the `` element by its ID. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ async deselectById(selectId) { try { @@ -111,10 +125,12 @@ export class Select { } /** - * 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 + * Retrieves all option values in a `` element. + * @returns {Promise} A promise that resolves with an array of the values of the options. + * @throws {Error} Throws an error if the `` element by its ID. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ async getSelectedValueById(selectId) { try { diff --git a/lib/core/engine/command/set.js b/lib/core/engine/command/set.js index 23e912a89..43b51ec2f 100644 --- a/lib/core/engine/command/set.js +++ b/lib/core/engine/command/set.js @@ -1,18 +1,27 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.set'); +/** + * Provides functionality to set properties like innerHTML, innerText, and value on elements in a web page. + * + * @class + */ export class Set { constructor(browser) { + /** + * @private + */ this.browser = browser; } /** - * 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 + * Sets the innerHTML of an element using a CSS selector. + * + * @async + * @param {string} html - The HTML string to set as innerHTML. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the innerHTML is set. + * @throws {Error} Throws an error if the element is not found. */ async innerHtml(html, selector) { try { @@ -28,12 +37,13 @@ export class Set { } /** - * 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 + * Sets the innerHTML of an element using its ID. + * + * @async + * @param {string} html - The HTML string to set as innerHTML. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the innerHTML is set. + * @throws {Error} Throws an error if the element is not found. */ async innerHtmlById(html, id) { try { @@ -47,12 +57,13 @@ export class Set { } /** - * 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 + * Sets the innerText of an element using a CSS selector. + * + * @async + * @param {string} text - The text to set as innerText. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the innerText is set. + * @throws {Error} Throws an error if the element is not found. */ async innerText(text, selector) { try { @@ -68,12 +79,13 @@ export class Set { } /** - * 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 + * Sets the innerText of an element using its ID. + * + * @async + * @param {string} text - The text to set as innerText. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the innerText is set. + * @throws {Error} Throws an error if the element is not found. */ async innerTextById(text, id) { try { @@ -87,12 +99,13 @@ export class Set { } /** - * 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 + * Sets the value of an element using a CSS selector. + * + * @async + * @param {string} value - The value to set on the element. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the value is set. + * @throws {Error} Throws an error if the element is not found. */ async value(value, selector) { try { @@ -106,12 +119,13 @@ export class Set { } /** - * 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 + * Sets the value of an element using its ID. + * + * @async + * @param {string} value - The value to set on the element. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the value is set. + * @throws {Error} Throws an error if the element is not found. */ async valueById(value, id) { try { diff --git a/lib/core/engine/command/stopWatch.js b/lib/core/engine/command/stopWatch.js index 6754e8450..2d9f0dc49 100644 --- a/lib/core/engine/command/stopWatch.js +++ b/lib/core/engine/command/stopWatch.js @@ -1,25 +1,39 @@ import { performance } from 'node:perf_hooks'; import intel from 'intel'; const log = intel.getLogger('browsertime.command.stopwatch'); + +/** + * A stopwatch utility for measuring time intervals. + * + * @class + */ export class StopWatch { constructor(name, measure) { + /** + * @private + */ this.name = name; + /** + * @private + */ this.measure = measure; + /** + * @private + */ this.start = performance.now(); } /** - * Start the the stop watch + * Starts the stopwatch. */ start() { this.start = performance.now(); } /** - * 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 + * Stops the stopwatch and automatically adds the measured time to the + * last measured page. Logs an error if no page has been measured. + * @returns {number} The measured time in milliseconds. */ stopAndAdd() { this.stop = performance.now(); @@ -29,8 +43,8 @@ export class StopWatch { } /** - * Stop the watch - * @returns the measured time + * Stops the stopwatch. + * @returns {number} The measured time in milliseconds. */ stop() { this.stop = performance.now(); @@ -39,19 +53,25 @@ export class StopWatch { } /** - * Get the name of the watch. - * @returns The name of the watch + * Gets the name of the stopwatch. + * @returns {string} The name of the stopwatch. */ getName() { return this.name; } } +/** + * @private + */ export class Watch { constructor(measure) { this.measure = measure; } + /** + * @private + */ get(name) { return new StopWatch(name, this.measure); } diff --git a/lib/core/engine/command/switch.js b/lib/core/engine/command/switch.js index 56463ea57..1b94ae531 100644 --- a/lib/core/engine/command/switch.js +++ b/lib/core/engine/command/switch.js @@ -2,16 +2,33 @@ import intel from 'intel'; import { By } from 'selenium-webdriver'; const log = intel.getLogger('browsertime.command.switch'); +/** + * Provides functionality to switch between frames, windows, and tabs in the browser. + * + * @class + */ export class Switch { constructor(browser, pageCompleteCheck, navigate) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; + /** + * @private + */ this.navigate = navigate; } /** - * Switch to frame by id - * @param {*} id + * Switches to a frame identified by its ID. + * + * @async + * @param {string|number} id - The ID of the frame. + * @throws {Error} Throws an error if switching to the frame fails. */ async toFrame(id) { const driver = this.browser.getDriver(); @@ -25,8 +42,11 @@ export class Switch { } /** - * Switch to frame by xpath - * @param {*} xpath + * Switches to a frame identified by an XPath. + * + * @async + * @param {string} xpath - The XPath of the frame element. + * @throws {Error} Throws an error if the frame is not found or switching fails. */ async toFrameByXpath(xpath) { const driver = this.browser.getDriver(); @@ -46,8 +66,11 @@ export class Switch { } /** - * Switch to frame by xpath - * @param {*} xpath + * Switches to a frame identified by a CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the frame element. + * @throws {Error} Throws an error if the frame is not found or switching fails. */ async toFrameBySelector(selector) { const driver = this.browser.getDriver(); @@ -67,8 +90,11 @@ export class Switch { } /** - * Switch to a window by name - * @param {*} name + * Switches to a window identified by its name. + * + * @async + * @param {string} name - The name of the window. + * @throws {Error} Throws an error if switching to the window fails. */ async toWindow(name) { const driver = this.browser.getDriver(); @@ -82,7 +108,10 @@ export class Switch { } /** - * Switch to parent frame + * Switches to the parent frame of the current frame. + * + * @async + * @throws {Error} Throws an error if switching to the parent frame fails. */ async toParentFrame() { const driver = this.browser.getDriver(); @@ -96,7 +125,11 @@ export class Switch { } /** - * Create a new tab and switch to it. Optionally, navigate to a given url. + * Opens a new tab and optionally navigates to a URL. + * + * @async + * @param {string} [url] - Optional URL to navigate to in the new tab. + * @throws {Error} Throws an error if opening a new tab fails. */ async toNewTab(url) { try { @@ -115,7 +148,11 @@ export class Switch { } /** - * Create a new window and switch to it. Optionally, navigate to a given url. + * Opens a new window and optionally navigates to a URL. + * + * @async + * @param {string} [url] - Optional URL to navigate to in the new window. + * @throws {Error} Throws an error if opening a new window fails. */ async toNewWindow(url) { try { diff --git a/lib/core/engine/command/wait.js b/lib/core/engine/command/wait.js index 25c6c23b3..48b15dd5c 100644 --- a/lib/core/engine/command/wait.js +++ b/lib/core/engine/command/wait.js @@ -3,18 +3,31 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.wait'); const delay = ms => new Promise(res => setTimeout(res, ms)); +/** + * Provides functionality to wait for different conditions in the browser. + * + * @class + */ export class Wait { constructor(browser, pageCompleteCheck) { + /** + * @private + */ this.browser = browser; + /** + * @private + */ this.pageCompleteCheck = pageCompleteCheck; } /** - * 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 + * Waits for an element with a specific ID to appear within a maximum time. + * + * @async + * @param {string} id - The ID of the element to wait for. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the element is found or the time times out. + * @throws {Error} Throws an error if the element is not found within the specified time. */ async byId(id, maxTime) { const driver = this.browser.getDriver(); @@ -33,11 +46,13 @@ export class Wait { } /** - * 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 + * Waits for an element located by XPath to appear within a maximum time. + * + * @async + * @param {string} xpath - The XPath of the element to wait for. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the element is found or the time times out. + * @throws {Error} Throws an error if the element is not found within the specified time. */ async byXpath(xpath, maxTime) { const driver = this.browser.getDriver(); @@ -58,11 +73,13 @@ export class Wait { } /** - * 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 + * Waits for an element located by a CSS selector to appear within a maximum time. + * + * @async + * @param {string} selector - The CSS selector of the element to wait for. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the element is found or the time times out. + * @throws {Error} Throws an error if the element is not found within the specified time. */ async bySelector(selector, maxTime) { const driver = this.browser.getDriver(); @@ -87,28 +104,34 @@ export class Wait { } /** - * Wait for x ms. - * @param {number} ms The tine in ms to wait. - * @returns {Promise} Promise object represents when the time has timed out. + * Waits for a specified amount of time. + * + * @async + * @param {number} ms - The time in milliseconds to wait. + * @returns {Promise} A promise that resolves when the specified time has elapsed. */ async byTime(ms) { return delay(ms); } /** - * Wait for the page to finish loading. - * @returns {Promise} Promise object represents when the pageCompleteCheck has finished. + * Waits for the page to finish loading. + * + * @async + * @returns {Promise} A promise that resolves when the page complete check has finished. */ async byPageToComplete() { return this.browser.extraWait(this.pageCompleteCheck); } /** - * 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 + * Waits for a JavaScript condition to return a truthy value within a maximum time. + * + * @async + * @param {string} jsExpression - The JavaScript expression to evaluate. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the condition becomes truthy or the time times out. + * @throws {Error} Throws an error if the condition is not met within the specified time. */ async byCondition(jsExpression, maxTime) { const driver = this.browser.getDriver(); diff --git a/lib/core/engine/commands.js b/lib/core/engine/commands.js index 879b17f01..134c5a91c 100644 --- a/lib/core/engine/commands.js +++ b/lib/core/engine/commands.js @@ -12,7 +12,6 @@ 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 { @@ -77,39 +76,174 @@ export class Commands { engineDelegate, options.browser ); + + /** + * Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome. + * @type {ChromeTrace} + */ this.trace = new ChromeTrace(engineDelegate, index, options, result); - this.android = new Android(options); - this.debug = new Debug(browser, options); + + /** + * Provides functionality to perform click actions on elements in a web page using various selectors. + * @type {Click} + */ this.click = new Click(browser, pageCompleteCheck); + + /** + * Provides functionality to control page scrolling in the browser. + * @type {Scroll} + */ this.scroll = new Scroll(browser, options); + + /** + * Provides functionality to add text to elements on a web page using various selectors. + * @type {AddText} + */ this.addText = new AddText(browser); + + /** + * Provides functionality to wait for different conditions in the browser. + * @type {Wait} + */ this.wait = new Wait(browser, pageCompleteCheck); + + /** + * Provides functionality for measuring a navigation. + * @type {Measure} + */ this.measure = measure; + + /** + * Navigates to a specified URL and handles additional setup for a page visit. + * @type {Function} + * @async + * @param {string} url - The URL to navigate to. + * @throws {Error} Throws an error if navigation or setup fails. + * @returns {Promise} A promise that resolves when the navigation and setup are + */ this.navigate = measure._navigate.bind(measure); + + /** + * Provides functionality to control browser navigation such as back, forward, and refresh actions. + * @type {Navigation} + */ this.navigation = new Navigation(browser, pageCompleteCheck); + + /** + * Add a text that will be an error attached to the current page. + * @param {string} message - The error message. + * @type {Function} + */ this.error = measure._error.bind(measure); + + /** + * Mark this run as an failure. Add a message that explains the failure. + * @param {string} message - The message attached as a failure. + * @type {Function} + */ this.markAsFailure = measure._failure.bind(measure); + + /** + * Executes JavaScript in the browser context. + * @type {JavaScript} + */ this.js = new JavaScript(browser, pageCompleteCheck); + + /** + * Switches context to different frames, windows, or tabs in the browser. + * @type {Switch} + */ this.switch = new Switch( browser, pageCompleteCheck, measure._navigate.bind(measure) ); + + /** + * Sets values on HTML elements in the page. + * @type {Set} + */ this.set = new Set(browser); + + /** + * Stopwatch utility for measuring time intervals. + * @type {StopWatch} + */ this.stopWatch = new StopWatch(measure); + + /** + * Manages the browser's cache. + * @type {Cache} + */ this.cache = new Cache(browser, options.browser, extensionServer, cdp); + + /** + * Adds metadata to the user journey. + * @type {Meta} + */ this.meta = new Meta(); + + /** + * Takes and manages screenshots. + * @type {Screenshot} + */ this.screenshot = new Screenshot(screenshotManager, browser, index); + + /** + * Use the Chrome DevTools Protocol, available in Chrome and Edge. + * @type {ChromeDevelopmentToolsProtocol} + */ this.cdp = cdp; + + /** + * Provides commands for interacting with an Android device. + * @type {AndroidCommand} + */ this.android = new AndroidCommand(options); + + /** + * Provides debugging capabilities within a browser automation script. + * It allows setting breakpoints to pause script execution and inspect the current state. + * @type {Debug} + */ this.debug = new Debug(browser, options); + + /** + * Interact with the page using the mouse. + * @type {Object} + */ this.mouse = { + /** + * Move the mouse cursor to elements or specific positions on a web page. + * @type {MouseMove} + */ moveTo: new MouseMove(browser), + /** + * Perform a context click (right-click) on elements in a web page. + * @type {ContextClick} + */ contextClick: new ContextClick(browser), + /** + * Provides functionality to perform a single click action on elements or at specific positions in a web page. + * @type {SingleClick} + */ singleClick: new SingleClick(browser, pageCompleteCheck), + /** + * Provides functionality to perform a double-click action on elements in a web page. + * @type {DoubleClick} + */ doubleClick: new DoubleClick(browser, pageCompleteCheck), + /** + * Provides functionality to click and hold elements on a web page using different strategies. + * @type {ClickAndHold} + */ clickAndHold: new ClickAndHold(browser) }; + + /** + * Interact with a select element. + * @type {Select} + */ this.select = new Select(browser); } } diff --git a/lib/core/engine/context.js b/lib/core/engine/context.js index b2791ff37..92f45a295 100644 --- a/lib/core/engine/context.js +++ b/lib/core/engine/context.js @@ -1,20 +1,24 @@ +/** + * @typedef {Object} Logger + * @property {function(string): void} trace - Function to log trace messages. + * @property {function(string): void} verbose - Function to log verbose messages. + * @property {function(string): void} info - Function to log info messages. + * @property {function(string): void} warn - Function to log warning messages. + * @property {function(string): void} error - Function to log error messages. + * @property {function(string): void} critical - Function to log critical messages. + */ + +/** + * @typedef {typeof import('selenium-webdriver')} WebDriverClass + * @typedef {import('selenium-webdriver').WebDriver} WebDriverInstance + */ + /** * 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, @@ -25,26 +29,30 @@ export class Context { instantiatedDriver ) { /** + * This is the yargs object you get from the cli. If you add --my.id you can get that using options.my.id. * @type {Object} */ this.options = options; /** + * Here the result from each run is stored. * @type {Object} */ this.result = result; /** - * @type {intel.Logger} + * @type {Logger} */ this.log = log; /** + * The index of the iteration. * @type {number} */ this.index = index; /** + * Storage manager to save things to disk. * @type {import('../../support/storageManager.js').StorageManager} */ this.storageManager = storageManager; @@ -55,10 +63,17 @@ export class Context { this.taskData = {}; /** - * @type {{webdriver: import('selenium-webdriver').WebDriver, driver: import('selenium-webdriver').WebDriver}} + * Get raw Selenium functionality. + * @type {{webdriver: WebDriverClass, driver: WebDriverInstance}} */ this.selenium = { + /** + * @typedef {typeof import('selenium-webdriver')} WebDriverClass + */ webdriver, + /** + * @typedef {import('selenium-webdriver').WebDriver} WebDriverInstance + */ driver: instantiatedDriver }; } diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 94e0beca4..053dbf439 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -20,7 +20,7 @@ import { jsonifyVisualProgress } from '../../support/util.js'; import { flushDNS } from '../../support/dns.js'; import { getNumberOfRunningProcesses } from '../../support/processes.js'; -import { isAndroidConfigured } from '../../android/index.js'; +import { isAndroidConfigured, Android } from '../../android/index.js'; const log = intel.getLogger('browsertime'); const delay = ms => new Promise(res => setTimeout(res, ms)); @@ -140,7 +140,8 @@ export class Iteration { // browser to get ready if (isAndroidConfigured(options)) { await delay(ANDROID_DELAY_TIME); - batteryTemperature.start = await commands.android.getTemperature(); + this.android = new Android(options); + batteryTemperature.start = await this.android.getTemperature(); } await delay(options.timeToSettle || 100); @@ -210,8 +211,8 @@ export class Iteration { await engineDelegate.afterBrowserStopped(); if (isAndroidConfigured(options)) { - batteryTemperature.stop = await commands.android.getTemperature(); - await commands.android.removeDevtoolsFw(); + batteryTemperature.stop = await this.android.getTemperature(); + await this.android.removeDevtoolsFw(); } if (options.visualMetrics && !options.videoParams.debug) { diff --git a/types/core/engine/command/addText.d.ts b/types/core/engine/command/addText.d.ts index 6c8bf8daf..f18cce28e 100644 --- a/types/core/engine/command/addText.d.ts +++ b/types/core/engine/command/addText.d.ts @@ -1,50 +1,63 @@ +/** + * Provides functionality to add text to elements on a web page using various selectors. + * + * @class + */ 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 + * @private */ - byId(text: string, id: string): Promise; + private browser; /** - * 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 + * Adds text to an element identified by its ID. + * + * @async + * @param {string} text - The text string to add. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ - byXpath(text: string, xpath: string): Promise; + 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} 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 + * Adds text to an element identified by its XPath. + * + * @async + * @param {string} text - The text string to add. + * @param {string} xpath - The XPath of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ - bySelector(text: string, selector: string): Promise; + 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} 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 + * Adds text to an element identified by its CSS selector. + * + * @async + * @param {string} text - The text string to add. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ - byClassName(text: string, className: string): Promise; + 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} 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 + * Adds text to an element identified by its class name. + * + * @async + * @param {string} text - The text string to add. + * @param {string} className - The class name of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws an error if the element is not found. */ - byName(text: string, name: string): Promise; + byClassName(text: string, className: string): Promise; + /** + * Adds text to an element identified by its name attribute. + * + * @async + * @param {string} text - The text string to add. + * @param {string} name - The name attribute of the element. + * @returns {Promise} A promise that resolves when the text has been added. + * @throws {Error} Throws 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 index a4bc785cd..9561176de 100644 --- a/types/core/engine/command/addText.d.ts.map +++ b/types/core/engine/command/addText.d.ts.map @@ -1 +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 +{"version":3,"file":"addText.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/addText.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,WALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,cALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,iBALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,kBALW,MAAM,aACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,aALW,MAAM,QACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;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 index cbc5b1c76..91cb2c0db 100644 --- a/types/core/engine/command/android.d.ts +++ b/types/core/engine/command/android.d.ts @@ -1,13 +1,24 @@ +/** + * Provides functionality to interact with an Android device through shell commands. + * + * @class + */ 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 + * @private */ - shell(command: string): Promise; + private options; + /** + * Runs a shell command on the connected Android device. + * This method requires the Android device to be properly configured. + * + * @async + * @param {string} command - The shell command to run on the Android device. + * @returns {Promise} A promise that resolves with the result of the command or rejects if there's an error. + * @throws {Error} Throws an error if Android is not configured or if the command fails. + */ + shell(command: string): Promise; a: Android; } import { Android } from '../../../android/index.js'; diff --git a/types/core/engine/command/android.d.ts.map b/types/core/engine/command/android.d.ts.map index d96ec6747..0b425e4ed 100644 --- a/types/core/engine/command/android.d.ts.map +++ b/types/core/engine/command/android.d.ts.map @@ -1 +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 +{"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/android.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,eAJW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAc3B;IAPK,WAAkC;CAQzC;wBApC4C,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 index de5cb2cc5..0a182e7bc 100644 --- a/types/core/engine/command/cache.d.ts +++ b/types/core/engine/command/cache.d.ts @@ -1,3 +1,9 @@ +/** + * Manage the browser cache. + * This class provides methods to clear the cache and cookies in different browsers. + * + * @class + */ export class Cache { constructor(browser: any, browserName: any, extensionServer: any, cdp: any); /** diff --git a/types/core/engine/command/cache.d.ts.map b/types/core/engine/command/cache.d.ts.map index 10c01ed12..ecf9a9e1a 100644 --- a/types/core/engine/command/cache.d.ts.map +++ b/types/core/engine/command/cache.d.ts.map @@ -1 +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 +{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/cache.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;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 index cafd6855d..57204617f 100644 --- a/types/core/engine/command/chromeDevToolsProtocol.d.ts +++ b/types/core/engine/command/chromeDevToolsProtocol.d.ts @@ -1,10 +1,55 @@ +/** + * Manages interactions with the Chrome DevTools Protocol for Chrome and Edge browsers. + * Allows sending commands and setting up event listeners via the protocol. + * See https://chromedevtools.github.io/devtools-protocol/ + * + * @class + */ export class ChromeDevelopmentToolsProtocol { constructor(engineDelegate: any, browserName: any); - engineDelegate: any; - browserName: any; - on(event: any, f: any): Promise; - sendAndGet(command: any, arguments_: any): Promise; + /** + * @private + */ + private engineDelegate; + /** + * @private + */ + private browserName; + /** + * Sets up an event listener for a specific DevTools Protocol event. + * + * @async + * @param {string} event - The name of the event to listen for. + * @param {Function} f - The callback function to execute when the event is triggered. + * @throws {Error} Throws an error if the browser is not supported or if setting the listener fails. + */ + on(event: string, f: Function): Promise; + /** + * Sends a command to the DevTools Protocol and returns the result. + * + * @async + * @param {string} command - The DevTools Protocol command to send. + * @param {Object} arguments_ - The arguments for the command. + * @throws {Error} Throws an error if the browser is not supported or if the command fails. + * @returns {Promise} The result of the command execution. + */ + sendAndGet(command: string, arguments_: any): Promise; + /** + * Retrieves the raw client for the DevTools Protocol. + * + * @returns {Object} The raw DevTools Protocol client. + * @throws {Error} Throws an error if the browser is not supported. + */ getRawClient(): any; - send(command: any, arguments_: any): Promise; + /** + * Sends a command to the DevTools Protocol. + * + * @async + * @param {string} command - The DevTools Protocol command to send. + * @param {Object} arguments_ - The arguments for the command. + * @throws {Error} Throws an error if the browser is not supported or if the command fails. + * @returns {Promise} A promise that resolves when the command has been sent. + */ + send(command: string, 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 index afab486d4..348cbe5ca 100644 --- a/types/core/engine/command/chromeDevToolsProtocol.d.ts.map +++ b/types/core/engine/command/chromeDevToolsProtocol.d.ts.map @@ -1 +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 +{"version":3,"file":"chromeDevToolsProtocol.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/chromeDevToolsProtocol.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH;IACE,mDASC;IARC;;OAEG;IACH,uBAAoC;IACpC;;OAEG;IACH,oBAA8B;IAGhC;;;;;;;OAOG;IACH,UAJW,MAAM,8BAuBhB;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,oBAGJ,YAAe,CAsB3B;IAED;;;;;OAKG;IACH,oBAMC;IAED;;;;;;;;OAQG;IACH,cALW,MAAM,oBAGJ,QAAQ,IAAI,CAAC,CAmBzB;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 index b4d754d02..0fe5de82b 100644 --- a/types/core/engine/command/chromeTrace.d.ts +++ b/types/core/engine/command/chromeTrace.d.ts @@ -1,10 +1,41 @@ +/** + * Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome. + * + * @class + */ export class ChromeTrace { constructor(engineDelegate: any, index: any, options: any, result: any); - engineDelegate: any; - options: any; - result: any; - index: any; - start(): Promise; + /** + * @private + */ + private engineDelegate; + /** + * @private + */ + private options; + /** + * @private + */ + private result; + /** + * @private + */ + private index; + /** + * Starts the Chrome trace collection. + * + * @async + * @returns {Promise} A promise that resolves when tracing is started. + * @throws {Error} Throws an error if not running Chrome or if configuration is not set for custom tracing. + */ + start(): Promise; + /** + * Stops the Chrome trace collection, processes the collected data, and attaches it to the result object. + * + * @async + * @returns {Promise} A promise that resolves when tracing is stopped and data is processed. + * @throws {Error} Throws an error if not running Chrome or if custom tracing was not started. + */ stop(): Promise; events: any; } diff --git a/types/core/engine/command/chromeTrace.d.ts.map b/types/core/engine/command/chromeTrace.d.ts.map index 9072b0516..5a5d934c9 100644 --- a/types/core/engine/command/chromeTrace.d.ts.map +++ b/types/core/engine/command/chromeTrace.d.ts.map @@ -1 +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 +{"version":3,"file":"chromeTrace.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/chromeTrace.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH;IACE,wEAiBC;IAhBC;;OAEG;IACH,uBAAoC;IACpC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,eAAoB;IACpB;;OAEG;IACH,cAAkB;IAGpB;;;;;;OAMG;IACH,SAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;OAMG;IACH,QAHa,QAAQ,IAAI,CAAC,CAuCzB;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 index 27cd95fe1..720cce74c 100644 --- a/types/core/engine/command/click.d.ts +++ b/types/core/engine/command/click.d.ts @@ -1,102 +1,150 @@ +/** + * Provides functionality to perform click actions on elements in a web page using various selectors. + * + * @class + */ 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 + /** + * @private */ - byClassName(className: string): Promise; + private browser; /** - * 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 + * @private */ - byClassNameAndWait(className: string): Promise; + private pageCompleteCheck; /** - * 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 + * Clicks on an element identified by its class name. + * + * @async + * @param {string} className - The class name of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ - byLinkText(text: string): Promise; + byClassName(className: 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 + * Clicks on an element identified by its class name and waits for the page complete check to finish. + * + * @async + * @param {string} className - The class name of the element to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. */ - byLinkTextAndWait(text: string): Promise; + byClassNameAndWait(className: 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 + * Clicks on a link whose visible text matches the given string. + * + * @async + * @param {string} text - The visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the link is not found. */ - byPartialLinkText(text: string): Promise; + byLinkText(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 + * Clicks on a link whose visible text matches the given string and waits for the page complete check to finish. + * + * @async + * @param {string} text - The visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the link is not found. */ - byPartialLinkTextAndWait(text: string): Promise; + byLinkTextAndWait(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 + * Clicks on a link whose visible text contains the given substring. + * + * @async + * @param {string} text - The substring of the visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the link is not found. */ - byXpath(xpath: string): Promise; - /**. - * Click on link that matches a XPath selector and wait for page load complete check to finish + byPartialLinkText(text: string): Promise; + /** + * Clicks on a link whose visible text contains the given substring and waits for the page 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 + * @async + * @param {string} text - The substring of the visible text of the link to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the link is not found. */ - byXpathAndWait(xpath: string): Promise; + byPartialLinkTextAndWait(text: 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 + * Clicks on an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ - byJs(js: string): Promise; + byXpath(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. 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 + * Clicks on an element that matches a given XPath selector and waits for the page complete check to finish. + * + * @async + * @param {string} xpath - The XPath selector of the element to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. */ - byJsAndWait(js: string): Promise; + byXpathAndWait(xpath: 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 + * Clicks on an element located by evaluating a JavaScript expression. + * + * @async + * @param {string} js - The JavaScript expression that evaluates to an element or list of elements. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ - byId(id: string): Promise; + byJs(js: 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 + * Clicks on an element located by evaluating a JavaScript expression and waits for the page complete check to finish. + * + * @async + * @param {string} js - The JavaScript expression that evaluates to an element or list of elements. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. + */ + byJsAndWait(js: string): Promise; + /** + * Clicks on an element located by its ID. + * + * @async + * @param {string} id - The ID of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. */ - byName(name: string): Promise; + byId(id: string): Promise; + /** + * Clicks on an element located by its name attribute. + * + * @async + * @param {string} name - The name attribute of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws 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. + * @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; + byIdAndWait(id: string): Promise; + /** + * Clicks on an element located by its CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to click. + * @returns {Promise} A promise that resolves when the click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ + bySelector(selector: string): Promise; + /** + * Clicks on an element located by its CSS selector and waits for the page complete check to finish. + * + * @async + * @param {string} selector - The CSS selector of the element to click. + * @returns {Promise} A promise that resolves when the click action and page complete check are finished. + * @throws {Error} Throws an error if the element is not found. + */ + bySelectorAndWait(selector: string): 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 index d2f91fba6..71403f9b1 100644 --- a/types/core/engine/command/click.d.ts.map +++ b/types/core/engine/command/click.d.ts.map @@ -1 +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 +{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/click.js"],"names":[],"mappings":"AAYA;;;;GAIG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;OAOG;IACH,uBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,8BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;IAED;;;;;;;OAOG;IACH,iBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,+BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IACD;;;;;;;OAOG;IACH,sBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;OAOG;IACH,SAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,gBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;IAED;;;;;;;OAOG;IACH,SAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,aAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,4BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;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 index d60c2770c..1da52f2c4 100644 --- a/types/core/engine/command/debug.d.ts +++ b/types/core/engine/command/debug.d.ts @@ -1,11 +1,27 @@ +/** + * Provides debugging capabilities within a browser automation script. + * It allows setting breakpoints to pause script execution and inspect the current state. + * + * @class + */ 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. + * @private */ - breakpoint(name: any): Promise; + private browser; + /** + * @private + */ + private options; + /** + * Adds a breakpoint to the script. The browser will pause at the breakpoint, waiting for user input to continue. + * This is useful for debugging and inspecting the browser state at a specific point in the script. + * + * @async + * @param {string} [name] - An optional name for the breakpoint for logging purposes. + * @returns {Promise} A promise that resolves when the user chooses to continue from the breakpoint. + */ + breakpoint(name?: string): 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 index bf28ab37b..28b3528ee 100644 --- a/types/core/engine/command/debug.d.ts.map +++ b/types/core/engine/command/debug.d.ts.map @@ -1 +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 +{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/debug.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;OAOG;IACH,kBAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CA+BzB;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 index bc8542fe7..1a6c89ee4 100644 --- a/types/core/engine/command/geckoProfiler.d.ts +++ b/types/core/engine/command/geckoProfiler.d.ts @@ -1,11 +1,45 @@ +/** + * Manages the Gecko Profiler for profiling Firefox performance. + * + * @class + */ 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; + /** + * @private + */ + private GeckoProfiler; + /** + * @private + */ + private browser; + /** + * @private + */ + private index; + /** + * @private + */ + private options; + /** + * @private + */ + private result; + /** + * Starts the Gecko Profiler. + * + * @async + * @returns {Promise} A promise that resolves when the profiler is started. + * @throws {Error} Throws an error if not running Firefox or if the configuration is not set for custom profiling. + */ + start(): Promise; + /** + * Stops the Gecko Profiler and processes the collected data. + * + * @async + * @returns {Promise} A promise that resolves when the profiler is stopped and the data is processed. + * @throws {Error} Throws an error if not running Firefox or if custom profiling was not started. + */ + 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 index 99dedc076..d81d3f658 100644 --- a/types/core/engine/command/geckoProfiler.d.ts.map +++ b/types/core/engine/command/geckoProfiler.d.ts.map @@ -1 +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 +{"version":3,"file":"geckoProfiler.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/geckoProfiler.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;IACE,qFAqBC;IApBC;;OAEG;IACH,sBAAkC;IAClC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,cAAkB;IAClB;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,eAAoB;IAGtB;;;;;;OAMG;IACH,SAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;OAMG;IACH,QAHa,QAAQ,IAAI,CAAC,CAezB;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 index 75e8e7b88..691e3a979 100644 --- a/types/core/engine/command/javaScript.d.ts +++ b/types/core/engine/command/javaScript.d.ts @@ -1,40 +1,61 @@ +/** + * Provides functionality to execute JavaScript code in the context of the current page. + * + * @class + */ 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 + * @private + */ + private browser; + /** + * @private + */ + private pageCompleteCheck; + /** + * Executes a JavaScript script. + * + * @async + * @param {string} js - The JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed script. + * @throws {Error} Throws an error if the JavaScript cannot be executed. */ 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 + * Executes a JavaScript script and waits for the page complete check to finish. + * + * @async + * @param {string} js - The JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed script and the completion of the page load. + * @throws {Error} Throws an error if the JavaScript cannot be executed. */ 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 + * Executes synchronous privileged JavaScript. + * + * @async + * @param {string} js - The privileged JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed privileged script. + * @throws {Error} Throws an error if the privileged JavaScript cannot be executed. */ 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 + * Executes synchronous privileged JavaScript and waits for the page complete check to finish. + * + * @async + * @param {string} js - The privileged JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed privileged script and the completion of the page load. + * @throws {Error} Throws an error if the privileged JavaScript cannot be executed. */ 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 + * Executes asynchronous privileged JavaScript. + * + * @async + * @param {string} js - The asynchronous privileged JavaScript code to execute. + * @returns {Promise<*>} A promise that resolves with the result of the executed asynchronous privileged script. + * @throws {Error} Throws an error if the asynchronous privileged JavaScript cannot be executed. */ runPrivilegedAsync(js: string): Promise; } diff --git a/types/core/engine/command/javaScript.d.ts.map b/types/core/engine/command/javaScript.d.ts.map index dcd1a8557..3054927d9 100644 --- a/types/core/engine/command/javaScript.d.ts.map +++ b/types/core/engine/command/javaScript.d.ts.map @@ -1 +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 +{"version":3,"file":"javaScript.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/javaScript.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;OAOG;IACH,QAJW,MAAM,GACJ,YAAU,CAYtB;IAED;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,YAAU,CAYtB;IAED;;;;;;;OAOG;IACH,kBAJW,MAAM,GACJ,YAAU,CAetB;IAED;;;;;;;OAOG;IACH,yBAJW,MAAM,GACJ,YAAU,CAYtB;IAED;;;;;;;OAOG;IACH,uBAJW,MAAM,GACJ,YAAU,CAetB;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 index 26c6a3c7a..c8129a97e 100644 --- a/types/core/engine/command/measure.d.ts +++ b/types/core/engine/command/measure.d.ts @@ -1,34 +1,138 @@ +/** + * A measurement tool for browser-based metrics, handling various aspects + * of metric collection including navigation, video recording, and data collection. + * + * @class + */ 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; + /** + * @private + */ + private browser; + /** + * @private + */ + private pageCompleteCheck; + /** + * @private + */ + private index; + /** + * @private + */ + private result; + /** + * @private + */ + private engineDelegate; + /** + * @private + */ + private options; + /** + * @private + */ + private screenshotManager; + /** + * @private + */ + private storageManager; + /** + * @private + */ + private recordVideo; + /** + * @private + */ + private extensionServer; + /** + * @private + */ + private videos; + /** + * @private + */ + private scriptsByCategory; + /** + * @private + */ + private asyncScriptsByCategory; + /** + * @private + */ + private postURLScripts; + /** + * @private + */ + private context; + /** + * @private + */ + private numberOfMeasuredPages; + /** + * @private + */ + private numberOfVisitedPages; + /** + * @private + */ + private areWeMeasuring; + /** + * @private + */ + private testedURLs; + /** + * @private + */ + private tcpDump; + /** + * @private + */ + private ANDROID_DELAY_TIME; + /** + * @private + */ + private IOS_DELAY_TIME; + /** + * @private + */ + private DESKTOP_DELAY_TIME; + /** + * Have a consistent way of starting the video + * @private + */ + private _startVideo; video: Video; - _stopVideo(url: any): Promise; - _error(message: any): void; - _failure(message: any): void; - _navigate(url: any): Promise; + /** + * Have a consistent way of starting stopping the video + * @private + */ + private _stopVideo; + /** + * Have a consistent way of adding an error + * @private + */ + private _error; + /** + * Have a consistent way of adding an failure + * @private + */ + private _failure; + /** + * Navigates to a specified URL and handles additional setup for the first page visit. + * + * This function is responsible for setting up the browser with necessary configurations and + * navigating to the URL. It also waits for the page + * to load completely based on configured page completion check. + * + * @async + * @private + * @param {string} url - The URL to navigate to. + * @throws {Error} Throws an error if navigation or setup fails. + * @returns {Promise} A promise that resolves when the navigation and setup are complete. + */ + private _navigate; /** * 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 @@ -37,25 +141,54 @@ export class Measure { * @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. + * Starts the measurement process for a given URL or an alias. + * + * It supports starting measurements by either directly providing a URL or using an alias. + * If a URL is provided, it navigates to that URL and performs the measurement. + * If an alias is provided, or no URL is available, it sets up the environment for a user-driven navigation. + * + * @async + * @param {string} urlOrAlias - The URL to navigate to, or an alias representing the test. + * @param {string} [optionalAlias] - An optional alias that can be used if the first parameter is a URL. + * @throws {Error} Throws an error if navigation fails or if there are issues in the setup process. + * @returns {Promise} A promise that resolves when the start process is complete, or rejects if there are errors. */ - stop(testedStartUrl: any): Promise; + start(urlOrAlias: string, optionalAlias?: string): Promise; /** - * Add your own metric. - * @param {string} name - * @param {*} value + * Stops the measurement process, collects metrics, and handles any post-measurement tasks. + * It finalizes the URL being tested, manages any URL-specific metadata, stops any ongoing video recordings, + * and initiates the data collection process. + * + * @async + * @param {string} testedStartUrl - The URL that was initially tested. If not provided, it will be obtained from the browser. + * @throws {Error} Throws an error if there are issues in stopping the measurement or collecting data. + * @returns {Promise} A promise that resolves with the collected metrics data. + */ + stop(testedStartUrl: string): Promise; + /** + * Adds a custom metric to the current measurement result. + * This method should be called after a measurement has started and before it has stopped. + * + * @param {string} name - The name of the metric. + * @param {*} value - The value of the metric. + * @throws {Error} Throws an error if called before a measurement cycle has started. */ 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 + * Adds multiple custom metrics to the current measurement result. + * This method accepts an object containing multiple key-value pairs representing different metrics. + * Similar to `add`, it should be used within an active measurement cycle. + * + * @param {Object} object - An object containing key-value pairs of metrics to add. + * @throws {Error} Throws an error if called before a measurement cycle has started. */ addObject(object: any): void; - collect(url: any): Promise; + /** + * + * @private + */ + private collect; } -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 index b9b41e82c..2b6f5a0bc 100644 --- a/types/core/engine/command/measure.d.ts.map +++ b/types/core/engine/command/measure.d.ts.map @@ -1 +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 +{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/measure.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH;IACE,sRA4GC;IA5FC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,cAAkB;IAClB;;OAEG;IACH,eAAoB;IACpB;;OAEG;IACH,uBAAoC;IACpC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,uBAAoC;IACpC;;OAEG;IACH,oBAAyD;IACzD;;OAEG;IACH,wBAAsC;IACtC;;OAEG;IACH,eAAoB;IACpB;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,+BAAoD;IACpD;;OAEG;IACH,uBAAoC;IACpC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,8BAA8B;IAC9B;;OAEG;IACH,6BAA6B;IAC7B;;OAEG;IACH,uBAA2B;IAC3B;;OAEG;IACH,mBAAoB;IACpB;;OAEG;IACH,gBAA6D;IAC7D;;OAEG;IACH,2BAAsE;IACtE;;OAEG;IACH,uBAA8D;IAC9D;;OAEG;IACH,2BAAqE;IAGvE;;;OAGG;IACH,oBAsBC;IArBC,aAAuE;IAuBzE;;;OAGG;IACH,mBAKC;IAED;;;OAGG;IACH,eAsBC;IAED;;;OAGG;IACH,iBAQC;IAED;;;;;;;;;;;;OAYG;IACH,kBAuBC;IAED;;;;;;;OAOG;IAEH;;;;;;;;;;;;OAYG;IACH,kBALW,MAAM,kBACN,MAAM,GAEJ,QAAQ,IAAI,CAAC,CAwFzB;IAED;;;;;;;;;OASG;IACH,qBAJW,MAAM,gBAkEhB;IAED;;;;;;;OAOG;IACH,UAJW,MAAM,oBAYhB;IAED;;;;;;;OAOG;IACH,6BAOC;IAED;;;OAGG;IACH,gBA+KC;CACF;sBAnpBqB,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 index 1a0dce177..329128501 100644 --- a/types/core/engine/command/meta.d.ts +++ b/types/core/engine/command/meta.d.ts @@ -1,7 +1,22 @@ +/** + * Add meta data to your user journey. + * + * @class + */ export class Meta { - setDescription(text: any): void; - description: any; - setTitle(text: any): void; - title: any; + /** + * Sets the description for the user journey. + * + * @param {string} text - The text to set as the description. + */ + setDescription(text: string): void; + description: string; + /** + * Sets the title for the user journey. + * + * @param {string} text - The text to set as the title. + */ + setTitle(text: string): void; + title: string; } //# 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 index f05a9505a..77a71feed 100644 --- a/types/core/engine/command/meta.d.ts.map +++ b/types/core/engine/command/meta.d.ts.map @@ -1 +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 +{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/meta.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;IAGE;;;;OAIG;IACH,qBAFW,MAAM,QAIhB;IADC,oBAAuB;IAGzB;;;;OAIG;IACH,eAFW,MAAM,QAIhB;IADC,cAAiB;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 index 2167cd792..91bcc9631 100644 --- a/types/core/engine/command/mouse/clickAndHold.d.ts +++ b/types/core/engine/command/mouse/clickAndHold.d.ts @@ -1,56 +1,81 @@ +/** + * Provides functionality to click and hold elements on a web page using different strategies. + * + * @class + */ 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. + * @private */ - byXpath(xpath: string): Promise; + private driver; /** - * 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. + * @private */ - bySelector(selector: string): Promise; + private actions; /** - * 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. + * Clicks and holds on an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to interact with. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the element is not found. */ - atCursor(): Promise; + byXpath(xpath: string): 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. + * Clicks and holds on an element that matches a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to interact with. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the element is not found. */ - atPosition(xPos: integer, yPos: integer): Promise; + bySelector(selector: string): 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. + * Clicks and holds at the current cursor position. + * + * @async + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ - releaseAtXpath(xpath: string): Promise; + atCursor(): 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. + * Clicks and holds at the specified screen coordinates. + * + * @async + * @param {number} xPos - The x-coordinate on the screen. + * @param {number} yPos - The y-coordinate on the screen. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ - releaseAtSelector(selector: string): Promise; + atPosition(xPos: number, yPos: number): 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. + * Releases the mouse button on an element matching the specified XPath. + * + * @async + * @param {string} xpath - The XPath selector of the element to release the mouse on. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. */ - releaseAtPosition(xPos: integer, yPos: integer): Promise; + releaseAtXpath(xpath: string): Promise; + /** + * Releases the mouse button on an element matching the specified CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to release the mouse on. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. + */ + releaseAtSelector(selector: string): Promise; + /** + * Releases the mouse button at the specified screen coordinates. + * + * @async + * @param {number} xPos - The x-coordinate on the screen. + * @param {number} yPos - The y-coordinate on the screen. + * @returns {Promise} A promise that resolves when the action is performed. + * @throws {Error} Throws an error if the action cannot be performed. + */ + releaseAtPosition(xPos: number, yPos: number): 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 index 91ed09d31..a709c1ded 100644 --- a/types/core/engine/command/mouse/clickAndHold.d.ts.map +++ b/types/core/engine/command/mouse/clickAndHold.d.ts.map @@ -1 +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 +{"version":3,"file":"clickAndHold.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/clickAndHold.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,0BASC;IARC;;OAEG;IACH,eAAiC;IACjC;;OAEG;IACH,gBAAmD;IAGrD;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;OAMG;IACH,YAHa,QAAQ,IAAI,CAAC,CAWzB;IAED;;;;;;;;OAQG;IACH,iBALW,MAAM,QACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;OAOG;IACH,sBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,4BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,wBALW,MAAM,QACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;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 index a2ec900c8..df2bcee78 100644 --- a/types/core/engine/command/mouse/contextClick.d.ts +++ b/types/core/engine/command/mouse/contextClick.d.ts @@ -1,26 +1,43 @@ +/** + * Provides functionality to perform a context click (right-click) on elements in a web page. + * + * @class + */ 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 + * @private */ - byXpath(xpath: string): Promise; + private driver; /** - * 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 + * @private */ - bySelector(selector: any): Promise; + private actions; /** - * 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. + * Performs a context click (right-click) on an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to context click. + * @returns {Promise} A promise that resolves when the context click action is performed. + * @throws {Error} Throws an error if the element is not found. */ - atCursor(): Promise; + byXpath(xpath: string): Promise; + /** + * Performs a context click (right-click) on an element that matches a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to context click. + * @returns {Promise} A promise that resolves when the context click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ + bySelector(selector: string): Promise; + /** + * Performs a context click (right-click) at the current cursor position. + * + * @async + * @returns {Promise} A promise that resolves when the context click action is performed. + * @throws {Error} Throws an error if the context click action 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 index 7a321b9a8..b00f2c6fa 100644 --- a/types/core/engine/command/mouse/contextClick.d.ts.map +++ b/types/core/engine/command/mouse/contextClick.d.ts.map @@ -1 +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 +{"version":3,"file":"contextClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/contextClick.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,0BASC;IARC;;OAEG;IACH,eAAiC;IACjC;;OAEG;IACH,gBAAmD;IAGrD;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;OAMG;IACH,YAHa,QAAQ,IAAI,CAAC,CAWzB;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 index ef13983ad..753a00e0c 100644 --- a/types/core/engine/command/mouse/doubleClick.d.ts +++ b/types/core/engine/command/mouse/doubleClick.d.ts @@ -1,27 +1,50 @@ +/** + * Provides functionality to perform a double-click action on elements in a web page. + * + * @class + */ 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. + * @private */ - byXpath(xpath: string, options: any): Promise; + private browser; /** - * 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. + * @private */ - bySelector(selector: string, options: any): Promise; + private actions; /** - * 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. + * @private */ - atCursor(options: any): Promise; + private pageCompleteCheck; + /** + * Performs a mouse double-click on an element matching a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to double-click. + * @param {Object} [options] - Additional options for the double-click action. + * @returns {Promise} A promise that resolves when the double-click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ + byXpath(xpath: string, options?: any): Promise; + /** + * Performs a mouse double-click on an element matching a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to double-click. + * @param {Object} [options] - Additional options for the double-click action. + * @returns {Promise} A promise that resolves when the double-click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ + bySelector(selector: string, options?: any): Promise; + /** + * Performs a mouse double-click at the current cursor position. + * + * @async + * @param {Object} [options] - Additional options for the double-click action. + * @returns {Promise} A promise that resolves when the double-click occurs. + * @throws {Error} Throws an error if the double-click action 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 index 98eb75236..a94c2cf0c 100644 --- a/types/core/engine/command/mouse/doubleClick.d.ts.map +++ b/types/core/engine/command/mouse/doubleClick.d.ts.map @@ -1 +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 +{"version":3,"file":"doubleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/doubleClick.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IACE,kDAaC;IAZC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAgE;IAChE;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,eALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAmBzB;IAED;;;;;;;OAOG;IACH,yBAHa,QAAQ,IAAI,CAAC,CAczB;CACF"} \ 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 index 571249a1b..d93aa4b6f 100644 --- a/types/core/engine/command/mouse/mouseMove.d.ts +++ b/types/core/engine/command/mouse/mouseMove.d.ts @@ -1,34 +1,55 @@ +/** + * Provides functionality to move the mouse cursor to elements or specific positions on a web page. + * + * @class + */ 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 + * @private */ - byXpath(xpath: string): Promise; + private driver; /** - * 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 + * @private */ - bySelector(selector: string): Promise; + private actions; /** - * 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 + * Moves the mouse cursor to an element that matches a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to move to. + * @returns {Promise} A promise that resolves when the mouse has moved to the element. + * @throws {Error} Throws an error if the element is not found. */ - toPosition(xPos: number, yPos: any): Promise; + byXpath(xpath: string): 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 + * Moves the mouse cursor to an element that matches a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to move to. + * @returns {Promise} A promise that resolves when the mouse has moved to the element. + * @throws {Error} Throws an error if the element is not found. */ - byOffset(xOffset: number, yOffset: any): Promise; + bySelector(selector: string): Promise; + /** + * Moves the mouse cursor to a specific position on the screen. + * + * @async + * @param {number} xPos - The x-coordinate on the screen to move to. + * @param {number} yPos - The y-coordinate on the screen to move to. + * @returns {Promise} A promise that resolves when the mouse has moved to the specified position. + * @throws {Error} Throws an error if the action cannot be performed. + */ + toPosition(xPos: number, yPos: number): Promise; + /** + * Moves the mouse cursor by an offset from its current position. + * + * @async + * @param {number} xOffset - The x offset to move by. + * @param {number} yOffset - The y offset to move by. + * @returns {Promise} A promise that resolves when the mouse has moved by the specified offset. + * @throws {Error} Throws an error if the action cannot be performed. + */ + byOffset(xOffset: number, yOffset: number): 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 index 19e787c44..5c8b07e6a 100644 --- a/types/core/engine/command/mouse/mouseMove.d.ts.map +++ b/types/core/engine/command/mouse/mouseMove.d.ts.map @@ -1 +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 +{"version":3,"file":"mouseMove.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/mouseMove.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IACE,0BASC;IARC;;OAEG;IACH,eAAiC;IACjC;;OAEG;IACH,gBAAmD;IAGrD;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,iBALW,MAAM,QACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAWzB;IAED;;;;;;;;OAQG;IACH,kBALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;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 index 4a753fa78..4deb6ab42 100644 --- a/types/core/engine/command/mouse/singleClick.d.ts +++ b/types/core/engine/command/mouse/singleClick.d.ts @@ -1,28 +1,50 @@ +/** + * Provides functionality to perform a single click action on elements or at specific positions in a web page. + * + * @class + */ 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. + * @private */ - byXpath(xpath: string, options: any): Promise; + private browser; /** - * 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. + * @private */ - bySelector(selector: string, options: any): Promise; + private actions; /** - * 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. + * @private */ - atCursor(options: any): Promise; + private pageCompleteCheck; + /** + * Performs a single mouse click on an element matching a given XPath selector. + * + * @async + * @param {string} xpath - The XPath selector of the element to click. + * @param {Object} [options] - Additional options for the click action. + * @returns {Promise} A promise that resolves when the single click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ + byXpath(xpath: string, options?: any): Promise; + /** + * Performs a single mouse click on an element matching a given CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the element to click. + * @param {Object} [options] - Additional options for the click action. + * @returns {Promise} A promise that resolves when the single click action is performed. + * @throws {Error} Throws an error if the element is not found. + */ + bySelector(selector: string, options?: any): Promise; + /** + * Performs a single mouse click at the current cursor position. + * + * @async + * @param {Object} [options] - Additional options for the click action. + * @returns {Promise} A promise that resolves when the single click occurs. + * @throws {Error} Throws an error if the single click action 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 index 3375462d6..d5b121b81 100644 --- a/types/core/engine/command/mouse/singleClick.d.ts.map +++ b/types/core/engine/command/mouse/singleClick.d.ts.map @@ -1 +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 +{"version":3,"file":"singleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/singleClick.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,kDAaC;IAZC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAgE;IAChE;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,eALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAmBzB;IAED;;;;;;;OAOG;IACH,yBAHa,QAAQ,IAAI,CAAC,CAczB;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 index b48b7894c..b77bcc6c2 100644 --- a/types/core/engine/command/navigation.d.ts +++ b/types/core/engine/command/navigation.d.ts @@ -1,18 +1,44 @@ +/** + * Provides functionality to control browser navigation such as back, forward, and refresh actions. + * + * @class + */ export class Navigation { constructor(browser: any, pageCompleteCheck: any); - browser: any; - pageCompleteCheck: any; /** - * Navigate backward in history + * @private */ - back(options: any): Promise; + private browser; /** - * Navigate forward in history + * @private */ - forward(options: any): Promise; + private pageCompleteCheck; /** - * Refresh page + * Navigates backward in the browser's history. + * + * @async + * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run. + * @returns {Promise} A promise that resolves when the navigation action is completed. + * @throws {Error} Throws an error if navigation fails. */ - refresh(options: any): Promise; + back(options?: any): Promise; + /** + * Navigates forward in the browser's history. + * + * @async + * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run. + * @returns {Promise} A promise that resolves when the navigation action is completed. + * @throws {Error} Throws an error if navigation fails. + */ + forward(options?: any): Promise; + /** + * Refreshes the current page. + * + * @async + * @param {Object} [options] - Additional options for refresh action. Set {wait:true} to wait for the page complete check to run. + * @returns {Promise} A promise that resolves when the page has been refreshed. + * @throws {Error} Throws an error if refreshing the page fails. + */ + 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 index ebc3c884d..5d2655422 100644 --- a/types/core/engine/command/navigation.d.ts.map +++ b/types/core/engine/command/navigation.d.ts.map @@ -1 +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 +{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/navigation.js"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;OAOG;IACH,qBAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;OAOG;IACH,wBAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;OAOG;IACH,wBAHa,QAAQ,IAAI,CAAC,CAezB;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 index 0577a8dfc..23a0ba352 100644 --- a/types/core/engine/command/screenshot.d.ts +++ b/types/core/engine/command/screenshot.d.ts @@ -1,8 +1,31 @@ +/** + * Take a screenshot. The screenshot will be stored to disk, + * named by the name provided to the take function. + * + * @class + */ export class Screenshot { constructor(screenshotManager: any, browser: any, index: any); - screenshotManager: any; - browser: any; - index: any; - take(name: any): Promise; + /** + * @private + */ + private screenshotManager; + /** + * @private + */ + private browser; + /** + * @private + */ + private index; + /** + * Takes a screenshot and saves it using the screenshot manager. + * + * @async + * @param {string} name The name to assign to the screenshot file. + * @throws {Error} Throws an error if the name parameter is not provided. + * @returns {Promise} A promise that resolves with the screenshot details. + */ + take(name: string): 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 index bbb9cbb20..873c36696 100644 --- a/types/core/engine/command/screenshot.d.ts.map +++ b/types/core/engine/command/screenshot.d.ts.map @@ -1 +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 +{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/screenshot.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IACE,8DAaC;IAZC;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,cAAkB;IAGpB;;;;;;;OAOG;IAEH,WALW,MAAM,GAEJ,YAAe,CAa3B;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 index c21fbc81a..150fe6074 100644 --- a/types/core/engine/command/scroll.d.ts +++ b/types/core/engine/command/scroll.d.ts @@ -1,31 +1,51 @@ +/** + * Provides functionality to control page scrolling in the browser. + * + * @class + */ 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 + * @private */ - byPixels(Xpixels: any, Ypixels: any): Promise; + private browser; /** - * 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. + * @private */ - byLines(lines: any): Promise; + private options; /** - * Scroll the page by the specified pages. - * @param {number} Pages - * @returns {Promise} Promise object represents when scrolling the page has been finished. + * Scrolls the page by the specified number of pixels. + * + * @async + * @param {number} Xpixels - The number of pixels to scroll horizontally. + * @param {number} Ypixels - The number of pixels to scroll vertically. + * @returns {Promise} A promise that resolves when the scrolling action is completed. */ - byPages(pages: any): Promise; + byPixels(Xpixels: number, Ypixels: number): 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. + * Scrolls the page by the specified number of lines. This method is only supported in Firefox. + * + * @async + * @param {number} lines - The number of lines to scroll. + * @returns {Promise} A promise that resolves when the scrolling action is completed. + * @throws {Error} Throws an error if not used in Firefox. */ - toBottom(delayTime?: number): Promise; + byLines(lines: number): Promise; + /** + * Scrolls the page by the specified number of pages. + * + * @async + * @param {number} pages - The number of pages to scroll. + * @returns {Promise} A promise that resolves when the scrolling action is completed. + */ + byPages(pages: number): Promise; + /** + * Scrolls to the bottom of the page, scrolling page by page with a delay between each scroll. + * + * @async + * @param {number} [delayTime=250] - The delay time in milliseconds between each scroll. + * @returns {Promise} A promise that resolves when the scrolling to the bottom is completed. + */ + 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 index d1e785bc1..d06485832 100644 --- a/types/core/engine/command/scroll.d.ts.map +++ b/types/core/engine/command/scroll.d.ts.map @@ -1 +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 +{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/scroll.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;OAOG;IACH,kBAJW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAKzB;IAED;;;;;;;OAOG;IACH,eAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;OAMG;IACH,eAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;OAMG;IACH,qBAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/select.d.ts b/types/core/engine/command/select.d.ts index 72a4bcbe7..2475cd4c1 100644 --- a/types/core/engine/command/select.d.ts +++ b/types/core/engine/command/select.d.ts @@ -1,62 +1,80 @@ +/** + * Provides functionality to interact with `` element by its ID and the value of the option. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ - selectByNameAndValue(selectName: string, value: string): Promise; + selectByIdAndValue(selectId: 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 + * Selects an option in a `` element. + * @param {string} value - The value of the option to select. + * @returns {Promise} A promise that resolves when the option is selected. + * @throws {Error} Throws an error if the `` element by its ID and the index of the option. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ - selectByNameAndIndex(selectName: string, index: number): Promise; + selectByIdAndIndex(selectId: 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 + * Selects an option in a `` element. + * @param {number} index - The index of the option to select. + * @returns {Promise} A promise that resolves when the option is selected. + * @throws {Error} Throws an error if the `` element by its ID. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. */ - getValuesById(selectId: string): Promise; + deselectById(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. + * Retrieves all option values in a `` element. + * @returns {Promise} A promise that resolves with an array of the values of the options. + * @throws {Error} Throws an error if the `` element by its ID. + * + * @async + * @param {string} selectId - The ID of the `` element is not found. + */ + getSelectedValueById(selectId: string): 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 index ae44ce482..89f5cf767 100644 --- a/types/core/engine/command/select.d.ts.map +++ b/types/core/engine/command/select.d.ts.map @@ -1 +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 +{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/select.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,6BALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,iCALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,6BALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;;OAQG;IACH,iCALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;OAOG;IACH,uBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,MAAM,EAAE,CAAC,CAoB7B;IAED;;;;;;;OAOG;IACH,+BAJW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAa3B;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/set.d.ts b/types/core/engine/command/set.d.ts index 7b60724a3..780cfeaf7 100644 --- a/types/core/engine/command/set.d.ts +++ b/types/core/engine/command/set.d.ts @@ -1,59 +1,73 @@ +/** + * Provides functionality to set properties like innerHTML, innerText, and value on elements in a web page. + * + * @class + */ 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 + * @private */ - innerHtml(html: string, selector: string): Promise; + private browser; /** - * 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 + * Sets the innerHTML of an element using a CSS selector. + * + * @async + * @param {string} html - The HTML string to set as innerHTML. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the innerHTML is set. + * @throws {Error} Throws an error if the element is not found. */ - innerHtmlById(html: string, id: string): Promise; + innerHtml(html: string, selector: 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 + * Sets the innerHTML of an element using its ID. + * + * @async + * @param {string} html - The HTML string to set as innerHTML. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the innerHTML is set. + * @throws {Error} Throws an error if the element is not found. */ - innerText(text: any, selector: string): Promise; + innerHtmlById(html: string, id: 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 + * Sets the innerText of an element using a CSS selector. + * + * @async + * @param {string} text - The text to set as innerText. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the innerText is set. + * @throws {Error} Throws an error if the element is not found. */ - innerTextById(text: any, id: string): Promise; + innerText(text: string, selector: 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 + * Sets the innerText of an element using its ID. + * + * @async + * @param {string} text - The text to set as innerText. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the innerText is set. + * @throws {Error} Throws an error if the element is not found. */ - value(value: string, selector: string): Promise; + innerTextById(text: string, id: 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 + * Sets the value of an element using a CSS selector. + * + * @async + * @param {string} value - The value to set on the element. + * @param {string} selector - The CSS selector of the element. + * @returns {Promise} A promise that resolves when the value is set. + * @throws {Error} Throws an error if the element is not found. */ - valueById(value: string, id: any): Promise; + value(value: string, selector: string): Promise; + /** + * Sets the value of an element using its ID. + * + * @async + * @param {string} value - The value to set on the element. + * @param {string} id - The ID of the element. + * @returns {Promise} A promise that resolves when the value is set. + * @throws {Error} Throws an error if the element is not found. + */ + valueById(value: string, id: string): 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 index 0b0b8bd89..468069c72 100644 --- a/types/core/engine/command/set.d.ts.map +++ b/types/core/engine/command/set.d.ts.map @@ -1 +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 +{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/set.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,gBALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,gBALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,aALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,iBALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/stopWatch.d.ts b/types/core/engine/command/stopWatch.d.ts index 12061eb69..46270171b 100644 --- a/types/core/engine/command/stopWatch.d.ts +++ b/types/core/engine/command/stopWatch.d.ts @@ -1,32 +1,48 @@ +/** + * A stopwatch utility for measuring time intervals. + * + * @class + */ export class StopWatch { constructor(name: any, measure: any); - name: any; - measure: any; /** - * Start the the stop watch + * @private + */ + private name; + /** + * @private + */ + private measure; + /** + * Starts the stopwatch. */ 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 + * Stops the stopwatch and automatically adds the measured time to the + * last measured page. Logs an error if no page has been measured. + * @returns {number} The measured time in milliseconds. */ stopAndAdd(): number; /** - * Stop the watch - * @returns the measured time + * Stops the stopwatch. + * @returns {number} The measured time in milliseconds. */ stop(): number; /** - * Get the name of the watch. - * @returns The name of the watch + * Gets the name of the stopwatch. + * @returns {string} The name of the stopwatch. */ - getName(): any; + getName(): string; } +/** + * @private + */ export class Watch { constructor(measure: any); measure: any; - get(name: any): StopWatch; + /** + * @private + */ + private get; } //# 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 index b74edd6be..bde8c32bb 100644 --- a/types/core/engine/command/stopWatch.d.ts.map +++ b/types/core/engine/command/stopWatch.d.ts.map @@ -1 +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 +{"version":3,"file":"stopWatch.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/stopWatch.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,qCAaC;IAZC;;OAEG;IACH,aAAgB;IAChB;;OAEG;IACH,gBAAsB;IAOxB;;OAEG;IACH,cAEC;IAED;;;;OAIG;IACH,cAFa,MAAM,CAOlB;IAED;;;OAGG;IACH,QAFa,MAAM,CAMlB;IAED;;;OAGG;IACH,WAFa,MAAM,CAIlB;CACF;AAED;;GAEG;AACH;IACE,0BAEC;IADC,aAAsB;IAGxB;;OAEG;IACH,YAEC;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/switch.d.ts b/types/core/engine/command/switch.d.ts index 7491b964d..e10ed963d 100644 --- a/types/core/engine/command/switch.d.ts +++ b/types/core/engine/command/switch.d.ts @@ -1,39 +1,76 @@ +/** + * Provides functionality to switch between frames, windows, and tabs in the browser. + * + * @class + */ export class Switch { constructor(browser: any, pageCompleteCheck: any, navigate: any); - browser: any; - pageCompleteCheck: any; - navigate: any; /** - * Switch to frame by id - * @param {*} id + * @private */ - toFrame(id: any): Promise; + private browser; /** - * Switch to frame by xpath - * @param {*} xpath + * @private */ - toFrameByXpath(xpath: any): Promise; + private pageCompleteCheck; /** - * Switch to frame by xpath - * @param {*} xpath + * @private */ - toFrameBySelector(selector: any): Promise; + private navigate; /** - * Switch to a window by name - * @param {*} name + * Switches to a frame identified by its ID. + * + * @async + * @param {string|number} id - The ID of the frame. + * @throws {Error} Throws an error if switching to the frame fails. */ - toWindow(name: any): Promise; + toFrame(id: string | number): Promise; /** - * Switch to parent frame + * Switches to a frame identified by an XPath. + * + * @async + * @param {string} xpath - The XPath of the frame element. + * @throws {Error} Throws an error if the frame is not found or switching fails. + */ + toFrameByXpath(xpath: string): Promise; + /** + * Switches to a frame identified by a CSS selector. + * + * @async + * @param {string} selector - The CSS selector of the frame element. + * @throws {Error} Throws an error if the frame is not found or switching fails. + */ + toFrameBySelector(selector: string): Promise; + /** + * Switches to a window identified by its name. + * + * @async + * @param {string} name - The name of the window. + * @throws {Error} Throws an error if switching to the window fails. + */ + toWindow(name: string): Promise; + /** + * Switches to the parent frame of the current frame. + * + * @async + * @throws {Error} Throws an error if switching to the parent frame fails. */ toParentFrame(): Promise; /** - * Create a new tab and switch to it. Optionally, navigate to a given url. + * Opens a new tab and optionally navigates to a URL. + * + * @async + * @param {string} [url] - Optional URL to navigate to in the new tab. + * @throws {Error} Throws an error if opening a new tab fails. */ - toNewTab(url: any): Promise; + toNewTab(url?: string): Promise; /** - * Create a new window and switch to it. Optionally, navigate to a given url. + * Opens a new window and optionally navigates to a URL. + * + * @async + * @param {string} [url] - Optional URL to navigate to in the new window. + * @throws {Error} Throws an error if opening a new window fails. */ - toNewWindow(url: any): Promise; + toNewWindow(url?: string): 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 index e5df361bd..bb8461df5 100644 --- a/types/core/engine/command/switch.d.ts.map +++ b/types/core/engine/command/switch.d.ts.map @@ -1 +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 +{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/switch.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,iEAaC;IAZC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,iBAAwB;IAG1B;;;;;;OAMG;IACH,YAHW,MAAM,GAAC,MAAM,iBAYvB;IAED;;;;;;OAMG;IACH,sBAHW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,4BAHW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,eAHW,MAAM,iBAYhB;IAED;;;;;OAKG;IACH,+BASC;IAED;;;;;;OAMG;IACH,eAHW,MAAM,iBAiBhB;IAED;;;;;;OAMG;IACH,kBAHW,MAAM,iBAiBhB;CACF"} \ No newline at end of file diff --git a/types/core/engine/command/wait.d.ts b/types/core/engine/command/wait.d.ts index 688dceb66..2bf810ae1 100644 --- a/types/core/engine/command/wait.d.ts +++ b/types/core/engine/command/wait.d.ts @@ -1,49 +1,72 @@ +/** + * Provides functionality to wait for different conditions in the browser. + * + * @class + */ 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 + * @private */ - byId(id: string, maxTime: number): Promise; + private browser; /** - * 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 + * @private */ - byXpath(xpath: string, maxTime: number): Promise; + private pageCompleteCheck; /** - * 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 + * Waits for an element with a specific ID to appear within a maximum time. + * + * @async + * @param {string} id - The ID of the element to wait for. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the element is found or the time times out. + * @throws {Error} Throws an error if the element is not found within the specified time. */ - bySelector(selector: string, maxTime: number): Promise; + byId(id: 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. + * Waits for an element located by XPath to appear within a maximum time. + * + * @async + * @param {string} xpath - The XPath of the element to wait for. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the element is found or the time times out. + * @throws {Error} Throws an error if the element is not found within the specified time. */ - byTime(ms: number): Promise; + byXpath(xpath: string, maxTime: number): Promise; /** - * Wait for the page to finish loading. - * @returns {Promise} Promise object represents when the pageCompleteCheck has finished. + * Waits for an element located by a CSS selector to appear within a maximum time. + * + * @async + * @param {string} selector - The CSS selector of the element to wait for. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the element is found or the time times out. + * @throws {Error} Throws an error if the element is not found within the specified time. */ - byPageToComplete(): Promise; + bySelector(selector: string, maxTime: number): 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 + * Waits for a specified amount of time. + * + * @async + * @param {number} ms - The time in milliseconds to wait. + * @returns {Promise} A promise that resolves when the specified time has elapsed. */ - byCondition(jsExpression: string, maxTime: number): Promise; + byTime(ms: number): Promise; + /** + * Waits for the page to finish loading. + * + * @async + * @returns {Promise} A promise that resolves when the page complete check has finished. + */ + byPageToComplete(): Promise; + /** + * Waits for a JavaScript condition to return a truthy value within a maximum time. + * + * @async + * @param {string} jsExpression - The JavaScript expression to evaluate. + * @param {number} maxTime - Maximum time to wait in milliseconds. + * @returns {Promise} A promise that resolves when the condition becomes truthy or the time times out. + * @throws {Error} Throws an error if the condition is not met within the specified time. + */ + 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 index 1eee342da..f8003c45e 100644 --- a/types/core/engine/command/wait.d.ts.map +++ b/types/core/engine/command/wait.d.ts.map @@ -1 +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 +{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,SALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,eALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAuBzB;IAED;;;;;;OAMG;IACH,WAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;OAKG;IACH,oBAFa,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;CACF"} \ No newline at end of file diff --git a/types/core/engine/commands.d.ts b/types/core/engine/commands.d.ts index 491c5905e..a303d4cad 100644 --- a/types/core/engine/commands.d.ts +++ b/types/core/engine/commands.d.ts @@ -5,39 +5,126 @@ 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; + /** + * Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome. + * @type {ChromeTrace} + */ trace: ChromeTrace; - android: AndroidCommand; - debug: Debug; + /** + * Provides functionality to perform click actions on elements in a web page using various selectors. + * @type {Click} + */ click: Click; + /** + * Provides functionality to control page scrolling in the browser. + * @type {Scroll} + */ scroll: Scroll; + /** + * Provides functionality to add text to elements on a web page using various selectors. + * @type {AddText} + */ addText: AddText; + /** + * Provides functionality to wait for different conditions in the browser. + * @type {Wait} + */ wait: Wait; + /** + * Provides functionality for measuring a navigation. + * @type {Measure} + */ measure: Measure; - navigate: any; + /** + * Navigates to a specified URL and handles additional setup for a page visit. + * @type {Function} + * @async + * @param {string} url - The URL to navigate to. + * @throws {Error} Throws an error if navigation or setup fails. + * @returns {Promise} A promise that resolves when the navigation and setup are + */ + navigate: Function; + /** + * Provides functionality to control browser navigation such as back, forward, and refresh actions. + * @type {Navigation} + */ navigation: Navigation; - error: any; - markAsFailure: any; + /** + * Add a text that will be an error attached to the current page. + * @param {string} message - The error message. + * @type {Function} + */ + error: Function; + /** + * Mark this run as an failure. Add a message that explains the failure. + * @param {string} message - The message attached as a failure. + * @type {Function} + */ + markAsFailure: Function; + /** + * Executes JavaScript in the browser context. + * @type {JavaScript} + */ js: JavaScript; + /** + * Switches context to different frames, windows, or tabs in the browser. + * @type {Switch} + */ switch: Switch; + /** + * Sets values on HTML elements in the page. + * @type {Set} + */ set: Set; + /** + * Stopwatch utility for measuring time intervals. + * @type {StopWatch} + */ stopWatch: StopWatch; + /** + * Manages the browser's cache. + * @type {Cache} + */ cache: Cache; + /** + * Adds metadata to the user journey. + * @type {Meta} + */ meta: Meta; + /** + * Takes and manages screenshots. + * @type {Screenshot} + */ screenshot: Screenshot; + /** + * Use the Chrome DevTools Protocol, available in Chrome and Edge. + * @type {ChromeDevelopmentToolsProtocol} + */ cdp: ChromeDevelopmentToolsProtocol; - mouse: { - moveTo: MouseMove; - contextClick: ContextClick; - singleClick: SingleClick; - doubleClick: DoubleClick; - clickAndHold: ClickAndHold; - }; + /** + * Provides commands for interacting with an Android device. + * @type {AndroidCommand} + */ + android: AndroidCommand; + /** + * Provides debugging capabilities within a browser automation script. + * It allows setting breakpoints to pause script execution and inspect the current state. + * @type {Debug} + */ + debug: Debug; + /** + * Interact with the page using the mouse. + * @type {Object} + */ + mouse: any; + /** + * Interact with a select element. + * @type {Select} + */ 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'; @@ -52,10 +139,7 @@ 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 { AndroidCommand } from './command/android.js'; +import { Debug } from './command/debug.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 index 057ff015c..b016fac7e 100644 --- a/types/core/engine/commands.d.ts.map +++ b/types/core/engine/commands.d.ts.map @@ -1 +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 +{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/commands.js"],"names":[],"mappings":"AA2BA;;;GAGG;AACH;IACE,sRAuNC;IApLC,+BAMC;IAMD;;;OAGG;IACH,OAFU,WAAW,CAE+C;IAEpE;;;OAGG;IACH,OAFU,KAAK,CAEmC;IAElD;;;OAGG;IACH,QAFU,MAAM,CAE0B;IAE1C;;;OAGG;IACH,SAFU,OAAO,CAEkB;IAEnC;;;OAGG;IACH,MAFU,IAAI,CAEkC;IAEhD;;;OAGG;IACH,SAFU,OAAO,CAEK;IAEtB;;;;;;;OAOG;IACH,mBAA+C;IAE/C;;;OAGG;IACH,YAFU,UAAU,CAEwC;IAE5D;;;;OAIG;IACH,gBAAyC;IAEzC;;;;OAIG;IACH,wBAAmD;IAEnD;;;OAGG;IACH,IAFU,UAAU,CAEgC;IAEpD;;;OAGG;IACH,QAFU,MAAM,CAMf;IAED;;;OAGG;IACH,KAFU,GAAG,CAEc;IAE3B;;;OAGG;IACH,WAFU,SAAS,CAEoB;IAEvC;;;OAGG;IACH,OAFU,KAAK,CAEuD;IAEtE;;;OAGG;IACH,MAFU,IAAI,CAEQ;IAEtB;;;OAGG;IACH,YAFU,UAAU,CAE+C;IAEnE;;;OAGG;IACH,KAFU,8BAA8B,CAE1B;IAEd;;;OAGG;IACH,SAFU,cAAc,CAEkB;IAE1C;;;;OAIG;IACH,OAFW,KAAK,CAEwB;IAExC;;;OAGG;IACH,WA0BC;IAED;;;OAGG;IACH,QAFU,MAAM,CAEiB;CAEpC;sDA9NqD,4BAA4B;4BAXtD,0BAA0B;sBAdhC,oBAAoB;uBAsBnB,qBAAqB;wBAvBpB,sBAAsB;qBAEzB,mBAAmB;wBAChB,sBAAsB;2BAqBnB,yBAAyB;2BApBzB,yBAAyB;uBAC7B,qBAAqB;oBAExB,kBAAkB;mCAGH,wBAAwB;sBAFrC,oBAAoB;qBACrB,mBAAmB;2BAHb,yBAAyB;+CAQL,qCAAqC;+BADrD,sBAAsB;sBAD/B,oBAAoB;uBADnB,qBAAqB"} \ No newline at end of file diff --git a/types/core/engine/context.d.ts b/types/core/engine/context.d.ts index 77c8be512..412b04215 100644 --- a/types/core/engine/context.d.ts +++ b/types/core/engine/context.d.ts @@ -1,38 +1,44 @@ +/** + * @typedef {Object} Logger + * @property {function(string): void} trace - Function to log trace messages. + * @property {function(string): void} verbose - Function to log verbose messages. + * @property {function(string): void} info - Function to log info messages. + * @property {function(string): void} warn - Function to log warning messages. + * @property {function(string): void} error - Function to log error messages. + * @property {function(string): void} critical - Function to log critical messages. + */ +/** + * @typedef {typeof import('selenium-webdriver')} WebDriverClass + * @typedef {import('selenium-webdriver').WebDriver} WebDriverInstance + */ /** * Class representing the context of a Browsertime run. * * @class */ export class Context { + constructor(options: any, result: any, log: any, storageManager: any, index: any, webdriver: any, instantiatedDriver: any); /** - * 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); - /** + * This is the yargs object you get from the cli. If you add --my.id you can get that using options.my.id. * @type {Object} */ options: any; /** + * Here the result from each run is stored. * @type {Object} */ result: any; /** - * @type {intel.Logger} + * @type {Logger} */ - log: intel.Logger; + log: Logger; /** + * The index of the iteration. * @type {number} */ index: number; /** + * Storage manager to save things to disk. * @type {import('../../support/storageManager.js').StorageManager} */ storageManager: import('../../support/storageManager.js').StorageManager; @@ -41,11 +47,40 @@ export class Context { */ taskData: any; /** - * @type {{webdriver: import('selenium-webdriver').WebDriver, driver: import('selenium-webdriver').WebDriver}} + * Get raw Selenium functionality. + * @type {{webdriver: WebDriverClass, driver: WebDriverInstance}} */ selenium: { - webdriver: import('selenium-webdriver').WebDriver; - driver: import('selenium-webdriver').WebDriver; + webdriver: typeof import("selenium-webdriver"); + driver: import("selenium-webdriver").WebDriver; }; } +export type Logger = { + /** + * - Function to log trace messages. + */ + trace: (arg0: string) => void; + /** + * - Function to log verbose messages. + */ + verbose: (arg0: string) => void; + /** + * - Function to log info messages. + */ + info: (arg0: string) => void; + /** + * - Function to log warning messages. + */ + warn: (arg0: string) => void; + /** + * - Function to log error messages. + */ + error: (arg0: string) => void; + /** + * - Function to log critical messages. + */ + critical: (arg0: string) => void; +}; +export type WebDriverClass = typeof import('selenium-webdriver'); +export type WebDriverInstance = 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 index 227e09827..4c827d216 100644 --- a/types/core/engine/context.d.ts.map +++ b/types/core/engine/context.d.ts.map @@ -1 +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 +{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/context.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACE,2HAyDC;IAhDC;;;OAGG;IACH,aAAsB;IAEtB;;;OAGG;IACH,YAAoB;IAEpB;;OAEG;IACH,KAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,OAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,gBAFU,OAAO,iCAAiC,EAAE,cAAc,CAE9B;IAEpC;;OAEG;IACH,cAAkB;IAElB;;;OAGG;IACH;;;MASC;CAEJ;;;;;kBA7EsB,MAAM,KAAG,IAAI;;;;oBACb,MAAM,KAAG,IAAI;;;;iBACb,MAAM,KAAG,IAAI;;;;iBACb,MAAM,KAAG,IAAI;;;;kBACb,MAAM,KAAG,IAAI;;;;qBACb,MAAM,KAAG,IAAI;;6BAIvB,cAAc,oBAAoB,CAAC;gCACnC,OAAO,oBAAoB,EAAE,SAAS"} \ No newline at end of file