From 7f852bdf2dd122bd707c4174a6f8f45fda30f264 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Tue, 12 Mar 2024 13:18:24 +0100 Subject: [PATCH] Update documentation and new Browsertime --- docs/_includes/version/browsertime.txt | 2 +- docs/documentation/browsertime/configuration/config.md | 2 +- docs/documentation/sitespeed.io/scripting/Actions.html | 4 ++-- docs/documentation/sitespeed.io/scripting/AddText.html | 2 +- .../sitespeed.io/scripting/AndroidCommand.html | 2 +- docs/documentation/sitespeed.io/scripting/Bidi.html | 3 +++ docs/documentation/sitespeed.io/scripting/Cache.html | 2 +- .../scripting/ChromeDevelopmentToolsProtocol.html | 2 +- .../documentation/sitespeed.io/scripting/ChromeTrace.html | 2 +- docs/documentation/sitespeed.io/scripting/Click.html | 2 +- .../sitespeed.io/scripting/ClickAndHold.html | 2 +- docs/documentation/sitespeed.io/scripting/Commands.html | 2 +- .../sitespeed.io/scripting/ContextClick.html | 2 +- docs/documentation/sitespeed.io/scripting/Debug.html | 2 +- .../documentation/sitespeed.io/scripting/DoubleClick.html | 2 +- docs/documentation/sitespeed.io/scripting/Element.html | 2 +- .../sitespeed.io/scripting/GeckoProfiler.html | 2 +- docs/documentation/sitespeed.io/scripting/JavaScript.html | 2 +- docs/documentation/sitespeed.io/scripting/Measure.html | 4 ++-- 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 +- .../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 +- .../documentation/sitespeed.io/scripting/data/search.json | 2 +- docs/documentation/sitespeed.io/scripting/index.html | 2 +- .../sitespeed.io/scripting/tutorial-01-Introduction.html | 4 ++-- .../scripting/tutorial-02-Running-Scripts.html | 4 ++-- .../scripting/tutorial-03-Measurement-Commands.html | 4 ++-- .../scripting/tutorial-04-Interact-with-the-page.html | 4 ++-- .../scripting/tutorial-05-Interact-Browser.html | 4 ++-- .../scripting/tutorial-06-Error-handling.html | 4 ++-- .../scripting/tutorial-07-Debugging-Scripts.html | 4 ++-- .../scripting/tutorial-08-Setting-Up-IntelliSense.html | 4 ++-- .../sitespeed.io/scripting/tutorial-09-Examples.html | 4 ++-- .../sitespeed.io/scripting/tutorial-10-Selenium.html | 8 ++++---- .../scripting/tutorial-11-Chrome-Devtools-Protocol.html | 4 ++-- .../sitespeed.io/scripting/tutorial-12-Android.html | 4 ++-- .../scripting/tutorial-13-Tips-and-tricks.html | 4 ++-- 45 files changed, 64 insertions(+), 61 deletions(-) create mode 100644 docs/documentation/sitespeed.io/scripting/Bidi.html diff --git a/docs/_includes/version/browsertime.txt b/docs/_includes/version/browsertime.txt index 8ab91f750..7dc3e9905 100644 --- a/docs/_includes/version/browsertime.txt +++ b/docs/_includes/version/browsertime.txt @@ -1 +1 @@ -21.5.0 \ No newline at end of file +21.5.1 \ No newline at end of file diff --git a/docs/documentation/browsertime/configuration/config.md b/docs/documentation/browsertime/configuration/config.md index 8a082dbd9..6c84cdb57 100644 --- a/docs/documentation/browsertime/configuration/config.md +++ b/docs/documentation/browsertime/configuration/config.md @@ -186,7 +186,7 @@ Options: --delay Delay between runs, in milliseconds [number] [default: 0] -r, --requestheader Request header that will be added to the request. Add multiple instances to add multiple request headers. Works for Firefox and Chrome. Use the following format key:value --cookie Cookie that will be added to the request. Add multiple instances to add multiple request cookies. Works for Firefox and Chrome. Use the following format cookieName=cookieValue - --injectJs Inject JavaScript into the current page at document_start. Works for Firefox and Chrome. More info: https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/contentScripts + --injectJs Inject JavaScript into the current page at document_start. Works for Firefox, Chrome and Edge. When injecting to Firefox make sure to wrap the code in a function! --block Domain to block or URL or URL pattern to block. If you use Chrome you can also use --blockDomainsExcept (that is more performant). Works in Chrome/Edge. For Firefox you can only block domains. --percentiles The percentile values within the data browsertime will calculate and report. This argument uses Yargs arrays and you you to set them correctly it is recommended to use a configuraration file instead. [array] [default: [0,10,90,99,100]] --decimals The decimal points browsertime statistics round to. [number] [default: 0] diff --git a/docs/documentation/sitespeed.io/scripting/Actions.html b/docs/documentation/sitespeed.io/scripting/Actions.html index c03efa698..a78800c56 100644 --- a/docs/documentation/sitespeed.io/scripting/Actions.html +++ b/docs/documentation/sitespeed.io/scripting/Actions.html @@ -1,8 +1,8 @@ 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()
   .dragAndDrop(elementToDrag, dropTarget)
-  .perform();
\ No newline at end of file + .perform();
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/AddText.html b/docs/documentation/sitespeed.io/scripting/AddText.html index 6900822e0..03d04046f 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 07ae20902..1b7ecc3cf 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/Bidi.html b/docs/documentation/sitespeed.io/scripting/Bidi.html new file mode 100644 index 000000000..baead1d0a --- /dev/null +++ b/docs/documentation/sitespeed.io/scripting/Bidi.html @@ -0,0 +1,3 @@ +Class: Bidi
On this page

Bidi

Manages interactions using Bidi. At the moment this only works for Firefox but Chrome and maybe other browsers will support it in the future.

Classes

Bidi

Methods

(async) getRawClient() → {Promise.<Object>}

Retrieves the raw client for Bidi.
Throws:
Throws an error if the browser is not supported.
Type
Error
Returns:
A promise that resolves to the Bidi client.
Type: 
Promise.<Object>
Example
const bidi = await commands.bidi.getRawClient();

(async) onMessage(f)

Add a fanction that will get the events that you subscribes.
Parameters:
NameTypeDescription
ffunctionThe callback function to handle incoming messages. The function will get an event passed on to it. Remember to subscribe to the event.
Throws:
Throws an error if the method is called in a browser other than Firefox.
Type
Error

(async) send(parameters) → {Promise.<Object>}

Sends a command using Bidi.
Parameters:
NameTypeDescription
parametersObjectThe paramaters 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.<Object>
Example
await commands.bidi.send({});

(async) subscribe(messageType) → {Promise.<Object>}

Subscribe to a event.
Parameters:
NameTypeDescription
messageTypestringThe type of message to subscribe to.
Throws:
Throws an error if the method is called in a browser other than Firefox.
Type
Error
Returns:
A promise that resolves you have subscribed.
Type: 
Promise.<Object>

(async) unsubscribe(messageType) → {Promise.<Object>}

Unsubscribe to an event.
Parameters:
NameTypeDescription
messageTypestringThe type of message to unsubscribe to.
Throws:
Throws an error if the method is called in a browser other than Firefox.
Type
Error
Returns:
A promise that resolves you have unsubscribed.
Type: 
Promise.<Object>
\ 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 313e16652..516157d77 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 546fa0645..205469a4b 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 f71ee2cb5..e1aec1cff 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 c06465cda..a08dbdba4 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 9cc571dc4..063bc5302 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 261a734e7..255498aa5 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.

bidi :Bidi

Use WebDriver Bidi. Availible in Firefox and in the future more browsers.
Type:

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 96db07e61..1b0262496 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 e7a3ffd2c..36a140d97 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 a11fcddc5..6b9f7bb3f 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 786743d85..5de1ca1c0 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 8ed16e12f..0b046887e 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 b2a6dc385..c993af186 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 2ad305df3..78ae8c9b7 100644 --- a/docs/documentation/sitespeed.io/scripting/Measure.html +++ b/docs/documentation/sitespeed.io/scripting/Measure.html @@ -1,8 +1,8 @@ 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');
 // Remember to stop the measurements if you do not provide a URL
-await commands.measure.stop();

(async) stop(testedStartUrl) → {Promise}

Stops the measurement process, collects metrics, and handles any post-measurement tasks. It finalizes the URL being tested, manages any URL-specific metadata, stops any ongoing video recordings, and initiates the data collection process.
Parameters:
NameTypeDescription
testedStartUrlstringThe URL that was initially tested. If not provided, it will be obtained from the browser.
Throws:
Throws an error if there are issues in stopping the measurement or collecting data.
Type
Error
Returns:
A promise that resolves with the collected metrics data.
Type: 
Promise

(async) stopAsError(errorMessage, optionalURL) → {Promise}

Stop the current measurement and mark it as a failure. This stop function will not measure anything on a page. This is useful if you need to stop a measurement in a (try) catch and you know something has failed.
Parameters:
NameTypeDescription
errorMessagestringThe message about the error. This will end up on the HTML report for sitespeed.io so give it a good message so you know what's gone wrong.
optionalURLstringThe URL of the page that you wanted to test. If you don't know the URL (you clicked on a link etc) skip it.
Since
  • 21.2.0
Returns:
A promise that resolves when the stop process has completed.
Type: 
Promise
\ No newline at end of file +await commands.measure.stop();

(async) stop(testedStartUrl) → {Promise}

Stops the measurement process, collects metrics, and handles any post-measurement tasks. It finalizes the URL being tested, manages any URL-specific metadata, stops any ongoing video recordings, and initiates the data collection process.
Parameters:
NameTypeDescription
testedStartUrlstringThe URL that was initially tested. If not provided, it will be obtained from the browser.
Throws:
Throws an error if there are issues in stopping the measurement or collecting data.
Type
Error
Returns:
A promise that resolves with the collected metrics data.
Type: 
Promise

(async) stopAsError(errorMessage, optionalURL) → {Promise}

Stop the current measurement and mark it as a failure. This stop function will not measure anything on a page. This is useful if you need to stop a measurement in a (try) catch and you know something has failed.
Parameters:
NameTypeDescription
errorMessagestringThe message about the error. This will end up on the HTML report for sitespeed.io so give it a good message so you know what's gone wrong.
optionalURLstringThe URL of the page that you wanted to test. If you don't know the URL (you clicked on a link etc) skip it.
Since
  • 21.2.0
Returns:
A promise that resolves when the stop process has completed.
Type: 
Promise
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/Meta.html b/docs/documentation/sitespeed.io/scripting/Meta.html index 48a31d88d..4ac6bf04d 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 e3e0b4c80..9fa911a3a 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 a9107e8a2..11b1b8ade 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 6929d3a74..bdd17f1c8 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 cb17a8b57..38d5b4750 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 2aeb0b3b5..b926dfc01 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 c3e160906..f7e3fa88e 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 0d94d2784..7778db916 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 6d3b542e4..9f44d9994 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 1dc202043..299943db5 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 c5602135c..6243f71d9 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/data/search.json b/docs/documentation/sitespeed.io/scripting/data/search.json index d52303e83..914f060de 100644 --- a/docs/documentation/sitespeed.io/scripting/data/search.json +++ b/docs/documentation/sitespeed.io/scripting/data/search.json @@ -1 +1 @@ -{"list":[{"title":"Actions","link":"Actions"},{"title":"Actions#getActions","link":"getActions","description":"Retrieves the current action sequence builder.\nThe actions builder can be used to chain multiple browser actions."},{"title":"AddText","link":"AddText"},{"title":"AddText#byClassName","link":"byClassName","description":"Adds text to an element identified by its class name."},{"title":"AddText#byId","link":"byId","description":"Adds text to an element identified by its ID."},{"title":"AddText#byName","link":"byName","description":"Adds text to an element identified by its name attribute."},{"title":"AddText#bySelector","link":"bySelector","description":"Adds text to an element identified by its CSS selector."},{"title":"AddText#byXpath","link":"byXpath","description":"Adds text to an element identified by its XPath."},{"title":"AndroidCommand","link":"AndroidCommand"},{"title":"AndroidCommand#shell","link":"shell","description":"Runs a shell command on the connected Android device.\nThis method requires the Android device to be properly configured."},{"title":"AndroidCommand#shellAsRoot","link":"shellAsRoot","description":"Runs a shell command on the connected Android device as the root user.\nThis method requires the Android device to be properly configured and that you\nrooted the device."},{"title":"Cache","link":"Cache"},{"title":"Cache#clear","link":"clear","description":"Clears the browser cache. This includes both cache and cookies.\n\nFor Firefox, it uses the extensionServer setup with specific options.\nFor Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) commands.\nIf the browser is not supported, logs an error message."},{"title":"Cache#clearKeepCookies","link":"clearKeepCookies","description":"Clears the browser cache while keeping the cookies.\n\nFor Firefox, it uses the extensionServer setup with specific options.\nFor Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) command to clear the cache.\nIf the browser is not supported, logs an error message."},{"title":"ChromeDevelopmentToolsProtocol","link":"ChromeDevelopmentToolsProtocol"},{"title":"ChromeDevelopmentToolsProtocol#getRawClient","link":"getRawClient","description":"Retrieves the raw client for the DevTools Protocol."},{"title":"ChromeDevelopmentToolsProtocol#on","link":"on","description":"Sets up an event listener for a specific DevTools Protocol event."},{"title":"ChromeDevelopmentToolsProtocol#send","link":"send","description":"Sends a command to the DevTools Protocol."},{"title":"ChromeDevelopmentToolsProtocol#sendAndGet","link":"sendAndGet","description":"Sends a command to the DevTools Protocol and returns the result."},{"title":"ChromeTrace","link":"ChromeTrace"},{"title":"ChromeTrace#start","link":"start","description":"Starts the Chrome trace collection."},{"title":"ChromeTrace#stop","link":"stop","description":"Stops the Chrome trace collection, processes the collected data, and attaches it to the result object."},{"title":"Click","link":"Click"},{"title":"Click#byClassName","link":"byClassName","description":"Clicks on an element identified by its class name."},{"title":"Click#byClassNameAndWait","link":"byClassNameAndWait","description":"Clicks on an element identified by its class name and waits for the page complete check to finish."},{"title":"Click#byId","link":"byId","description":"Clicks on an element located by its ID."},{"title":"Click#byIdAndWait","link":"byIdAndWait","description":"Click on link located by the ID attribute. Uses document.getElementById() to find the element. And wait for page complete check to finish."},{"title":"Click#byJs","link":"byJs","description":"Clicks on an element located by evaluating a JavaScript expression."},{"title":"Click#byJsAndWait","link":"byJsAndWait","description":"Clicks on an element located by evaluating a JavaScript expression and waits for the page complete check to finish."},{"title":"Click#byLinkText","link":"byLinkText","description":"Clicks on a link whose visible text matches the given string."},{"title":"Click#byLinkTextAndWait","link":"byLinkTextAndWait","description":"Clicks on a link whose visible text matches the given string and waits for the page complete check to finish."},{"title":"Click#byName","link":"byName","description":"Clicks on an element located by its name attribute."},{"title":"Click#byPartialLinkText","link":"byPartialLinkText","description":"Clicks on a link whose visible text contains the given substring."},{"title":"Click#byPartialLinkTextAndWait","link":"byPartialLinkTextAndWait","description":"Clicks on a link whose visible text contains the given substring and waits for the page complete check to finish."},{"title":"Click#bySelector","link":"bySelector","description":"Clicks on an element located by its CSS selector."},{"title":"Click#bySelectorAndWait","link":"bySelectorAndWait","description":"Clicks on an element located by its CSS selector and waits for the page complete check to finish."},{"title":"Click#byXpath","link":"byXpath","description":"Clicks on an element that matches a given XPath selector."},{"title":"Click#byXpathAndWait","link":"byXpathAndWait","description":"Clicks on an element that matches a given XPath selector and waits for the page complete check to finish."},{"title":"ClickAndHold","link":"ClickAndHold"},{"title":"ClickAndHold#atCursor","link":"atCursor","description":"Clicks and holds at the current cursor position."},{"title":"ClickAndHold#atPosition","link":"atPosition","description":"Clicks and holds at the specified screen coordinates."},{"title":"ClickAndHold#bySelector","link":"bySelector","description":"Clicks and holds on an element that matches a given CSS selector."},{"title":"ClickAndHold#byXpath","link":"byXpath","description":"Clicks and holds on an element that matches a given XPath selector."},{"title":"ClickAndHold#releaseAtPosition","link":"releaseAtPosition","description":"Releases the mouse button at the specified screen coordinates."},{"title":"ClickAndHold#releaseAtSelector","link":"releaseAtSelector","description":"Releases the mouse button on an element matching the specified CSS selector."},{"title":"ClickAndHold#releaseAtXpath","link":"releaseAtXpath","description":"Releases the mouse button on an element matching the specified XPath."},{"title":"Commands","link":"Commands"},{"title":"Commands#action","link":"action","description":"Selenium's action sequence functionality."},{"title":"Commands#addText","link":"addText","description":"Provides functionality to add text to elements on a web page using various selectors."},{"title":"Commands#android","link":"android","description":"Provides commands for interacting with an Android device."},{"title":"Commands#cache","link":"cache","description":"Manages the browser's cache."},{"title":"Commands#cdp","link":"cdp","description":"Use the Chrome DevTools Protocol, available in Chrome and Edge."},{"title":"Commands#click","link":"click","description":"Provides functionality to perform click actions on elements in a web page using various selectors."},{"title":"Commands#debug","link":"debug","description":"Provides debugging capabilities within a browser automation script.\nIt allows setting breakpoints to pause script execution and inspect the current state."},{"title":"Commands#element","link":"element","description":"Get Selenium's WebElements."},{"title":"Commands#error","link":"error","description":"Add a text that will be an error attached to the current page."},{"title":"Commands#js","link":"js","description":"Executes JavaScript in the browser context."},{"title":"Commands#markAsFailure","link":"markAsFailure","description":"Mark this run as an failure. Add a message that explains the failure."},{"title":"Commands#measure","link":"measure","description":"Provides functionality for measuring a navigation."},{"title":"Commands#meta","link":"meta","description":"Adds metadata to the user journey."},{"title":"Commands#mouse","link":"mouse","description":"Interact with the page using the mouse."},{"title":"Commands#mouse.clickAndHold","link":"clickAndHold","description":"Provides functionality to click and hold elements on a web page using different strategies."},{"title":"Commands#mouse.contextClick","link":"contextClick","description":"Perform a context click (right-click) on elements in a web page."},{"title":"Commands#mouse.doubleClick","link":"doubleClick","description":"Provides functionality to perform a double-click action on elements in a web page."},{"title":"Commands#mouse.moveTo","link":"moveTo","description":"Move the mouse cursor to elements or specific positions on a web page."},{"title":"Commands#mouse.singleClick","link":"singleClick","description":"Provides functionality to perform a single click action on elements or at specific positions in a web page."},{"title":"Commands#navigate","link":"navigate","description":"Navigates to a specified URL and handles additional setup for a page visit."},{"title":"Commands#navigation","link":"navigation","description":"Provides functionality to control browser navigation such as back, forward, and refresh actions."},{"title":"Commands#screenshot","link":"screenshot","description":"Takes and manages screenshots."},{"title":"Commands#scroll","link":"scroll","description":"Provides functionality to control page scrolling in the browser."},{"title":"Commands#select","link":"select","description":"Interact with a select element."},{"title":"Commands#set","link":"set","description":"Sets values on HTML elements in the page."},{"title":"Commands#stopWatch","link":"stopWatch","description":"Stopwatch utility for measuring time intervals."},{"title":"Commands#switch","link":"switch","description":"Switches context to different frames, windows, or tabs in the browser."},{"title":"Commands#trace","link":"trace","description":"Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome."},{"title":"Commands#wait","link":"wait","description":"Provides functionality to wait for different conditions in the browser."},{"title":"ContextClick","link":"ContextClick"},{"title":"ContextClick#atCursor","link":"atCursor","description":"Performs a context click (right-click) at the current cursor position."},{"title":"ContextClick#bySelector","link":"bySelector","description":"Performs a context click (right-click) on an element that matches a given CSS selector."},{"title":"ContextClick#byXpath","link":"byXpath","description":"Performs a context click (right-click) on an element that matches a given XPath selector."},{"title":"Debug","link":"Debug"},{"title":"Debug#breakpoint","link":"breakpoint","description":"Adds a breakpoint to the script. The browser will pause at the breakpoint, waiting for user input to continue.\nThis is useful for debugging and inspecting the browser state at a specific point in the script."},{"title":"DoubleClick","link":"DoubleClick"},{"title":"DoubleClick#atCursor","link":"atCursor","description":"Performs a mouse double-click at the current cursor position."},{"title":"DoubleClick#bySelector","link":"bySelector","description":"Performs a mouse double-click on an element matching a given CSS selector."},{"title":"DoubleClick#byXpath","link":"byXpath","description":"Performs a mouse double-click on an element matching a given XPath selector."},{"title":"Element","link":"Element"},{"title":"Element#getByClassName","link":"getByClassName","description":"Finds an element by its class name."},{"title":"Element#getByCss","link":"getByCss","description":"Finds an element by its CSS selector."},{"title":"Element#getById","link":"getById","description":"Finds an element by its ID."},{"title":"Element#getByName","link":"getByName","description":"Finds an element by its name attribute."},{"title":"Element#getByXpath","link":"getByXpath","description":"Finds an element by its XPath."},{"title":"GeckoProfiler","link":"GeckoProfiler"},{"title":"GeckoProfiler#start","link":"start","description":"Starts the Gecko Profiler."},{"title":"GeckoProfiler#stop","link":"stop","description":"Stops the Gecko Profiler and processes the collected data."},{"title":"JavaScript","link":"JavaScript"},{"title":"JavaScript#run","link":"run","description":"Executes a JavaScript script."},{"title":"JavaScript#runAndWait","link":"runAndWait","description":"Executes a JavaScript script and waits for the page complete check to finish."},{"title":"JavaScript#runPrivileged","link":"runPrivileged","description":"Executes synchronous privileged JavaScript."},{"title":"JavaScript#runPrivilegedAndWait","link":"runPrivilegedAndWait","description":"Executes synchronous privileged JavaScript and waits for the page complete check to finish."},{"title":"JavaScript#runPrivilegedAsync","link":"runPrivilegedAsync","description":"Executes asynchronous privileged JavaScript."},{"title":"Measure","link":"Measure"},{"title":"Measure#add","link":"add","description":"Adds a custom metric to the current measurement result.\nThis method should be called after a measurement has started and before it has stopped."},{"title":"Measure#addObject","link":"addObject","description":"Adds multiple custom metrics to the current measurement result.\nThis method accepts an object containing multiple key-value pairs representing different metrics.\nSimilar to `add`, it should be used within an active measurement cycle."},{"title":"Measure#start","link":"start","description":"Starts the measurement process for a given URL or an alias.\n\nIt supports starting measurements by either directly providing a URL or using an alias.\nIf a URL is provided, it navigates to that URL and performs the measurement.\nIf an alias is provided, or no URL is available, it sets up the environment for a user-driven navigation."},{"title":"Measure#stop","link":"stop","description":"Stops the measurement process, collects metrics, and handles any post-measurement tasks.\nIt finalizes the URL being tested, manages any URL-specific metadata, stops any ongoing video recordings,\nand initiates the data collection process."},{"title":"Measure#stopAsError","link":"stopAsError","description":"Stop the current measurement and mark it as a failure. This stop function will not measure anything on a page. This is useful if you need to stop a measurement in a (try) catch and you\nknow something has failed."},{"title":"Meta","link":"Meta"},{"title":"Meta#setDescription","link":"setDescription","description":"Sets the description for the user journey."},{"title":"Meta#setTitle","link":"setTitle","description":"Sets the title for the user journey."},{"title":"MouseMove","link":"MouseMove"},{"title":"MouseMove#byOffset","link":"byOffset","description":"Moves the mouse cursor by an offset from its current position."},{"title":"MouseMove#bySelector","link":"bySelector","description":"Moves the mouse cursor to an element that matches a given CSS selector."},{"title":"MouseMove#byXpath","link":"byXpath","description":"Moves the mouse cursor to an element that matches a given XPath selector."},{"title":"MouseMove#toPosition","link":"toPosition","description":"Moves the mouse cursor to a specific position on the screen."},{"title":"Navigation","link":"Navigation"},{"title":"Navigation#back","link":"back","description":"Navigates backward in the browser's history."},{"title":"Navigation#forward","link":"forward","description":"Navigates forward in the browser's history."},{"title":"Navigation#refresh","link":"refresh","description":"Refreshes the current page."},{"title":"Screenshot","link":"Screenshot"},{"title":"Screenshot#take","link":"take","description":"Takes a screenshot and saves it using the screenshot manager."},{"title":"Scroll","link":"Scroll"},{"title":"Scroll#byLines","link":"byLines","description":"Scrolls the page by the specified number of lines. This method is only supported in Firefox."},{"title":"Scroll#byPages","link":"byPages","description":"Scrolls the page by the specified number of pages."},{"title":"Scroll#byPixels","link":"byPixels","description":"Scrolls the page by the specified number of pixels."},{"title":"Scroll#toBottom","link":"toBottom","description":"Scrolls to the bottom of the page, scrolling page by page with a delay between each scroll."},{"title":"Select","link":"Select"},{"title":"Select#deselectById","link":"deselectById","description":"Deselects all options in a `` element by its ID."},{"title":"Select#getValuesById","link":"getValuesById","description":"Retrieves all option values in a `` element by its ID and the index of the option."},{"title":"Select#selectByIdAndValue","link":"selectByIdAndValue","description":"Selects an option in a `` element by its name and the index of the option."},{"title":"Select#selectByNameAndValue","link":"selectByNameAndValue","description":"Selects an option in a `` element by its ID."},{"title":"Select#getSelectedValueById","link":"getSelectedValueById","description":"Retrieves the value of the selected option in a `` element by its ID."},{"title":"Select#selectByIdAndIndex","link":"selectByIdAndIndex","description":"Selects an option in a `` element by its ID and the value of the option."},{"title":"Select#selectByNameAndIndex","link":"selectByNameAndIndex","description":"Selects an option in a `` element by its name and the value of the option."},{"title":"Set","link":"Set"},{"title":"Set#innerHtml","link":"innerHtml","description":"Sets the innerHTML of an element using a CSS selector."},{"title":"Set#innerHtmlById","link":"innerHtmlById","description":"Sets the innerHTML of an element using its ID."},{"title":"Set#innerText","link":"innerText","description":"Sets the innerText of an element using a CSS selector."},{"title":"Set#innerTextById","link":"innerTextById","description":"Sets the innerText of an element using its ID."},{"title":"Set#value","link":"value","description":"Sets the value of an element using a CSS selector."},{"title":"Set#valueById","link":"valueById","description":"Sets the value of an element using its ID."},{"title":"SingleClick","link":"SingleClick"},{"title":"SingleClick#atCursor","link":"atCursor","description":"Performs a single mouse click at the current cursor position."},{"title":"SingleClick#atCursorAndWait","link":"atCursorAndWait","description":"Performs a single mouse click at the current cursor position and waits on the\npage complete check."},{"title":"SingleClick#byLinkText","link":"byLinkText","description":"Clicks on a link whose visible text matches the given string."},{"title":"SingleClick#byLinkTextAndWait","link":"byLinkTextAndWait","description":"Clicks on a link whose visible text matches the given string and waits on the opage complete check."},{"title":"SingleClick#byPartialLinkText","link":"byPartialLinkText","description":"Clicks on a link whose visible text contains the given substring."},{"title":"SingleClick#byPartialLinkTextAndWait","link":"byPartialLinkTextAndWait","description":"Clicks on a link whose visible text contains the given substring and waits on the\npage complete checl."},{"title":"SingleClick#bySelector","link":"bySelector","description":"Performs a single mouse click on an element matching a given CSS selector."},{"title":"SingleClick#bySelectorAndWait","link":"bySelectorAndWait","description":"Performs a single mouse click on an element matching a given CSS selector and waits on the page complete check."},{"title":"SingleClick#byXpath","link":"byXpath","description":"Performs a single mouse click on an element matching a given XPath selector."},{"title":"SingleClick#byXpathAndWait","link":"byXpathAndWait","description":"Performs a single mouse click on an element matching a given XPath selector and wait for page complete check."},{"title":"StopWatch","link":"StopWatch"},{"title":"StopWatch#getName","link":"getName","description":"Gets the name of the stopwatch."},{"title":"StopWatch#start","link":"start","description":"Starts the stopwatch."},{"title":"StopWatch#stop","link":"stop","description":"Stops the stopwatch."},{"title":"StopWatch#stopAndAdd","link":"stopAndAdd","description":"Stops the stopwatch and automatically adds the measured time to the\nlast measured page. Logs an error if no page has been measured."},{"title":"Switch","link":"Switch"},{"title":"Switch#toFrame","link":"toFrame","description":"Switches to a frame identified by its ID."},{"title":"Switch#toFrameBySelector","link":"toFrameBySelector","description":"Switches to a frame identified by a CSS selector."},{"title":"Switch#toFrameByXpath","link":"toFrameByXpath","description":"Switches to a frame identified by an XPath."},{"title":"Switch#toNewTab","link":"toNewTab","description":"Opens a new tab and optionally navigates to a URL."},{"title":"Switch#toNewWindow","link":"toNewWindow","description":"Opens a new window and optionally navigates to a URL."},{"title":"Switch#toParentFrame","link":"toParentFrame","description":"Switches to the parent frame of the current frame."},{"title":"Switch#toWindow","link":"toWindow","description":"Switches to a window identified by its name."},{"title":"Wait","link":"Wait"},{"title":"Wait#byCondition","link":"byCondition","description":"Waits for a JavaScript condition to return a truthy value within a maximum time."},{"title":"Wait#byId","link":"byId","description":"Waits for an element with a specific ID to appear within a maximum time."},{"title":"Wait#byPageToComplete","link":"byPageToComplete","description":"Waits for the page to finish loading."},{"title":"Wait#bySelector","link":"bySelector","description":"Waits for an element located by a CSS selector to appear within a maximum time."},{"title":"Wait#byTime","link":"byTime","description":"Waits for a specified amount of time."},{"title":"Wait#byXpath","link":"byXpath","description":"Waits for an element located by XPath to appear within a maximum time."}]} \ 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 a1b74a952..5bb80e529 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 bf8e162a0..8577add7c 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
  */
@@ -16,4 +16,4 @@ export default async function (context, commands) {
   await commands.navigate('https://www.sitespeed.io');
   return commands.measure.start('https://www.sitespeed.io/documentation/');
 }
-
\ No newline at end of file +
\ No newline at end of file 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 f43fcc019..2ad3ee0b8 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() {
@@ -26,4 +26,4 @@ export default async function (context, commands) {
   await commands.click.byLinkTextAndWait('Last 30 days');
   await commands.measure.stop();
 };
-

Will result in:

Title and description for a script

\ No newline at end of file +

Will result in:

Title and description for a script

\ No newline at end of file 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 2ac759d97..f3db2311e 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
  */
@@ -73,4 +73,4 @@ export default async function (context, commands) {
   await commands.mouse.singleClick.byLinkTextAndWait('Learn');
   return commands.measure.stop();
 }
-

And run it like this: sitespeed.io react.mjs --multi --spa --video --visualMetrics

If you are testing a SPA it's important to add the --spa switch. That helps Browsertime to setup some extra functionality to test that page (like instead of waiting for the onloadEvent to stop the measurement, it waits for silence in the network log).

The Chrome team has the following defintion of a Soft navigation:

  1. The navigation is initiated by a user action.
  2. The navigation results in a visible URL change to the user, and a history change.
  3. The navigation results in a DOM change.

For Browsertime it's important that the URL change, that's how we know that we are measuruing a new page.

If your page do not change the URL or load any resources (JSON/JavaScript/CSS or images) when you do the "soft" navigation then you need to use the stop watch to measure that kind of navigation.

\ No newline at end of file +

And run it like this: sitespeed.io react.mjs --multi --spa --video --visualMetrics

If you are testing a SPA it's important to add the --spa switch. That helps Browsertime to setup some extra functionality to test that page (like instead of waiting for the onloadEvent to stop the measurement, it waits for silence in the network log).

The Chrome team has the following defintion of a Soft navigation:

  1. The navigation is initiated by a user action.
  2. The navigation results in a visible URL change to the user, and a history change.
  3. The navigation results in a DOM change.

For Browsertime it's important that the URL change, that's how we know that we are measuruing a new page.

If your page do not change the URL or load any resources (JSON/JavaScript/CSS or images) when you do the "soft" navigation then you need to use the stop watch to measure that kind of navigation.

\ No newline at end of file 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 ef430ce89..3093fd2d2 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
  */
@@ -66,4 +66,4 @@ export default async function (context, commands) {
   return commands.measure.stop();
 };
 

Add text

You can add text to input elements. The element needs to visible. You can also send pressable keys as Unicode PUA (PrivateUser Area) format.

The add text command.

Switch

You can switch to frames/windows or tabs using the the switch commands.

Set

Using the set commands you can set values to HTML elements.

Select

You can use the select command for selecting an option in a drop-down field.

Alert boxes

If you need to click on an alert box, the best way is to use Selenium directly. Here's an example on how to accept an alert box.

await context.selenium.driver.switchTo().alert().accept();
-
\ No newline at end of file +
\ No newline at end of file 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 ba2030b5f..ee940407b 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
  */
@@ -28,4 +28,4 @@ export default async function (context, commands) {
   await commands.cache.clearKeepCookies();
   // and then access the URL you wanna test.
 }
-

You can use the Navigation command to go back, forward or refresh the page in the browser.

\ No newline at end of file +

You can use the Navigation command to go back, forward or refresh the page in the browser.

\ No newline at end of file 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 2a77ee775..917435470 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 report. This is needed for all errors except navigating/measuring a URL. They will automatically be reported (since they are always important).

If you measuring a page in a user journey and it fails, you can stop your measurements as a error and not collect any metrics. This works from Browsertime 21.2.0 and sitespeed.io 33.0.0.

/**
+    
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 report. This is needed for all errors except navigating/measuring a URL. They will automatically be reported (since they are always important).

If you measuring a page in a user journey and it fails, you can stop your measurements as a error and not collect any metrics. This works from Browsertime 21.2.0 and sitespeed.io 33.0.0.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
@@ -52,4 +52,4 @@ export default async function (context, commands) {
     await commands.screenshot.take('my-failure');
   }
  }
-
\ No newline at end of file +
\ No newline at end of file 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 bdf5d3eaf..474db7b43 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
  */
@@ -45,4 +45,4 @@ export default async function (context, commands) {
     await commands.measure.stopAsError('Could not click the next page link');
   }
  }
-
\ No newline at end of file +
\ No newline at end of file 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 afc220e1a..3cedea480 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 and sitespeed.io by providing code completions, parameter info, quick info, and member lists. Here's how to set it up.

Prerequisites

Before starting, ensure that you have NodeJS and npm installed on your system. You can download them from NodeJS official website.

Step 1: Create a New Project

  1. Create a new directory for your project.
  2. Open a terminal and navigate to your project directory.
  3. Run the following command to initialize a new npm project: npm init
  4. Follow the prompts to set up your project.

Step 2: Install Browsertime

To install Browsertime and its types, use npm. In your project directory, run:

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 and sitespeed.io by providing code completions, parameter info, quick info, and member lists. Here's how to set it up.

Prerequisites

Before starting, ensure that you have NodeJS and npm installed on your system. You can download them from NodeJS official website.

Step 1: Create a New Project

  1. Create a new directory for your project.
  2. Open a terminal and navigate to your project directory.
  3. Run the following command to initialize a new npm project: npm init
  4. Follow the prompts to set up your project.

Step 2: Install Browsertime

To install Browsertime and its types, use npm. In your project directory, run:

npm install browsertime --save-dev
 

This command installs Browsertime as a developer dependency.

Step 3: Configure Visual Studio Code

  1. In Visual Studio Code, open your project.
  2. Go to Settings (use Ctrl + , or Cmd + , on Mac).
  3. Search for JavaScript › Suggest: Names.
  4. Disable this setting. This helps in ensuring that IntelliSense only suggests existing properties and functions related to Browsertime objects.

Step 4: Reload Visual Studio Code

After making these changes, reload Visual Studio Code to apply the new settings.

Step 5: Start Scripting

Now, as you write your Browsertime scripts, IntelliSense will assist you as long as you add the correct parameters. It automatically suggests relevant methods and properties. Here's a template to get you started:

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
@@ -24,4 +24,4 @@ export default async function (context, commands) {
     "description": "Sitespeed.io scripting"
   }
 }
-

Replace "sitespeed.ioScripting" with your preferred prefix that will trigger the snippet.

  1. Save the Snippets File: Save the file (Ctrl + S or Cmd + S).
\ No newline at end of file +

Replace "sitespeed.ioScripting" with your preferred prefix that will trigger the snippet.

  1. Save the Snippets File: Save the file (Ctrl + S or Cmd + S).
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-09-Examples.html b/docs/documentation/sitespeed.io/scripting/tutorial-09-Examples.html index d23e6ba6c..21e955b85 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
  */
@@ -304,4 +304,4 @@ module.exports = async function (context, commands) {
     "urls": ["url1", "url2", "url3"]
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-10-Selenium.html b/docs/documentation/sitespeed.io/scripting/tutorial-10-Selenium.html index ae235fbe9..495a8cf83 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.

/**
+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.

/**
  * @param {import('browsertime').BrowsertimeContext} context
  * @param {import('browsertime').BrowsertimeCommands} commands
  */
@@ -37,4 +37,4 @@ export default async function (context, commands) {
   // Stop the measuerment
   return commands.measure.stop();
 }
-

If you need help with Selenium, checkout the official Selenium documentation.

\ No newline at end of file +

If you need help with Selenium, checkout the official Selenium documentation.

\ No newline at end of file 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 e8b9ab259..f5964420b 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
  */
@@ -68,4 +68,4 @@ export default async function (context, commands) {
   return commands.measure.start('https://www.sitespeed.io/search/');
 }
 
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/documentation/sitespeed.io/scripting/tutorial-12-Android.html b/docs/documentation/sitespeed.io/scripting/tutorial-12-Android.html index fdac407d4..032fe93e8 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
  */
@@ -26,4 +26,4 @@ export default async function (context, commands) {
     'https://www.sitespeed.io'
   );
 };
-
\ No newline at end of file +
\ No newline at end of file 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 4b156fa42..6d051b8fe 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
  */
@@ -107,4 +107,4 @@ module.exports = {
   tearDown: tearDown,
   test: perfTest
 };
-
\ No newline at end of file +
\ No newline at end of file