From 5493a1780bbce832a6d13b23790c215464549a1c Mon Sep 17 00:00:00 2001 From: soulgalore Date: Sun, 7 Jan 2024 19:34:05 +0100 Subject: [PATCH] fix broken link --- docs/documentation/sitespeed.io/scripting/Actions.html | 2 +- docs/documentation/sitespeed.io/scripting/AddText.html | 2 +- docs/documentation/sitespeed.io/scripting/AndroidCommand.html | 2 +- docs/documentation/sitespeed.io/scripting/Cache.html | 2 +- .../sitespeed.io/scripting/ChromeDevelopmentToolsProtocol.html | 2 +- docs/documentation/sitespeed.io/scripting/ChromeTrace.html | 2 +- docs/documentation/sitespeed.io/scripting/Click.html | 2 +- docs/documentation/sitespeed.io/scripting/ClickAndHold.html | 2 +- docs/documentation/sitespeed.io/scripting/Commands.html | 2 +- docs/documentation/sitespeed.io/scripting/ContextClick.html | 2 +- docs/documentation/sitespeed.io/scripting/Debug.html | 2 +- docs/documentation/sitespeed.io/scripting/DoubleClick.html | 2 +- docs/documentation/sitespeed.io/scripting/Element.html | 2 +- docs/documentation/sitespeed.io/scripting/GeckoProfiler.html | 2 +- docs/documentation/sitespeed.io/scripting/JavaScript.html | 2 +- docs/documentation/sitespeed.io/scripting/Measure.html | 2 +- docs/documentation/sitespeed.io/scripting/Meta.html | 2 +- docs/documentation/sitespeed.io/scripting/MouseMove.html | 2 +- docs/documentation/sitespeed.io/scripting/Navigation.html | 2 +- docs/documentation/sitespeed.io/scripting/Screenshot.html | 2 +- docs/documentation/sitespeed.io/scripting/Scroll.html | 2 +- docs/documentation/sitespeed.io/scripting/Select.html | 2 +- docs/documentation/sitespeed.io/scripting/Set.html | 2 +- docs/documentation/sitespeed.io/scripting/SingleClick.html | 2 +- docs/documentation/sitespeed.io/scripting/StopWatch.html | 2 +- docs/documentation/sitespeed.io/scripting/Switch.html | 2 +- docs/documentation/sitespeed.io/scripting/Wait.html | 2 +- docs/documentation/sitespeed.io/scripting/index.html | 2 +- .../sitespeed.io/scripting/tutorial-01-Introduction.html | 2 +- .../sitespeed.io/scripting/tutorial-02-Running-Scripts.html | 2 +- .../scripting/tutorial-03-Measurement-Commands.html | 2 +- .../scripting/tutorial-04-Interact-with-the-page.html | 2 +- .../sitespeed.io/scripting/tutorial-05-Interact-Browser.html | 2 +- .../sitespeed.io/scripting/tutorial-06-Error-handling.html | 2 +- .../sitespeed.io/scripting/tutorial-07-Debugging-Scripts.html | 2 +- .../scripting/tutorial-08-Setting-Up-IntelliSense.html | 2 +- .../sitespeed.io/scripting/tutorial-09-Examples.html | 2 +- .../sitespeed.io/scripting/tutorial-10-Selenium.html | 2 +- .../scripting/tutorial-11-Chrome-Devtools-Protocol.html | 2 +- .../sitespeed.io/scripting/tutorial-12-Android.html | 2 +- .../sitespeed.io/scripting/tutorial-13-Tips-and-tricks.html | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/docs/documentation/sitespeed.io/scripting/Actions.html b/docs/documentation/sitespeed.io/scripting/Actions.html index 63fba2472..c03efa698 100644 --- a/docs/documentation/sitespeed.io/scripting/Actions.html +++ b/docs/documentation/sitespeed.io/scripting/Actions.html @@ -1,6 +1,6 @@ Class: Actions
On this page

Actions

This class provides an abstraction layer for Selenium's action sequence functionality. It allows for easy interaction with web elements using different locating strategies and simulating complex user gestures like mouse movements, key presses, etc.

Classes

Actions

Methods

getActions() → {SeleniumActions}

Retrieves the current action sequence builder. The actions builder can be used to chain multiple browser actions.
Returns:
The current Selenium Actions builder object for chaining browser actions.
Type: 
SeleniumActions
Example
// Example of using the actions builder to perform a drag-and-drop operation:
+    
On this page

Actions

This class provides an abstraction layer for Selenium's action sequence functionality. It allows for easy interaction with web elements using different locating strategies and simulating complex user gestures like mouse movements, key presses, etc.

Classes

Actions

Methods

getActions() → {SeleniumActions}

Retrieves the current action sequence builder. The actions builder can be used to chain multiple browser actions.
Returns:
The current Selenium Actions builder object for chaining browser actions.
Type: 
SeleniumActions
Example
// Example of using the actions builder to perform a drag-and-drop operation:
 const elementToDrag = await commands.action.getElementByCss('.draggable');
 const dropTarget = await commands.action.getElementByCss('.drop-target');
 await commands.action.getAction()
diff --git a/docs/documentation/sitespeed.io/scripting/AddText.html b/docs/documentation/sitespeed.io/scripting/AddText.html
index 95ca1d3b6..6900822e0 100644
--- a/docs/documentation/sitespeed.io/scripting/AddText.html
+++ b/docs/documentation/sitespeed.io/scripting/AddText.html
@@ -1,3 +1,3 @@
 Class: AddText
On this page

AddText

Provides functionality to add text to elements on a web page using various selectors.

Classes

AddText

Methods

(async) byClassName(text, className) → {Promise.<void>}

Adds text to an element identified by its class name.
Parameters:
NameTypeDescription
textstringThe text string to add.
classNamestringThe class name of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byClassName('mytext', 'className');

(async) byId(text, id) → {Promise.<void>}

Adds text to an element identified by its ID.
Parameters:
NameTypeDescription
textstringThe text string to add.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byId('mytext', 'id');

(async) byName(text, name) → {Promise.<void>}

Adds text to an element identified by its name attribute.
Parameters:
NameTypeDescription
textstringThe text string to add.
namestringThe name attribute of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byName('mytext', 'name');

(async) bySelector(text, selector) → {Promise.<void>}

Adds text to an element identified by its CSS selector.
Parameters:
NameTypeDescription
textstringThe text string to add.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.bySelector('mytext', 'selector');

(async) byXpath(text, xpath) → {Promise.<void>}

Adds text to an element identified by its XPath.
Parameters:
NameTypeDescription
textstringThe text string to add.
xpathstringThe XPath of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byXpath('mytext', 'xpath');
\ No newline at end of file +
On this page

AddText

Provides functionality to add text to elements on a web page using various selectors.

Classes

AddText

Methods

(async) byClassName(text, className) → {Promise.<void>}

Adds text to an element identified by its class name.
Parameters:
NameTypeDescription
textstringThe text string to add.
classNamestringThe class name of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byClassName('mytext', 'className');

(async) byId(text, id) → {Promise.<void>}

Adds text to an element identified by its ID.
Parameters:
NameTypeDescription
textstringThe text string to add.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byId('mytext', 'id');

(async) byName(text, name) → {Promise.<void>}

Adds text to an element identified by its name attribute.
Parameters:
NameTypeDescription
textstringThe text string to add.
namestringThe name attribute of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byName('mytext', 'name');

(async) bySelector(text, selector) → {Promise.<void>}

Adds text to an element identified by its CSS selector.
Parameters:
NameTypeDescription
textstringThe text string to add.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.bySelector('mytext', 'selector');

(async) byXpath(text, xpath) → {Promise.<void>}

Adds text to an element identified by its XPath.
Parameters:
NameTypeDescription
textstringThe text string to add.
xpathstringThe XPath of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the text has been added.
Type: 
Promise.<void>
Example
commands.addText.byXpath('mytext', 'xpath');
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/AndroidCommand.html b/docs/documentation/sitespeed.io/scripting/AndroidCommand.html index 88a872fad..07ae20902 100644 --- a/docs/documentation/sitespeed.io/scripting/AndroidCommand.html +++ b/docs/documentation/sitespeed.io/scripting/AndroidCommand.html @@ -1,3 +1,3 @@ Class: AndroidCommand
On this page

AndroidCommand

Provides functionality to interact with an Android device through shell commands.

Classes

AndroidCommand

Methods

(async) shell(command) → {Promise.<string>}

Runs a shell command on the connected Android device. This method requires the Android device to be properly configured.
Parameters:
NameTypeDescription
commandstringThe shell command to run on the Android device.
Throws:
Throws an error if Android is not configured or if the command fails.
Type
Error
Returns:
A promise that resolves with the result of the command or rejects if there's an error.
Type: 
Promise.<string>
Example
await commands.android.shell('');

(async) shellAsRoot(command) → {Promise.<string>}

Runs a shell command on the connected Android device as the root user. This method requires the Android device to be properly configured and that you rooted the device.
Parameters:
NameTypeDescription
commandstringThe shell command to run on the Android device as root.
Throws:
Throws an error if Android is not configured or if the command fails.
Type
Error
Returns:
A promise that resolves with the result of the command or rejects if there's an error.
Type: 
Promise.<string>
Example
await commands.android.shellAsRoot('');
\ No newline at end of file +
On this page

AndroidCommand

Provides functionality to interact with an Android device through shell commands.

Classes

AndroidCommand

Methods

(async) shell(command) → {Promise.<string>}

Runs a shell command on the connected Android device. This method requires the Android device to be properly configured.
Parameters:
NameTypeDescription
commandstringThe shell command to run on the Android device.
Throws:
Throws an error if Android is not configured or if the command fails.
Type
Error
Returns:
A promise that resolves with the result of the command or rejects if there's an error.
Type: 
Promise.<string>
Example
await commands.android.shell('');

(async) shellAsRoot(command) → {Promise.<string>}

Runs a shell command on the connected Android device as the root user. This method requires the Android device to be properly configured and that you rooted the device.
Parameters:
NameTypeDescription
commandstringThe shell command to run on the Android device as root.
Throws:
Throws an error if Android is not configured or if the command fails.
Type
Error
Returns:
A promise that resolves with the result of the command or rejects if there's an error.
Type: 
Promise.<string>
Example
await commands.android.shellAsRoot('');
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Cache.html b/docs/documentation/sitespeed.io/scripting/Cache.html index b4cf214aa..313e16652 100644 --- a/docs/documentation/sitespeed.io/scripting/Cache.html +++ b/docs/documentation/sitespeed.io/scripting/Cache.html @@ -1,3 +1,3 @@ Class: Cache
On this page

Cache

Manage the browser cache. This class provides methods to clear the cache and cookies in different browsers.

Classes

Cache

Methods

(async) clear() → {Promise.<void>}

Clears the browser cache. This includes both cache and cookies. For Firefox, it uses the extensionServer setup with specific options. For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) commands. If the browser is not supported, logs an error message.
Throws:
Will throw an error if the browser is not supported.
Returns:
A promise that resolves when the cache and cookies are cleared.
Type: 
Promise.<void>
Example
await commands.cache.clear();

(async) clearKeepCookies() → {Promise.<void>}

Clears the browser cache while keeping the cookies. For Firefox, it uses the extensionServer setup with specific options. For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) command to clear the cache. If the browser is not supported, logs an error message.
Throws:
Will throw an error if the browser is not supported.
Returns:
A promise that resolves when the cache is cleared but cookies are kept.
Type: 
Promise.<void>
Example
await commands.cache.clearKeepCookies();
\ No newline at end of file +
On this page

Cache

Manage the browser cache. This class provides methods to clear the cache and cookies in different browsers.

Classes

Cache

Methods

(async) clear() → {Promise.<void>}

Clears the browser cache. This includes both cache and cookies. For Firefox, it uses the extensionServer setup with specific options. For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) commands. If the browser is not supported, logs an error message.
Throws:
Will throw an error if the browser is not supported.
Returns:
A promise that resolves when the cache and cookies are cleared.
Type: 
Promise.<void>
Example
await commands.cache.clear();

(async) clearKeepCookies() → {Promise.<void>}

Clears the browser cache while keeping the cookies. For Firefox, it uses the extensionServer setup with specific options. For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) command to clear the cache. If the browser is not supported, logs an error message.
Throws:
Will throw an error if the browser is not supported.
Returns:
A promise that resolves when the cache is cleared but cookies are kept.
Type: 
Promise.<void>
Example
await commands.cache.clearKeepCookies();
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/ChromeDevelopmentToolsProtocol.html b/docs/documentation/sitespeed.io/scripting/ChromeDevelopmentToolsProtocol.html index 683b8d72e..546fa0645 100644 --- a/docs/documentation/sitespeed.io/scripting/ChromeDevelopmentToolsProtocol.html +++ b/docs/documentation/sitespeed.io/scripting/ChromeDevelopmentToolsProtocol.html @@ -1,3 +1,3 @@ Class: ChromeDevelopmentToolsProtocol
On this page

ChromeDevelopmentToolsProtocol

Manages interactions with the Chrome DevTools Protocol for Chrome and Edge browsers. Allows sending commands and setting up event listeners via the protocol.

Classes

ChromeDevelopmentToolsProtocol

Methods

getRawClient() → {Object}

Retrieves the raw client for the DevTools Protocol.
Throws:
Throws an error if the browser is not supported.
Type
Error
Returns:
The raw DevTools Protocol client.
Type: 
Object
Example
const cdpClient = commands.cdp.getRawClient();

(async) on(event, f)

Sets up an event listener for a specific DevTools Protocol event.
Parameters:
NameTypeDescription
eventstringThe name of the event to listen for.
ffunctionThe callback function to execute when the event is triggered.
Throws:
Throws an error if the browser is not supported or if setting the listener fails.
Type
Error

(async) send(command, arguments_) → {Promise.<void>}

Sends a command to the DevTools Protocol.
Parameters:
NameTypeDescription
commandstringThe DevTools Protocol command to send.
arguments_ObjectThe arguments for the command.
Throws:
Throws an error if the browser is not supported or if the command fails.
Type
Error
Returns:
A promise that resolves when the command has been sent.
Type: 
Promise.<void>
Example
await commands.cdp.send('');

(async) sendAndGet(command, arguments_) → {Promise.<Object>}

Sends a command to the DevTools Protocol and returns the result.
Parameters:
NameTypeDescription
commandstringThe DevTools Protocol command to send.
arguments_ObjectThe arguments for the command.
Throws:
Throws an error if the browser is not supported or if the command fails.
Type
Error
Returns:
The result of the command execution.
Type: 
Promise.<Object>
Example
const domCounters = await commands.cdp.sendAndGet('Memory.getDOMCounters');
\ No newline at end of file +
On this page

ChromeDevelopmentToolsProtocol

Manages interactions with the Chrome DevTools Protocol for Chrome and Edge browsers. Allows sending commands and setting up event listeners via the protocol.

Classes

ChromeDevelopmentToolsProtocol

Methods

getRawClient() → {Object}

Retrieves the raw client for the DevTools Protocol.
Throws:
Throws an error if the browser is not supported.
Type
Error
Returns:
The raw DevTools Protocol client.
Type: 
Object
Example
const cdpClient = commands.cdp.getRawClient();

(async) on(event, f)

Sets up an event listener for a specific DevTools Protocol event.
Parameters:
NameTypeDescription
eventstringThe name of the event to listen for.
ffunctionThe callback function to execute when the event is triggered.
Throws:
Throws an error if the browser is not supported or if setting the listener fails.
Type
Error

(async) send(command, arguments_) → {Promise.<void>}

Sends a command to the DevTools Protocol.
Parameters:
NameTypeDescription
commandstringThe DevTools Protocol command to send.
arguments_ObjectThe arguments for the command.
Throws:
Throws an error if the browser is not supported or if the command fails.
Type
Error
Returns:
A promise that resolves when the command has been sent.
Type: 
Promise.<void>
Example
await commands.cdp.send('');

(async) sendAndGet(command, arguments_) → {Promise.<Object>}

Sends a command to the DevTools Protocol and returns the result.
Parameters:
NameTypeDescription
commandstringThe DevTools Protocol command to send.
arguments_ObjectThe arguments for the command.
Throws:
Throws an error if the browser is not supported or if the command fails.
Type
Error
Returns:
The result of the command execution.
Type: 
Promise.<Object>
Example
const domCounters = await commands.cdp.sendAndGet('Memory.getDOMCounters');
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/ChromeTrace.html b/docs/documentation/sitespeed.io/scripting/ChromeTrace.html index 544e84b5e..f71ee2cb5 100644 --- a/docs/documentation/sitespeed.io/scripting/ChromeTrace.html +++ b/docs/documentation/sitespeed.io/scripting/ChromeTrace.html @@ -1,3 +1,3 @@ Class: ChromeTrace
On this page

ChromeTrace

Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.

Classes

ChromeTrace

Methods

(async) start() → {Promise.<void>}

Starts the Chrome trace collection.
Throws:
Throws an error if not running Chrome or if configuration is not set for custom tracing.
Type
Error
Returns:
A promise that resolves when tracing is started.
Type: 
Promise.<void>
Example
await commands.trace.start();

(async) stop() → {Promise.<void>}

Stops the Chrome trace collection, processes the collected data, and attaches it to the result object.
Throws:
Throws an error if not running Chrome or if custom tracing was not started.
Type
Error
Returns:
A promise that resolves when tracing is stopped and data is processed.
Type: 
Promise.<void>
Example
await commands.trace.stop();
\ No newline at end of file +
On this page

ChromeTrace

Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.

Classes

ChromeTrace

Methods

(async) start() → {Promise.<void>}

Starts the Chrome trace collection.
Throws:
Throws an error if not running Chrome or if configuration is not set for custom tracing.
Type
Error
Returns:
A promise that resolves when tracing is started.
Type: 
Promise.<void>
Example
await commands.trace.start();

(async) stop() → {Promise.<void>}

Stops the Chrome trace collection, processes the collected data, and attaches it to the result object.
Throws:
Throws an error if not running Chrome or if custom tracing was not started.
Type
Error
Returns:
A promise that resolves when tracing is stopped and data is processed.
Type: 
Promise.<void>
Example
await commands.trace.stop();
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Click.html b/docs/documentation/sitespeed.io/scripting/Click.html index 1842e26ab..c06465cda 100644 --- a/docs/documentation/sitespeed.io/scripting/Click.html +++ b/docs/documentation/sitespeed.io/scripting/Click.html @@ -1,3 +1,3 @@ Class: Click
On this page

Click

Provides functionality to perform click actions on elements in a web page using various selectors.

Classes

Click

Methods

(async) byClassName(className) → {Promise.<void>}

Clicks on an element identified by its class name.
Parameters:
NameTypeDescription
classNamestringThe class name of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byClassNameAndWait(className) → {Promise.<void>}

Clicks on an element identified by its class name and waits for the page complete check to finish.
Parameters:
NameTypeDescription
classNamestringThe class name of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byId(id) → {Promise.<void>}

Clicks on an element located by its ID.
Parameters:
NameTypeDescription
idstringThe ID of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byIdAndWait(id) → {Promise.<void>}

Click on link located by the ID attribute. Uses document.getElementById() to find the element. And wait for page complete check to finish.
Parameters:
NameTypeDescription
idstring
Throws:
Will throw an error if the element is not found
Returns:
Promise object represents when the element has been clicked and the pageCompleteCheck has finished.
Type: 
Promise.<void>

(async) byJs(js) → {Promise.<void>}

Clicks on an element located by evaluating a JavaScript expression.
Parameters:
NameTypeDescription
jsstringThe JavaScript expression that evaluates to an element or list of elements.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byJsAndWait(js) → {Promise.<void>}

Clicks on an element located by evaluating a JavaScript expression and waits for the page complete check to finish.
Parameters:
NameTypeDescription
jsstringThe JavaScript expression that evaluates to an element or list of elements.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string and waits for the page complete check to finish.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byName(name) → {Promise.<void>}

Clicks on an element located by its name attribute.
Parameters:
NameTypeDescription
namestringThe name attribute of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring and waits for the page complete check to finish.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Clicks on an element located by its CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) bySelectorAndWait(selector) → {Promise.<void>}

Clicks on an element located by its CSS selector and waits for the page complete check to finish.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Clicks on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byXpathAndWait(xpath) → {Promise.<void>}

Clicks on an element that matches a given XPath selector and waits for the page complete check to finish.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Click

Provides functionality to perform click actions on elements in a web page using various selectors.

Classes

Click

Methods

(async) byClassName(className) → {Promise.<void>}

Clicks on an element identified by its class name.
Parameters:
NameTypeDescription
classNamestringThe class name of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byClassNameAndWait(className) → {Promise.<void>}

Clicks on an element identified by its class name and waits for the page complete check to finish.
Parameters:
NameTypeDescription
classNamestringThe class name of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byId(id) → {Promise.<void>}

Clicks on an element located by its ID.
Parameters:
NameTypeDescription
idstringThe ID of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byIdAndWait(id) → {Promise.<void>}

Click on link located by the ID attribute. Uses document.getElementById() to find the element. And wait for page complete check to finish.
Parameters:
NameTypeDescription
idstring
Throws:
Will throw an error if the element is not found
Returns:
Promise object represents when the element has been clicked and the pageCompleteCheck has finished.
Type: 
Promise.<void>

(async) byJs(js) → {Promise.<void>}

Clicks on an element located by evaluating a JavaScript expression.
Parameters:
NameTypeDescription
jsstringThe JavaScript expression that evaluates to an element or list of elements.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byJsAndWait(js) → {Promise.<void>}

Clicks on an element located by evaluating a JavaScript expression and waits for the page complete check to finish.
Parameters:
NameTypeDescription
jsstringThe JavaScript expression that evaluates to an element or list of elements.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string and waits for the page complete check to finish.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byName(name) → {Promise.<void>}

Clicks on an element located by its name attribute.
Parameters:
NameTypeDescription
namestringThe name attribute of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring and waits for the page complete check to finish.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Clicks on an element located by its CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) bySelectorAndWait(selector) → {Promise.<void>}

Clicks on an element located by its CSS selector and waits for the page complete check to finish.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Clicks on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byXpathAndWait(xpath) → {Promise.<void>}

Clicks on an element that matches a given XPath selector and waits for the page complete check to finish.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the click action and page complete check are finished.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/ClickAndHold.html b/docs/documentation/sitespeed.io/scripting/ClickAndHold.html index 00455ea2a..9cc571dc4 100644 --- a/docs/documentation/sitespeed.io/scripting/ClickAndHold.html +++ b/docs/documentation/sitespeed.io/scripting/ClickAndHold.html @@ -1,3 +1,3 @@ Class: ClickAndHold
On this page

ClickAndHold

Provides functionality to click and hold elements on a web page using different strategies.

Classes

ClickAndHold

Methods

(async) atCursor() → {Promise.<void>}

Clicks and holds at the current cursor position.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) atPosition(xPos, yPos) → {Promise.<void>}

Clicks and holds at the specified screen coordinates.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen.
yPosnumberThe y-coordinate on the screen.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Clicks and holds on an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to interact with.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Clicks and holds on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to interact with.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) releaseAtPosition(xPos, yPos) → {Promise.<void>}

Releases the mouse button at the specified screen coordinates.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen.
yPosnumberThe y-coordinate on the screen.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) releaseAtSelector(selector) → {Promise.<void>}

Releases the mouse button on an element matching the specified CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to release the mouse on.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) releaseAtXpath(xpath) → {Promise.<void>}

Releases the mouse button on an element matching the specified XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to release the mouse on.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

ClickAndHold

Provides functionality to click and hold elements on a web page using different strategies.

Classes

ClickAndHold

Methods

(async) atCursor() → {Promise.<void>}

Clicks and holds at the current cursor position.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) atPosition(xPos, yPos) → {Promise.<void>}

Clicks and holds at the specified screen coordinates.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen.
yPosnumberThe y-coordinate on the screen.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Clicks and holds on an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to interact with.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Clicks and holds on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to interact with.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) releaseAtPosition(xPos, yPos) → {Promise.<void>}

Releases the mouse button at the specified screen coordinates.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen.
yPosnumberThe y-coordinate on the screen.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) releaseAtSelector(selector) → {Promise.<void>}

Releases the mouse button on an element matching the specified CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to release the mouse on.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

(async) releaseAtXpath(xpath) → {Promise.<void>}

Releases the mouse button on an element matching the specified XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to release the mouse on.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Commands.html b/docs/documentation/sitespeed.io/scripting/Commands.html index d102e8b2a..261a734e7 100644 --- a/docs/documentation/sitespeed.io/scripting/Commands.html +++ b/docs/documentation/sitespeed.io/scripting/Commands.html @@ -1,3 +1,3 @@ Class: Commands
On this page

Commands

Represents the set of commands available in a Browsertime script.

Classes

Commands

Members

action :Actions

Selenium's action sequence functionality.
Type:

addText :AddText

Provides functionality to add text to elements on a web page using various selectors.
Type:

android :AndroidCommand

Provides commands for interacting with an Android device.

cache :Cache

Manages the browser's cache.
Type:

cdp :ChromeDevelopmentToolsProtocol

Use the Chrome DevTools Protocol, available in Chrome and Edge.

click :Click

Provides functionality to perform click actions on elements in a web page using various selectors.
Type:

debug :Debug

Provides debugging capabilities within a browser automation script. It allows setting breakpoints to pause script execution and inspect the current state.
Type:

element :Element

Get Selenium's WebElements.
Type:

error :function

Add a text that will be an error attached to the current page.
Type:
  • function
Example
await commands.error('My error message');

js :JavaScript

Executes JavaScript in the browser context.

markAsFailure :function

Mark this run as an failure. Add a message that explains the failure.
Type:
  • function
Example
await commands.markAsFailure('My failure message');

measure :Measure

Provides functionality for measuring a navigation.
Type:

meta :Meta

Adds metadata to the user journey.
Type:

mouse :Object

Interact with the page using the mouse.
Type:
  • Object
Navigates to a specified URL and handles additional setup for a page visit.
Type:
  • function
Example
await commands.navigate('https://www.example.org');
Provides functionality to control browser navigation such as back, forward, and refresh actions.

screenshot :Screenshot

Takes and manages screenshots.

scroll :Scroll

Provides functionality to control page scrolling in the browser.
Type:

select :Select

Interact with a select element.
Type:

set :Set

Sets values on HTML elements in the page.
Type:

stopWatch :StopWatch

Stopwatch utility for measuring time intervals.

switch :Switch

Switches context to different frames, windows, or tabs in the browser.
Type:

trace :ChromeTrace

Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.

wait :Wait

Provides functionality to wait for different conditions in the browser.
Type:
\ No newline at end of file +
On this page

Commands

Represents the set of commands available in a Browsertime script.

Classes

Commands

Members

action :Actions

Selenium's action sequence functionality.
Type:

addText :AddText

Provides functionality to add text to elements on a web page using various selectors.
Type:

android :AndroidCommand

Provides commands for interacting with an Android device.

cache :Cache

Manages the browser's cache.
Type:

cdp :ChromeDevelopmentToolsProtocol

Use the Chrome DevTools Protocol, available in Chrome and Edge.

click :Click

Provides functionality to perform click actions on elements in a web page using various selectors.
Type:

debug :Debug

Provides debugging capabilities within a browser automation script. It allows setting breakpoints to pause script execution and inspect the current state.
Type:

element :Element

Get Selenium's WebElements.
Type:

error :function

Add a text that will be an error attached to the current page.
Type:
  • function
Example
await commands.error('My error message');

js :JavaScript

Executes JavaScript in the browser context.

markAsFailure :function

Mark this run as an failure. Add a message that explains the failure.
Type:
  • function
Example
await commands.markAsFailure('My failure message');

measure :Measure

Provides functionality for measuring a navigation.
Type:

meta :Meta

Adds metadata to the user journey.
Type:

mouse :Object

Interact with the page using the mouse.
Type:
  • Object
Navigates to a specified URL and handles additional setup for a page visit.
Type:
  • function
Example
await commands.navigate('https://www.example.org');
Provides functionality to control browser navigation such as back, forward, and refresh actions.

screenshot :Screenshot

Takes and manages screenshots.

scroll :Scroll

Provides functionality to control page scrolling in the browser.
Type:

select :Select

Interact with a select element.
Type:

set :Set

Sets values on HTML elements in the page.
Type:

stopWatch :StopWatch

Stopwatch utility for measuring time intervals.

switch :Switch

Switches context to different frames, windows, or tabs in the browser.
Type:

trace :ChromeTrace

Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.

wait :Wait

Provides functionality to wait for different conditions in the browser.
Type:
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/ContextClick.html b/docs/documentation/sitespeed.io/scripting/ContextClick.html index bf0e66dc6..96db07e61 100644 --- a/docs/documentation/sitespeed.io/scripting/ContextClick.html +++ b/docs/documentation/sitespeed.io/scripting/ContextClick.html @@ -1,3 +1,3 @@ Class: ContextClick
On this page

ContextClick

Provides functionality to perform a context click (right-click) on elements in a web page.

Classes

ContextClick

Methods

(async) atCursor() → {Promise.<void>}

Performs a context click (right-click) at the current cursor position.
Throws:
Throws an error if the context click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the context click action is performed.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Performs a context click (right-click) on an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to context click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the context click action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Performs a context click (right-click) on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to context click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the context click action is performed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

ContextClick

Provides functionality to perform a context click (right-click) on elements in a web page.

Classes

ContextClick

Methods

(async) atCursor() → {Promise.<void>}

Performs a context click (right-click) at the current cursor position.
Throws:
Throws an error if the context click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the context click action is performed.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Performs a context click (right-click) on an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to context click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the context click action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Performs a context click (right-click) on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to context click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the context click action is performed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Debug.html b/docs/documentation/sitespeed.io/scripting/Debug.html index d3a536b00..e7a3ffd2c 100644 --- a/docs/documentation/sitespeed.io/scripting/Debug.html +++ b/docs/documentation/sitespeed.io/scripting/Debug.html @@ -1,3 +1,3 @@ Class: Debug
On this page

Debug

Provides debugging capabilities within a browser automation script. It allows setting breakpoints to pause script execution and inspect the current state.

Classes

Debug

Methods

(async) breakpoint(nameopt) → {Promise.<void>}

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.
Parameters:
NameTypeAttributesDescription
namestring<optional>
An optional name for the breakpoint for logging purposes.
Returns:
A promise that resolves when the user chooses to continue from the breakpoint.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Debug

Provides debugging capabilities within a browser automation script. It allows setting breakpoints to pause script execution and inspect the current state.

Classes

Debug

Methods

(async) breakpoint(nameopt) → {Promise.<void>}

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.
Parameters:
NameTypeAttributesDescription
namestring<optional>
An optional name for the breakpoint for logging purposes.
Returns:
A promise that resolves when the user chooses to continue from the breakpoint.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/DoubleClick.html b/docs/documentation/sitespeed.io/scripting/DoubleClick.html index a2cdf6ece..a11fcddc5 100644 --- a/docs/documentation/sitespeed.io/scripting/DoubleClick.html +++ b/docs/documentation/sitespeed.io/scripting/DoubleClick.html @@ -1,3 +1,3 @@ Class: DoubleClick
On this page

DoubleClick

Provides functionality to perform a double-click action on elements in a web page.

Classes

DoubleClick

Methods

(async) atCursor(optionsopt) → {Promise.<void>}

Performs a mouse double-click at the current cursor position.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for the double-click action.
Throws:
Throws an error if the double-click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the double-click occurs.
Type: 
Promise.<void>

(async) bySelector(selector, optionsopt) → {Promise.<void>}

Performs a mouse double-click on an element matching a given CSS selector.
Parameters:
NameTypeAttributesDescription
selectorstringThe CSS selector of the element to double-click.
optionsObject<optional>
Additional options for the double-click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the double-click action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath, optionsopt) → {Promise.<void>}

Performs a mouse double-click on an element matching a given XPath selector.
Parameters:
NameTypeAttributesDescription
xpathstringThe XPath selector of the element to double-click.
optionsObject<optional>
Additional options for the double-click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the double-click action is performed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

DoubleClick

Provides functionality to perform a double-click action on elements in a web page.

Classes

DoubleClick

Methods

(async) atCursor(optionsopt) → {Promise.<void>}

Performs a mouse double-click at the current cursor position.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for the double-click action.
Throws:
Throws an error if the double-click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the double-click occurs.
Type: 
Promise.<void>

(async) bySelector(selector, optionsopt) → {Promise.<void>}

Performs a mouse double-click on an element matching a given CSS selector.
Parameters:
NameTypeAttributesDescription
selectorstringThe CSS selector of the element to double-click.
optionsObject<optional>
Additional options for the double-click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the double-click action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath, optionsopt) → {Promise.<void>}

Performs a mouse double-click on an element matching a given XPath selector.
Parameters:
NameTypeAttributesDescription
xpathstringThe XPath selector of the element to double-click.
optionsObject<optional>
Additional options for the double-click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the double-click action is performed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Element.html b/docs/documentation/sitespeed.io/scripting/Element.html index 8a05eb8c7..786743d85 100644 --- a/docs/documentation/sitespeed.io/scripting/Element.html +++ b/docs/documentation/sitespeed.io/scripting/Element.html @@ -1,3 +1,3 @@ Class: Element
On this page

Element

This class provides a way to get hokld of Seleniums WebElements.

Classes

Element

Methods

(async) getByClassName(className) → {Promise.<WebElement>}

Finds an element by its class name.
Parameters:
NameTypeDescription
classNamestringThe class name of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getByCss(name) → {Promise.<WebElement>}

Finds an element by its CSS selector.
Parameters:
NameTypeDescription
namestringThe CSS selector of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getById(id) → {Promise.<WebElement>}

Finds an element by its ID.
Parameters:
NameTypeDescription
idstringThe ID of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getByName(name) → {Promise.<WebElement>}

Finds an element by its name attribute.
Parameters:
NameTypeDescription
namestringThe name attribute of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getByXpath(xpath) → {Promise.<WebElement>}

Finds an element by its XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath query of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>
\ No newline at end of file +
On this page

Element

This class provides a way to get hokld of Seleniums WebElements.

Classes

Element

Methods

(async) getByClassName(className) → {Promise.<WebElement>}

Finds an element by its class name.
Parameters:
NameTypeDescription
classNamestringThe class name of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getByCss(name) → {Promise.<WebElement>}

Finds an element by its CSS selector.
Parameters:
NameTypeDescription
namestringThe CSS selector of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getById(id) → {Promise.<WebElement>}

Finds an element by its ID.
Parameters:
NameTypeDescription
idstringThe ID of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getByName(name) → {Promise.<WebElement>}

Finds an element by its name attribute.
Parameters:
NameTypeDescription
namestringThe name attribute of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>

(async) getByXpath(xpath) → {Promise.<WebElement>}

Finds an element by its XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath query of the element.
Returns:
A promise that resolves to the WebElement found.
Type: 
Promise.<WebElement>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/GeckoProfiler.html b/docs/documentation/sitespeed.io/scripting/GeckoProfiler.html index 631f2ef27..8ed16e12f 100644 --- a/docs/documentation/sitespeed.io/scripting/GeckoProfiler.html +++ b/docs/documentation/sitespeed.io/scripting/GeckoProfiler.html @@ -1,3 +1,3 @@ Class: GeckoProfiler
On this page

GeckoProfiler

Manages the Gecko Profiler for profiling Firefox performance.

Classes

GeckoProfiler

Methods

(async) start() → {Promise.<void>}

Starts the Gecko Profiler.
Throws:
Throws an error if not running Firefox or if the configuration is not set for custom profiling.
Type
Error
Returns:
A promise that resolves when the profiler is started.
Type: 
Promise.<void>

(async) stop() → {Promise.<void>}

Stops the Gecko Profiler and processes the collected data.
Throws:
Throws an error if not running Firefox or if custom profiling was not started.
Type
Error
Returns:
A promise that resolves when the profiler is stopped and the data is processed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

GeckoProfiler

Manages the Gecko Profiler for profiling Firefox performance.

Classes

GeckoProfiler

Methods

(async) start() → {Promise.<void>}

Starts the Gecko Profiler.
Throws:
Throws an error if not running Firefox or if the configuration is not set for custom profiling.
Type
Error
Returns:
A promise that resolves when the profiler is started.
Type: 
Promise.<void>

(async) stop() → {Promise.<void>}

Stops the Gecko Profiler and processes the collected data.
Throws:
Throws an error if not running Firefox or if custom profiling was not started.
Type
Error
Returns:
A promise that resolves when the profiler is stopped and the data is processed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/JavaScript.html b/docs/documentation/sitespeed.io/scripting/JavaScript.html index 7f7792f9d..b2a6dc385 100644 --- a/docs/documentation/sitespeed.io/scripting/JavaScript.html +++ b/docs/documentation/sitespeed.io/scripting/JavaScript.html @@ -1,3 +1,3 @@ Class: JavaScript
On this page

JavaScript

Provides functionality to execute JavaScript code in the context of the current page.

Classes

JavaScript

Methods

(async) run(js) → {Promise.<*>}

Executes a JavaScript script.
Parameters:
NameTypeDescription
jsstringThe JavaScript code to execute.
Throws:
Throws an error if the JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed script.
Type: 
Promise.<*>

(async) runAndWait(js) → {Promise.<*>}

Executes a JavaScript script and waits for the page complete check to finish.
Parameters:
NameTypeDescription
jsstringThe JavaScript code to execute.
Throws:
Throws an error if the JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed script and the completion of the page load.
Type: 
Promise.<*>

(async) runPrivileged(js) → {Promise.<*>}

Executes synchronous privileged JavaScript.
Parameters:
NameTypeDescription
jsstringThe privileged JavaScript code to execute.
Throws:
Throws an error if the privileged JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed privileged script.
Type: 
Promise.<*>

(async) runPrivilegedAndWait(js) → {Promise.<*>}

Executes synchronous privileged JavaScript and waits for the page complete check to finish.
Parameters:
NameTypeDescription
jsstringThe privileged JavaScript code to execute.
Throws:
Throws an error if the privileged JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed privileged script and the completion of the page load.
Type: 
Promise.<*>

(async) runPrivilegedAsync(js) → {Promise.<*>}

Executes asynchronous privileged JavaScript.
Parameters:
NameTypeDescription
jsstringThe asynchronous privileged JavaScript code to execute.
Throws:
Throws an error if the asynchronous privileged JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed asynchronous privileged script.
Type: 
Promise.<*>
\ No newline at end of file +
On this page

JavaScript

Provides functionality to execute JavaScript code in the context of the current page.

Classes

JavaScript

Methods

(async) run(js) → {Promise.<*>}

Executes a JavaScript script.
Parameters:
NameTypeDescription
jsstringThe JavaScript code to execute.
Throws:
Throws an error if the JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed script.
Type: 
Promise.<*>

(async) runAndWait(js) → {Promise.<*>}

Executes a JavaScript script and waits for the page complete check to finish.
Parameters:
NameTypeDescription
jsstringThe JavaScript code to execute.
Throws:
Throws an error if the JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed script and the completion of the page load.
Type: 
Promise.<*>

(async) runPrivileged(js) → {Promise.<*>}

Executes synchronous privileged JavaScript.
Parameters:
NameTypeDescription
jsstringThe privileged JavaScript code to execute.
Throws:
Throws an error if the privileged JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed privileged script.
Type: 
Promise.<*>

(async) runPrivilegedAndWait(js) → {Promise.<*>}

Executes synchronous privileged JavaScript and waits for the page complete check to finish.
Parameters:
NameTypeDescription
jsstringThe privileged JavaScript code to execute.
Throws:
Throws an error if the privileged JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed privileged script and the completion of the page load.
Type: 
Promise.<*>

(async) runPrivilegedAsync(js) → {Promise.<*>}

Executes asynchronous privileged JavaScript.
Parameters:
NameTypeDescription
jsstringThe asynchronous privileged JavaScript code to execute.
Throws:
Throws an error if the asynchronous privileged JavaScript cannot be executed.
Type
Error
Returns:
A promise that resolves with the result of the executed asynchronous privileged script.
Type: 
Promise.<*>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Measure.html b/docs/documentation/sitespeed.io/scripting/Measure.html index 247597996..7d472b0d2 100644 --- a/docs/documentation/sitespeed.io/scripting/Measure.html +++ b/docs/documentation/sitespeed.io/scripting/Measure.html @@ -1,6 +1,6 @@ Class: Measure
On this page

Measure

A measurement tool for browser-based metrics, handling various aspects of metric collection including navigation, video recording, and data collection.

Classes

Measure

Methods

add(name, 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.
Parameters:
NameTypeDescription
namestringThe name of the metric.
value*The value of the metric.
Throws:
Throws an error if called before a measurement cycle has started.
Type
Error

addObject(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.
Parameters:
NameTypeDescription
objectObjectAn object containing key-value pairs of metrics to add.
Throws:
Throws an error if called before a measurement cycle has started.
Type
Error

(async) start(urlOrAlias, optionalAliasopt) → {Promise.<void>}

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.
Parameters:
NameTypeAttributesDescription
urlOrAliasstringThe URL to navigate to, or an alias representing the test.
optionalAliasstring<optional>
An optional alias that can be used if the first parameter is a URL.
Throws:
Throws an error if navigation fails or if there are issues in the setup process.
Type
Error
Returns:
A promise that resolves when the start process is complete, or rejects if there are errors.
Type: 
Promise.<void>
Example
await commands.measure.start('https://www.example.org');
+    
On this page

Measure

A measurement tool for browser-based metrics, handling various aspects of metric collection including navigation, video recording, and data collection.

Classes

Measure

Methods

add(name, 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.
Parameters:
NameTypeDescription
namestringThe name of the metric.
value*The value of the metric.
Throws:
Throws an error if called before a measurement cycle has started.
Type
Error

addObject(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.
Parameters:
NameTypeDescription
objectObjectAn object containing key-value pairs of metrics to add.
Throws:
Throws an error if called before a measurement cycle has started.
Type
Error

(async) start(urlOrAlias, optionalAliasopt) → {Promise.<void>}

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.
Parameters:
NameTypeAttributesDescription
urlOrAliasstringThe URL to navigate to, or an alias representing the test.
optionalAliasstring<optional>
An optional alias that can be used if the first parameter is a URL.
Throws:
Throws an error if navigation fails or if there are issues in the setup process.
Type
Error
Returns:
A promise that resolves when the start process is complete, or rejects if there are errors.
Type: 
Promise.<void>
Example
await commands.measure.start('https://www.example.org');
 // Or start the measurement and click on a link
 await commands.measure.start();
 await commands.click.byLinkTextAndWait('Documentation');
diff --git a/docs/documentation/sitespeed.io/scripting/Meta.html b/docs/documentation/sitespeed.io/scripting/Meta.html
index f04e0364d..48a31d88d 100644
--- a/docs/documentation/sitespeed.io/scripting/Meta.html
+++ b/docs/documentation/sitespeed.io/scripting/Meta.html
@@ -1,3 +1,3 @@
 Class: Meta
On this page

Meta

Add meta data to your user journey.

Classes

Meta

Methods

setDescription(text)

Sets the description for the user journey.
Parameters:
NameTypeDescription
textstringThe text to set as the description.
Example
commands.meta.setDescription('My test');

setTitle(text)

Sets the title for the user journey.
Parameters:
NameTypeDescription
textstringThe text to set as the title.
Example
commands.meta.setTitle('Test title');
\ No newline at end of file +
On this page

Meta

Add meta data to your user journey.

Classes

Meta

Methods

setDescription(text)

Sets the description for the user journey.
Parameters:
NameTypeDescription
textstringThe text to set as the description.
Example
commands.meta.setDescription('My test');

setTitle(text)

Sets the title for the user journey.
Parameters:
NameTypeDescription
textstringThe text to set as the title.
Example
commands.meta.setTitle('Test title');
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/MouseMove.html b/docs/documentation/sitespeed.io/scripting/MouseMove.html index 19365085d..e3e0b4c80 100644 --- a/docs/documentation/sitespeed.io/scripting/MouseMove.html +++ b/docs/documentation/sitespeed.io/scripting/MouseMove.html @@ -1,3 +1,3 @@ Class: MouseMove
On this page

MouseMove

Provides functionality to move the mouse cursor to elements or specific positions on a web page.

Classes

MouseMove

Methods

(async) byOffset(xOffset, yOffset) → {Promise.<void>}

Moves the mouse cursor by an offset from its current position.
Parameters:
NameTypeDescription
xOffsetnumberThe x offset to move by.
yOffsetnumberThe y offset to move by.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the mouse has moved by the specified offset.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Moves the mouse cursor to an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to move to.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the element.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Moves the mouse cursor to an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to move to.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the element.
Type: 
Promise.<void>

(async) toPosition(xPos, yPos) → {Promise.<void>}

Moves the mouse cursor to a specific position on the screen.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen to move to.
yPosnumberThe y-coordinate on the screen to move to.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the specified position.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

MouseMove

Provides functionality to move the mouse cursor to elements or specific positions on a web page.

Classes

MouseMove

Methods

(async) byOffset(xOffset, yOffset) → {Promise.<void>}

Moves the mouse cursor by an offset from its current position.
Parameters:
NameTypeDescription
xOffsetnumberThe x offset to move by.
yOffsetnumberThe y offset to move by.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the mouse has moved by the specified offset.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Moves the mouse cursor to an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to move to.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the element.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Moves the mouse cursor to an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to move to.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the element.
Type: 
Promise.<void>

(async) toPosition(xPos, yPos) → {Promise.<void>}

Moves the mouse cursor to a specific position on the screen.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen to move to.
yPosnumberThe y-coordinate on the screen to move to.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the specified position.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Navigation.html b/docs/documentation/sitespeed.io/scripting/Navigation.html index c9345ec7b..a9107e8a2 100644 --- a/docs/documentation/sitespeed.io/scripting/Navigation.html +++ b/docs/documentation/sitespeed.io/scripting/Navigation.html @@ -1,3 +1,3 @@ Class: Navigation
On this page

Navigation

Provides functionality to control browser navigation such as back, forward, and refresh actions.

Classes

Navigation

Methods

(async) back(optionsopt) → {Promise.<void>}

Navigates backward in the browser's history.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
Throws:
Throws an error if navigation fails.
Type
Error
Returns:
A promise that resolves when the navigation action is completed.
Type: 
Promise.<void>

(async) forward(optionsopt) → {Promise.<void>}

Navigates forward in the browser's history.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
Throws:
Throws an error if navigation fails.
Type
Error
Returns:
A promise that resolves when the navigation action is completed.
Type: 
Promise.<void>

(async) refresh(optionsopt) → {Promise.<void>}

Refreshes the current page.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for refresh action. Set {wait:true} to wait for the page complete check to run.
Throws:
Throws an error if refreshing the page fails.
Type
Error
Returns:
A promise that resolves when the page has been refreshed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Navigation

Provides functionality to control browser navigation such as back, forward, and refresh actions.

Classes

Navigation

Methods

(async) back(optionsopt) → {Promise.<void>}

Navigates backward in the browser's history.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
Throws:
Throws an error if navigation fails.
Type
Error
Returns:
A promise that resolves when the navigation action is completed.
Type: 
Promise.<void>

(async) forward(optionsopt) → {Promise.<void>}

Navigates forward in the browser's history.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
Throws:
Throws an error if navigation fails.
Type
Error
Returns:
A promise that resolves when the navigation action is completed.
Type: 
Promise.<void>

(async) refresh(optionsopt) → {Promise.<void>}

Refreshes the current page.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for refresh action. Set {wait:true} to wait for the page complete check to run.
Throws:
Throws an error if refreshing the page fails.
Type
Error
Returns:
A promise that resolves when the page has been refreshed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Screenshot.html b/docs/documentation/sitespeed.io/scripting/Screenshot.html index 1c1ce27a9..6929d3a74 100644 --- a/docs/documentation/sitespeed.io/scripting/Screenshot.html +++ b/docs/documentation/sitespeed.io/scripting/Screenshot.html @@ -1,3 +1,3 @@ Class: Screenshot
On this page

Screenshot

Take a screenshot. The screenshot will be stored to disk, named by the name provided to the take function.

Classes

Screenshot

Methods

(async) take(name) → {Promise.<Object>}

Takes a screenshot and saves it using the screenshot manager.
Parameters:
NameTypeDescription
namestringThe name to assign to the screenshot file.
Throws:
Throws an error if the name parameter is not provided.
Type
Error
Returns:
A promise that resolves with the screenshot details.
Type: 
Promise.<Object>
Example
async commands.screenshot.take('my_startpage');
\ No newline at end of file +
On this page

Screenshot

Take a screenshot. The screenshot will be stored to disk, named by the name provided to the take function.

Classes

Screenshot

Methods

(async) take(name) → {Promise.<Object>}

Takes a screenshot and saves it using the screenshot manager.
Parameters:
NameTypeDescription
namestringThe name to assign to the screenshot file.
Throws:
Throws an error if the name parameter is not provided.
Type
Error
Returns:
A promise that resolves with the screenshot details.
Type: 
Promise.<Object>
Example
async commands.screenshot.take('my_startpage');
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Scroll.html b/docs/documentation/sitespeed.io/scripting/Scroll.html index ee85df979..cb17a8b57 100644 --- a/docs/documentation/sitespeed.io/scripting/Scroll.html +++ b/docs/documentation/sitespeed.io/scripting/Scroll.html @@ -1,3 +1,3 @@ Class: Scroll
On this page

Scroll

Provides functionality to control page scrolling in the browser.

Classes

Scroll

Methods

(async) byLines(lines) → {Promise.<void>}

Scrolls the page by the specified number of lines. This method is only supported in Firefox.
Parameters:
NameTypeDescription
linesnumberThe number of lines to scroll.
Throws:
Throws an error if not used in Firefox.
Type
Error
Returns:
A promise that resolves when the scrolling action is completed.
Type: 
Promise.<void>

(async) byPages(pages) → {Promise.<void>}

Scrolls the page by the specified number of pages.
Parameters:
NameTypeDescription
pagesnumberThe number of pages to scroll.
Returns:
A promise that resolves when the scrolling action is completed.
Type: 
Promise.<void>

(async) byPixels(Xpixels, Ypixels) → {Promise.<void>}

Scrolls the page by the specified number of pixels.
Parameters:
NameTypeDescription
XpixelsnumberThe number of pixels to scroll horizontally.
YpixelsnumberThe number of pixels to scroll vertically.
Returns:
A promise that resolves when the scrolling action is completed.
Type: 
Promise.<void>

(async) toBottom(delayTimeopt) → {Promise.<void>}

Scrolls to the bottom of the page, scrolling page by page with a delay between each scroll.
Parameters:
NameTypeAttributesDefaultDescription
delayTimenumber<optional>
250The delay time in milliseconds between each scroll.
Returns:
A promise that resolves when the scrolling to the bottom is completed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Scroll

Provides functionality to control page scrolling in the browser.

Classes

Scroll

Methods

(async) byLines(lines) → {Promise.<void>}

Scrolls the page by the specified number of lines. This method is only supported in Firefox.
Parameters:
NameTypeDescription
linesnumberThe number of lines to scroll.
Throws:
Throws an error if not used in Firefox.
Type
Error
Returns:
A promise that resolves when the scrolling action is completed.
Type: 
Promise.<void>

(async) byPages(pages) → {Promise.<void>}

Scrolls the page by the specified number of pages.
Parameters:
NameTypeDescription
pagesnumberThe number of pages to scroll.
Returns:
A promise that resolves when the scrolling action is completed.
Type: 
Promise.<void>

(async) byPixels(Xpixels, Ypixels) → {Promise.<void>}

Scrolls the page by the specified number of pixels.
Parameters:
NameTypeDescription
XpixelsnumberThe number of pixels to scroll horizontally.
YpixelsnumberThe number of pixels to scroll vertically.
Returns:
A promise that resolves when the scrolling action is completed.
Type: 
Promise.<void>

(async) toBottom(delayTimeopt) → {Promise.<void>}

Scrolls to the bottom of the page, scrolling page by page with a delay between each scroll.
Parameters:
NameTypeAttributesDefaultDescription
delayTimenumber<optional>
250The delay time in milliseconds between each scroll.
Returns:
A promise that resolves when the scrolling to the bottom is completed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Select.html b/docs/documentation/sitespeed.io/scripting/Select.html index 99dd7f5ea..2aeb0b3b5 100644 --- a/docs/documentation/sitespeed.io/scripting/Select.html +++ b/docs/documentation/sitespeed.io/scripting/Select.html @@ -1,3 +1,3 @@ Class: Select
On this page

Select

Provides functionality to interact with `

Classes

Select

Methods

(async) deselectById(selectId) → {Promise.<void>}

Deselects all options in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when all options are deselected.
Type: 
Promise.<void>

(async) getSelectedValueById(selectId) → {Promise.<string>}

Retrieves the value of the selected option in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves with the value of the selected option.
Type: 
Promise.<string>

(async) getValuesById(selectId) → {Promise.<Array.<string>>}

Retrieves all option values in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves with an array of the values of the options.
Type: 
Promise.<Array.<string>>

(async) selectByIdAndIndex(selectId, index) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
indexnumberThe index of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>

(async) selectByIdAndValue(selectId, value) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
valuestringThe value of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>

(async) selectByNameAndIndex(selectName, index) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectNamestringThe name of the `
indexnumberThe index of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>

(async) selectByNameAndValue(selectName, value) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectNamestringThe name of the `
valuestringThe value of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Select

Provides functionality to interact with `

Classes

Select

Methods

(async) deselectById(selectId) → {Promise.<void>}

Deselects all options in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when all options are deselected.
Type: 
Promise.<void>

(async) getSelectedValueById(selectId) → {Promise.<string>}

Retrieves the value of the selected option in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves with the value of the selected option.
Type: 
Promise.<string>

(async) getValuesById(selectId) → {Promise.<Array.<string>>}

Retrieves all option values in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves with an array of the values of the options.
Type: 
Promise.<Array.<string>>

(async) selectByIdAndIndex(selectId, index) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
indexnumberThe index of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>

(async) selectByIdAndValue(selectId, value) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectIdstringThe ID of the `
valuestringThe value of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>

(async) selectByNameAndIndex(selectName, index) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectNamestringThe name of the `
indexnumberThe index of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>

(async) selectByNameAndValue(selectName, value) → {Promise.<void>}

Selects an option in a `
Parameters:
NameTypeDescription
selectNamestringThe name of the `
valuestringThe value of the option to select.
Throws:
Throws an error if the `
Type
Error
Returns:
A promise that resolves when the option is selected.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Set.html b/docs/documentation/sitespeed.io/scripting/Set.html index eb97fc6db..c3e160906 100644 --- a/docs/documentation/sitespeed.io/scripting/Set.html +++ b/docs/documentation/sitespeed.io/scripting/Set.html @@ -1,3 +1,3 @@ Class: Set
On this page

Set

Provides functionality to set properties like innerHTML, innerText, and value on elements in a web page.

Classes

Set

Methods

(async) innerHtml(html, selector) → {Promise.<void>}

Sets the innerHTML of an element using a CSS selector.
Parameters:
NameTypeDescription
htmlstringThe HTML string to set as innerHTML.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerHTML is set.
Type: 
Promise.<void>

(async) innerHtmlById(html, id) → {Promise.<void>}

Sets the innerHTML of an element using its ID.
Parameters:
NameTypeDescription
htmlstringThe HTML string to set as innerHTML.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerHTML is set.
Type: 
Promise.<void>

(async) innerText(text, selector) → {Promise.<void>}

Sets the innerText of an element using a CSS selector.
Parameters:
NameTypeDescription
textstringThe text to set as innerText.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerText is set.
Type: 
Promise.<void>

(async) innerTextById(text, id) → {Promise.<void>}

Sets the innerText of an element using its ID.
Parameters:
NameTypeDescription
textstringThe text to set as innerText.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerText is set.
Type: 
Promise.<void>

(async) value(value, selector) → {Promise.<void>}

Sets the value of an element using a CSS selector.
Parameters:
NameTypeDescription
valuestringThe value to set on the element.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the value is set.
Type: 
Promise.<void>

(async) valueById(value, id) → {Promise.<void>}

Sets the value of an element using its ID.
Parameters:
NameTypeDescription
valuestringThe value to set on the element.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the value is set.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Set

Provides functionality to set properties like innerHTML, innerText, and value on elements in a web page.

Classes

Set

Methods

(async) innerHtml(html, selector) → {Promise.<void>}

Sets the innerHTML of an element using a CSS selector.
Parameters:
NameTypeDescription
htmlstringThe HTML string to set as innerHTML.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerHTML is set.
Type: 
Promise.<void>

(async) innerHtmlById(html, id) → {Promise.<void>}

Sets the innerHTML of an element using its ID.
Parameters:
NameTypeDescription
htmlstringThe HTML string to set as innerHTML.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerHTML is set.
Type: 
Promise.<void>

(async) innerText(text, selector) → {Promise.<void>}

Sets the innerText of an element using a CSS selector.
Parameters:
NameTypeDescription
textstringThe text to set as innerText.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerText is set.
Type: 
Promise.<void>

(async) innerTextById(text, id) → {Promise.<void>}

Sets the innerText of an element using its ID.
Parameters:
NameTypeDescription
textstringThe text to set as innerText.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the innerText is set.
Type: 
Promise.<void>

(async) value(value, selector) → {Promise.<void>}

Sets the value of an element using a CSS selector.
Parameters:
NameTypeDescription
valuestringThe value to set on the element.
selectorstringThe CSS selector of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the value is set.
Type: 
Promise.<void>

(async) valueById(value, id) → {Promise.<void>}

Sets the value of an element using its ID.
Parameters:
NameTypeDescription
valuestringThe value to set on the element.
idstringThe ID of the element.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the value is set.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/SingleClick.html b/docs/documentation/sitespeed.io/scripting/SingleClick.html index d393dc0e6..0d94d2784 100644 --- a/docs/documentation/sitespeed.io/scripting/SingleClick.html +++ b/docs/documentation/sitespeed.io/scripting/SingleClick.html @@ -1,3 +1,3 @@ Class: SingleClick
On this page

SingleClick

Provides functionality to perform a single click action on elements or at specific positions in a web page. Uses Seleniums Action API.

Classes

SingleClick

Methods

(async) atCursor(optionsopt) → {Promise.<void>}

Performs a single mouse click at the current cursor position.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for the click action.
Throws:
Throws an error if the single click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the single click occurs.
Type: 
Promise.<void>

(async) atCursorAndWait() → {Promise.<void>}

Performs a single mouse click at the current cursor position and waits on the page complete check.
Throws:
Throws an error if the single click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the single click occurs.
Type: 
Promise.<void>

(async) byLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string and waits on the opage complete check.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring and waits on the page complete checl.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) bySelector(selector, optionsopt) → {Promise.<void>}

Performs a single mouse click on an element matching a given CSS selector.
Parameters:
NameTypeAttributesDescription
selectorstringThe CSS selector of the element to click.
optionsObject<optional>
Additional options for the click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>

(async) bySelectorAndWait(selector) → {Promise.<void>}

Performs a single mouse click on an element matching a given CSS selector and waits on the page complete check.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath, optionsopt) → {Promise.<void>}

Performs a single mouse click on an element matching a given XPath selector.
Parameters:
NameTypeAttributesDescription
xpathstringThe XPath selector of the element to click.
optionsObject<optional>
Additional options for the click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>

(async) byXpathAndWait(xpath) → {Promise.<void>}

Performs a single mouse click on an element matching a given XPath selector and wait for page complete check.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

SingleClick

Provides functionality to perform a single click action on elements or at specific positions in a web page. Uses Seleniums Action API.

Classes

SingleClick

Methods

(async) atCursor(optionsopt) → {Promise.<void>}

Performs a single mouse click at the current cursor position.
Parameters:
NameTypeAttributesDescription
optionsObject<optional>
Additional options for the click action.
Throws:
Throws an error if the single click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the single click occurs.
Type: 
Promise.<void>

(async) atCursorAndWait() → {Promise.<void>}

Performs a single mouse click at the current cursor position and waits on the page complete check.
Throws:
Throws an error if the single click action cannot be performed.
Type
Error
Returns:
A promise that resolves when the single click occurs.
Type: 
Promise.<void>

(async) byLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text matches the given string and waits on the opage complete check.
Parameters:
NameTypeDescription
textstringThe visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkText(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) byPartialLinkTextAndWait(text) → {Promise.<void>}

Clicks on a link whose visible text contains the given substring and waits on the page complete checl.
Parameters:
NameTypeDescription
textstringThe substring of the visible text of the link to click.
Throws:
Throws an error if the link is not found.
Type
Error
Returns:
A promise that resolves when the click action is performed.
Type: 
Promise.<void>

(async) bySelector(selector, optionsopt) → {Promise.<void>}

Performs a single mouse click on an element matching a given CSS selector.
Parameters:
NameTypeAttributesDescription
selectorstringThe CSS selector of the element to click.
optionsObject<optional>
Additional options for the click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>

(async) bySelectorAndWait(selector) → {Promise.<void>}

Performs a single mouse click on an element matching a given CSS selector and waits on the page complete check.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>

(async) byXpath(xpath, optionsopt) → {Promise.<void>}

Performs a single mouse click on an element matching a given XPath selector.
Parameters:
NameTypeAttributesDescription
xpathstringThe XPath selector of the element to click.
optionsObject<optional>
Additional options for the click action.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>

(async) byXpathAndWait(xpath) → {Promise.<void>}

Performs a single mouse click on an element matching a given XPath selector and wait for page complete check.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to click.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the single click action is performed.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/StopWatch.html b/docs/documentation/sitespeed.io/scripting/StopWatch.html index 78d10d416..6d3b542e4 100644 --- a/docs/documentation/sitespeed.io/scripting/StopWatch.html +++ b/docs/documentation/sitespeed.io/scripting/StopWatch.html @@ -1,3 +1,3 @@ Class: StopWatch
On this page

StopWatch

A stopwatch utility for measuring time intervals.

Classes

StopWatch

Methods

getName() → {string}

Gets the name of the stopwatch.
Returns:
The name of the stopwatch.
Type: 
string

start()

Starts the stopwatch.

stop() → {number}

Stops the stopwatch.
Returns:
The measured time in milliseconds.
Type: 
number

stopAndAdd() → {number}

Stops the stopwatch and automatically adds the measured time to the last measured page. Logs an error if no page has been measured.
Returns:
The measured time in milliseconds.
Type: 
number
\ No newline at end of file +
On this page

StopWatch

A stopwatch utility for measuring time intervals.

Classes

StopWatch

Methods

getName() → {string}

Gets the name of the stopwatch.
Returns:
The name of the stopwatch.
Type: 
string

start()

Starts the stopwatch.

stop() → {number}

Stops the stopwatch.
Returns:
The measured time in milliseconds.
Type: 
number

stopAndAdd() → {number}

Stops the stopwatch and automatically adds the measured time to the last measured page. Logs an error if no page has been measured.
Returns:
The measured time in milliseconds.
Type: 
number
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Switch.html b/docs/documentation/sitespeed.io/scripting/Switch.html index 2505ebd1c..1dc202043 100644 --- a/docs/documentation/sitespeed.io/scripting/Switch.html +++ b/docs/documentation/sitespeed.io/scripting/Switch.html @@ -1,3 +1,3 @@ Class: Switch
On this page

Switch

Provides functionality to switch between frames, windows, and tabs in the browser.

Classes

Switch

Methods

(async) toFrame(id)

Switches to a frame identified by its ID.
Parameters:
NameTypeDescription
idstring | numberThe ID of the frame.
Throws:
Throws an error if switching to the frame fails.
Type
Error

(async) toFrameBySelector(selector)

Switches to a frame identified by a CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the frame element.
Throws:
Throws an error if the frame is not found or switching fails.
Type
Error

(async) toFrameByXpath(xpath)

Switches to a frame identified by an XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath of the frame element.
Throws:
Throws an error if the frame is not found or switching fails.
Type
Error

(async) toNewTab(urlopt)

Opens a new tab and optionally navigates to a URL.
Parameters:
NameTypeAttributesDescription
urlstring<optional>
Optional URL to navigate to in the new tab.
Throws:
Throws an error if opening a new tab fails.
Type
Error

(async) toNewWindow(urlopt)

Opens a new window and optionally navigates to a URL.
Parameters:
NameTypeAttributesDescription
urlstring<optional>
Optional URL to navigate to in the new window.
Throws:
Throws an error if opening a new window fails.
Type
Error

(async) toParentFrame()

Switches to the parent frame of the current frame.
Throws:
Throws an error if switching to the parent frame fails.
Type
Error

(async) toWindow(name)

Switches to a window identified by its name.
Parameters:
NameTypeDescription
namestringThe name of the window.
Throws:
Throws an error if switching to the window fails.
Type
Error
\ No newline at end of file +
On this page

Switch

Provides functionality to switch between frames, windows, and tabs in the browser.

Classes

Switch

Methods

(async) toFrame(id)

Switches to a frame identified by its ID.
Parameters:
NameTypeDescription
idstring | numberThe ID of the frame.
Throws:
Throws an error if switching to the frame fails.
Type
Error

(async) toFrameBySelector(selector)

Switches to a frame identified by a CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the frame element.
Throws:
Throws an error if the frame is not found or switching fails.
Type
Error

(async) toFrameByXpath(xpath)

Switches to a frame identified by an XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath of the frame element.
Throws:
Throws an error if the frame is not found or switching fails.
Type
Error

(async) toNewTab(urlopt)

Opens a new tab and optionally navigates to a URL.
Parameters:
NameTypeAttributesDescription
urlstring<optional>
Optional URL to navigate to in the new tab.
Throws:
Throws an error if opening a new tab fails.
Type
Error

(async) toNewWindow(urlopt)

Opens a new window and optionally navigates to a URL.
Parameters:
NameTypeAttributesDescription
urlstring<optional>
Optional URL to navigate to in the new window.
Throws:
Throws an error if opening a new window fails.
Type
Error

(async) toParentFrame()

Switches to the parent frame of the current frame.
Throws:
Throws an error if switching to the parent frame fails.
Type
Error

(async) toWindow(name)

Switches to a window identified by its name.
Parameters:
NameTypeDescription
namestringThe name of the window.
Throws:
Throws an error if switching to the window fails.
Type
Error
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Wait.html b/docs/documentation/sitespeed.io/scripting/Wait.html index 5ddefd972..c5602135c 100644 --- a/docs/documentation/sitespeed.io/scripting/Wait.html +++ b/docs/documentation/sitespeed.io/scripting/Wait.html @@ -1,3 +1,3 @@ Class: Wait
On this page

Wait

Provides functionality to wait for different conditions in the browser.

Classes

Wait

Methods

(async) byCondition(jsExpression, maxTime) → {Promise.<void>}

Waits for a JavaScript condition to return a truthy value within a maximum time.
Parameters:
NameTypeDescription
jsExpressionstringThe JavaScript expression to evaluate.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the condition is not met within the specified time.
Type
Error
Returns:
A promise that resolves when the condition becomes truthy or the time times out.
Type: 
Promise.<void>

(async) byId(id, maxTime) → {Promise.<void>}

Waits for an element with a specific ID to appear within a maximum time.
Parameters:
NameTypeDescription
idstringThe ID of the element to wait for.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the element is not found within the specified time.
Type
Error
Returns:
A promise that resolves when the element is found or the time times out.
Type: 
Promise.<void>

(async) byPageToComplete() → {Promise.<void>}

Waits for the page to finish loading.
Returns:
A promise that resolves when the page complete check has finished.
Type: 
Promise.<void>
Example
async commands.wait.byPageToComplete();

(async) bySelector(selector, maxTime) → {Promise.<void>}

Waits for an element located by a CSS selector to appear within a maximum time.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to wait for.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the element is not found within the specified time.
Type
Error
Returns:
A promise that resolves when the element is found or the time times out.
Type: 
Promise.<void>

(async) byTime(ms) → {Promise.<void>}

Waits for a specified amount of time.
Parameters:
NameTypeDescription
msnumberThe time in milliseconds to wait.
Returns:
A promise that resolves when the specified time has elapsed.
Type: 
Promise.<void>
Example
async commands.wait.byTime(1000);

(async) byXpath(xpath, maxTime) → {Promise.<void>}

Waits for an element located by XPath to appear within a maximum time.
Parameters:
NameTypeDescription
xpathstringThe XPath of the element to wait for.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the element is not found within the specified time.
Type
Error
Returns:
A promise that resolves when the element is found or the time times out.
Type: 
Promise.<void>
\ No newline at end of file +
On this page

Wait

Provides functionality to wait for different conditions in the browser.

Classes

Wait

Methods

(async) byCondition(jsExpression, maxTime) → {Promise.<void>}

Waits for a JavaScript condition to return a truthy value within a maximum time.
Parameters:
NameTypeDescription
jsExpressionstringThe JavaScript expression to evaluate.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the condition is not met within the specified time.
Type
Error
Returns:
A promise that resolves when the condition becomes truthy or the time times out.
Type: 
Promise.<void>

(async) byId(id, maxTime) → {Promise.<void>}

Waits for an element with a specific ID to appear within a maximum time.
Parameters:
NameTypeDescription
idstringThe ID of the element to wait for.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the element is not found within the specified time.
Type
Error
Returns:
A promise that resolves when the element is found or the time times out.
Type: 
Promise.<void>

(async) byPageToComplete() → {Promise.<void>}

Waits for the page to finish loading.
Returns:
A promise that resolves when the page complete check has finished.
Type: 
Promise.<void>
Example
async commands.wait.byPageToComplete();

(async) bySelector(selector, maxTime) → {Promise.<void>}

Waits for an element located by a CSS selector to appear within a maximum time.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to wait for.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the element is not found within the specified time.
Type
Error
Returns:
A promise that resolves when the element is found or the time times out.
Type: 
Promise.<void>

(async) byTime(ms) → {Promise.<void>}

Waits for a specified amount of time.
Parameters:
NameTypeDescription
msnumberThe time in milliseconds to wait.
Returns:
A promise that resolves when the specified time has elapsed.
Type: 
Promise.<void>
Example
async commands.wait.byTime(1000);

(async) byXpath(xpath, maxTime) → {Promise.<void>}

Waits for an element located by XPath to appear within a maximum time.
Parameters:
NameTypeDescription
xpathstringThe XPath of the element to wait for.
maxTimenumberMaximum time to wait in milliseconds.
Throws:
Throws an error if the element is not found within the specified time.
Type
Error
Returns:
A promise that resolves when the element is found or the time times out.
Type: 
Promise.<void>
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/index.html b/docs/documentation/sitespeed.io/scripting/index.html index b9aed8df4..a1b74a952 100644 --- a/docs/documentation/sitespeed.io/scripting/index.html +++ b/docs/documentation/sitespeed.io/scripting/index.html @@ -1,3 +1,3 @@ Tutorials and documentation for scripting in Browsertime and sitespeed.io
On this page

Scripting

The user journey

Welcome to the powerful world of scripting with sitespeed.io! This feature unlocks the potential to simulate real user journeys, measure performance, and gather detailed metrics by interacting with web pages through custom scripts. Whether you're looking to analyze simple page loads or complex user interactions, our scripting functionality offers the tools you need.

Key Features

  • User Journey Simulation: Script entire user flows, from navigation to clicks and form submissions, to capture a realistic user experience.
  • Performance Metrics Collection: Gather crucial data like load times, visual metrics, and more, for each step of your user journey.
  • Flexible Scripting Language: Write scripts in NodeJS, using familiar JavaScript syntax and robust libraries.

Getting Started

Dive into scripting with our tutorials, examples, and documentation for all commands.

\ No newline at end of file +
On this page

Scripting

The user journey

Welcome to the powerful world of scripting with sitespeed.io! This feature unlocks the potential to simulate real user journeys, measure performance, and gather detailed metrics by interacting with web pages through custom scripts. Whether you're looking to analyze simple page loads or complex user interactions, our scripting functionality offers the tools you need.

Key Features

  • User Journey Simulation: Script entire user flows, from navigation to clicks and form submissions, to capture a realistic user experience.
  • Performance Metrics Collection: Gather crucial data like load times, visual metrics, and more, for each step of your user journey.
  • Flexible Scripting Language: Write scripts in NodeJS, using familiar JavaScript syntax and robust libraries.

Getting Started

Dive into scripting with our tutorials, examples, and documentation for all commands.

\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-01-Introduction.html b/docs/documentation/sitespeed.io/scripting/tutorial-01-Introduction.html index 162e11719..bf8e162a0 100644 --- a/docs/documentation/sitespeed.io/scripting/tutorial-01-Introduction.html +++ b/docs/documentation/sitespeed.io/scripting/tutorial-01-Introduction.html @@ -1,6 +1,6 @@ Tutorial: Introduction
On this page

Introduction

Scripting in sitespeed.io and Browsertime allows you to measure user journeys by interacting with web pages. This feature is essential for simulating real-user interactions and collecting performance metrics for complex workflows. Scripting works the same in both Browsertime and sitespeed.io.

Simple script

Here's a basic script example to start with:

/**
+    
On this page

Introduction

Scripting in sitespeed.io and Browsertime allows you to measure user journeys by interacting with web pages. This feature is essential for simulating real-user interactions and collecting performance metrics for complex workflows. Scripting works the same in both Browsertime and sitespeed.io.

Simple script

Here's a basic script example to start with:

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-02-Running-Scripts.html b/docs/documentation/sitespeed.io/scripting/tutorial-02-Running-Scripts.html
index e6d46ede8..f43fcc019 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-02-Running-Scripts.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-02-Running-Scripts.html
@@ -1,6 +1,6 @@
 Tutorial: Running and managing scripts
On this page

Running and managing scripts

Run scripts using Browsertime is easy. Create your script and run it like this:

browsertime myScript.mjs
+    
On this page

Running and managing scripts

Run scripts using Browsertime is easy. Create your script and run it like this:

browsertime myScript.mjs
 

And in sitespeed.io you need to add the --multi switch (test multiple pages).

sitespeed.io myScript.mjs --multi
 

Multiple scripts

For multiple scripts, list them all in the command. This approach helps manage complex scripts by splitting them into multiple files.

sitespeed.io login.mjs measureStartPage.mjs logout.mjs --multi
 

Or you can break out code in multiple files.

Create a file to include exampleInclude.mjs

export async function example() {
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-03-Measurement-Commands.html b/docs/documentation/sitespeed.io/scripting/tutorial-03-Measurement-Commands.html
index 676bb86a2..2ac759d97 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-03-Measurement-Commands.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-03-Measurement-Commands.html
@@ -1,6 +1,6 @@
 Tutorial: Measure
On this page

Measure

In sitespeed.io, measurements can be conducted using a meassure command for page navigation performance, gathering various metrics during page load. Alternatively, the StopWatch command is used for measuring arbitrary durations, such as the time taken for certain actions to complete. When you create your script you need to know what you want to measure.

The measure Command

In web performance, "navigation" means switching from one webpage to another. This switch triggers several steps in your browser, like closing the current page, loading new content, and showing the new page fully loaded. In sitespeed.io, the commands.measure function is used to analyze this process. It tracks various performance details from the moment you start moving to a new page until it's completely loaded. This includes how long the page takes to load, how fast resources (like images and scripts) are loaded, and more, giving you a full picture of the navigation's performance.

Use the measure command for measuring page navigation performance. It captures metrics from the start to the end of a page load.

/**
+    
On this page

Measure

In sitespeed.io, measurements can be conducted using a meassure command for page navigation performance, gathering various metrics during page load. Alternatively, the StopWatch command is used for measuring arbitrary durations, such as the time taken for certain actions to complete. When you create your script you need to know what you want to measure.

The measure Command

In web performance, "navigation" means switching from one webpage to another. This switch triggers several steps in your browser, like closing the current page, loading new content, and showing the new page fully loaded. In sitespeed.io, the commands.measure function is used to analyze this process. It tracks various performance details from the moment you start moving to a new page until it's completely loaded. This includes how long the page takes to load, how fast resources (like images and scripts) are loaded, and more, giving you a full picture of the navigation's performance.

Use the measure command for measuring page navigation performance. It captures metrics from the start to the end of a page load.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-04-Interact-with-the-page.html b/docs/documentation/sitespeed.io/scripting/tutorial-04-Interact-with-the-page.html
index c7f40723e..7f7772d08 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-04-Interact-with-the-page.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-04-Interact-with-the-page.html
@@ -1,6 +1,6 @@
 Tutorial: Interact with the page
On this page

Interact with the page

There are multiple ways to interact with the current page. We have tried to add the most common ways so you don't need to use Selenium directly, and if yoiu think something is missing, please create an issue.

Finding elements

One of the key things in your script is to be able to find the right element to invoke. If the element has an id it’s easy. If not you can use developer tools in your favourite browser. The all work mostly the same: Open DevTools in the page you want to inspect, click on the element and right click on DevTools for that element. Then you will see something like this:

Using Safari to find the CSS Selector to the element

Using Safari to find the selector

Using Firefox to find the CSS Selector to the element

Using Firefox to find the selector{

Using Chrome to find the CSS Selector to the element

Using Chrome to find the selector

Using Actions

Since Browsertime 21.0.0 we support easier access to the Selenium Action API. That makes easier to interact with the page and you can also chain commands. You can checkout the Selenium NodeJS Action API to see more what you can do.

Here's an example doing search on Wikipedia:

/**
+    
On this page

Interact with the page

There are multiple ways to interact with the current page. We have tried to add the most common ways so you don't need to use Selenium directly, and if yoiu think something is missing, please create an issue.

Finding elements

One of the key things in your script is to be able to find the right element to invoke. If the element has an id it’s easy. If not you can use developer tools in your favourite browser. The all work mostly the same: Open DevTools in the page you want to inspect, click on the element and right click on DevTools for that element. Then you will see something like this:

Using Safari to find the CSS Selector to the element

Using Safari to find the selector

Using Firefox to find the CSS Selector to the element

Using Firefox to find the selector{

Using Chrome to find the CSS Selector to the element

Using Chrome to find the selector

Using Actions

Since Browsertime 21.0.0 we support easier access to the Selenium Action API. That makes easier to interact with the page and you can also chain commands. You can checkout the Selenium NodeJS Action API to see more what you can do.

Here's an example doing search on Wikipedia:

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-05-Interact-Browser.html b/docs/documentation/sitespeed.io/scripting/tutorial-05-Interact-Browser.html
index 4a7aed758..ba2030b5f 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-05-Interact-Browser.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-05-Interact-Browser.html
@@ -1,6 +1,6 @@
 Tutorial: Interact with the browser
On this page

Interact with the browser

You can navigate to a URL without measuring it. You do it with the navigate function. Navigation will use the same logic as measuring, it will wait for the page complete check to finish.

/**
+    
On this page

Interact with the browser

You can navigate to a URL without measuring it. You do it with the navigate function. Navigation will use the same logic as measuring, it will wait for the page complete check to finish.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-06-Error-handling.html b/docs/documentation/sitespeed.io/scripting/tutorial-06-Error-handling.html
index 24c344504..f99d0eb6d 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-06-Error-handling.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-06-Error-handling.html
@@ -1,6 +1,6 @@
 Tutorial: Error handling
On this page

Error handling

You can try/catch failing commands that throw errors. If an error is not caught in your script, it will be caught in sitespeed.io and the error will be logged and reported in the HTML and to your data storage (Graphite/InfluxDb) under the key browsertime.statistics.errors.

If you do catch the error, you should make sure you report it yourself with the error function, so you can see that in the HTML. This is needed for all errors except navigating/measuring a URL. They will automatically be reported (since they are always important).

Here's an example of catching a URL that don't work and still continue to test another one. Remember since a navigation fails, this will be reported automatically and you don't need to do anything.

/**
+    
On this page

Error handling

You can try/catch failing commands that throw errors. If an error is not caught in your script, it will be caught in sitespeed.io and the error will be logged and reported in the HTML and to your data storage (Graphite/InfluxDb) under the key browsertime.statistics.errors.

If you do catch the error, you should make sure you report it yourself with the error function, so you can see that in the HTML. This is needed for all errors except navigating/measuring a URL. They will automatically be reported (since they are always important).

Here's an example of catching a URL that don't work and still continue to test another one. Remember since a navigation fails, this will be reported automatically and you don't need to do anything.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-07-Debugging-Scripts.html b/docs/documentation/sitespeed.io/scripting/tutorial-07-Debugging-Scripts.html
index c24c35ba1..bf7865f43 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-07-Debugging-Scripts.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-07-Debugging-Scripts.html
@@ -1,6 +1,6 @@
 Tutorial: Debugging scripts
On this page

Debugging scripts

There are a couple of ways of debugging your scripts.

Use the log

The easist way know what's going on is log to the browsertime/sitespeed.io log. You can do that with log object that exist in the context object.

/**
+    
On this page

Debugging scripts

There are a couple of ways of debugging your scripts.

Use the log

The easist way know what's going on is log to the browsertime/sitespeed.io log. You can do that with log object that exist in the context object.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-08-Setting-Up-IntelliSense.html b/docs/documentation/sitespeed.io/scripting/tutorial-08-Setting-Up-IntelliSense.html
index 08c8692d6..03cb6cd9d 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-08-Setting-Up-IntelliSense.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-08-Setting-Up-IntelliSense.html
@@ -1,6 +1,6 @@
 Tutorial: Code completion and IntelliSense
On this page

Code completion and IntelliSense

IntelliSense in Visual Studio Code can significantly enhance your scripting experience with Browsertime by providing code completions, parameter info, quick info, and member lists. Here's how to set it up:

Install Browsertime

First, ensure that the Browsertime types are installed in your project. If they're not included by default, you can install them via npm:

   npm install browsertime --save-dev
+    
On this page

Code completion and IntelliSense

IntelliSense in Visual Studio Code can significantly enhance your scripting experience with Browsertime by providing code completions, parameter info, quick info, and member lists. Here's how to set it up:

Install Browsertime

First, ensure that the Browsertime types are installed in your project. If they're not included by default, you can install them via npm:

   npm install browsertime --save-dev
 

Reload Visual Studio Code

After these changes, reload Visual Studio Code to ensure that the settings are applied.

Write Your Script

Now, when you write your Browsertime script, IntelliSense should automatically suggest relevant Browsertime methods and properties when you add the param comments as in this example.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-09-Examples.html b/docs/documentation/sitespeed.io/scripting/tutorial-09-Examples.html
index 103d22584..d23e6ba6c 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-09-Examples.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-09-Examples.html
@@ -1,6 +1,6 @@
 Tutorial: Examples
On this page

Examples

Here are some examples on how you can use the scripting capabilities.

Measure multiple pages

Test multiple pages in a script:

/**
+    
On this page

Examples

Here are some examples on how you can use the scripting capabilities.

Measure multiple pages

Test multiple pages in a script:

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-10-Selenium.html b/docs/documentation/sitespeed.io/scripting/tutorial-10-Selenium.html
index ab5da4b8c..a3ef280d2 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-10-Selenium.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-10-Selenium.html
@@ -1,6 +1,6 @@
 Tutorial: Running Selenium code
On this page

Running Selenium code

You can use Selenium directly if you need to use things that are not available through our commands. We use the NodeJS flavor of Selenium.

You get a hold of the Selenium objects through the context object.

The selenium.webdriver is the Selenium WebDriver public API object. And selenium.driver is the instantiated version of the WebDriver driving the current version of the browser.

Checkout this example to see how you can use them.

/**
+    
On this page

Running Selenium code

You can use Selenium directly if you need to use things that are not available through our commands. We use the NodeJS flavor of Selenium.

You get a hold of the Selenium objects through the context object.

The selenium.webdriver is the Selenium WebDriver public API object. And selenium.driver is the instantiated version of the WebDriver driving the current version of the browser.

Checkout this example to see how you can use them.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-11-Chrome-Devtools-Protocol.html b/docs/documentation/sitespeed.io/scripting/tutorial-11-Chrome-Devtools-Protocol.html
index 2ffff1c4a..e8b9ab259 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-11-Chrome-Devtools-Protocol.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-11-Chrome-Devtools-Protocol.html
@@ -1,6 +1,6 @@
 Tutorial: Chrome Devtools Protocol (CDP)
On this page

Chrome Devtools Protocol (CDP)

Send messages to Chrome using the Chrome DevTools Protocol. This only works in Chrome/Edge. You can send, send and get and listen on events. This is a super powerful feature that enables you to do almost whatever you want with the browser.

Sending a command

Send a command to Chrome and don’t expect something back.

Here’s an example of injecting JavaScript that runs on every new document.

/**
+    
On this page

Chrome Devtools Protocol (CDP)

Send messages to Chrome using the Chrome DevTools Protocol. This only works in Chrome/Edge. You can send, send and get and listen on events. This is a super powerful feature that enables you to do almost whatever you want with the browser.

Sending a command

Send a command to Chrome and don’t expect something back.

Here’s an example of injecting JavaScript that runs on every new document.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-12-Android.html b/docs/documentation/sitespeed.io/scripting/tutorial-12-Android.html
index acb2bc3cf..fdac407d4 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-12-Android.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-12-Android.html
@@ -1,6 +1,6 @@
 Tutorial: Android devices
On this page

Android devices

Testing on an Android device should work the same way as testing on desktop, as long as you setup your device following the instructions.

Run shell command

If you run your tests on an Android phone you can interact with your phone through the shell.

/**
+    
On this page

Android devices

Testing on an Android device should work the same way as testing on desktop, as long as you setup your device following the instructions.

Run shell command

If you run your tests on an Android phone you can interact with your phone through the shell.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-13-Tips-and-tricks.html b/docs/documentation/sitespeed.io/scripting/tutorial-13-Tips-and-tricks.html
index a1e5be5f6..4b156fa42 100644
--- a/docs/documentation/sitespeed.io/scripting/tutorial-13-Tips-and-tricks.html
+++ b/docs/documentation/sitespeed.io/scripting/tutorial-13-Tips-and-tricks.html
@@ -1,6 +1,6 @@
 Tutorial: Tips and tricks
On this page

Tips and tricks

Here are some tips and tricks that can make your scripting better.

Include the script in the HTML result

If you wanna keep of what script you are running, you can include the script into the HTML result with --html.showScript. You will then get a link to a page that show the script.

Page to page

Getting correct Visual Metrics

Visual metrics is the metrics that are collected using the video recording of the screen. In most cases that will work just out of the box. One thing to know is that when you go from one page to another page, the browser keeps the layout of the old page. That means that your video will start with the first page (instead of white) when you navigate to the next page.

It will look like this: Page to page

This is perfectly fine in most cases. But if you want to start white (the metrics somehow isn't correct) or if you click a link and that click changes the layout and is caught as First Visual Change, there are workarounds.

If you just want to start white and navigate to the next page you can just clear the HTML between pages:

/**
+    
On this page

Tips and tricks

Here are some tips and tricks that can make your scripting better.

Include the script in the HTML result

If you wanna keep of what script you are running, you can include the script into the HTML result with --html.showScript. You will then get a link to a page that show the script.

Page to page

Getting correct Visual Metrics

Visual metrics is the metrics that are collected using the video recording of the screen. In most cases that will work just out of the box. One thing to know is that when you go from one page to another page, the browser keeps the layout of the old page. That means that your video will start with the first page (instead of white) when you navigate to the next page.

It will look like this: Page to page

This is perfectly fine in most cases. But if you want to start white (the metrics somehow isn't correct) or if you click a link and that click changes the layout and is caught as First Visual Change, there are workarounds.

If you just want to start white and navigate to the next page you can just clear the HTML between pages:

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */